feat: v0.34 健康探针(Architecture B) + Agent v2.1 + 端口监控 + 告警联系人重构

- v0.31: AlertContact 重构(channel_type下拉+webhook_url替代三分立字段)
- v0.32: Agent ProcessTop 增强(cmdline/user/cpu_pct/mem_pct)
- v0.33: 端口监控 Tab(监听端口自动发现+down联动告警)
- v0.34: 健康探针(Agent本地执行HTTP/TCP/Exec→结果随心跳上报)
- Agent新增: ContextSwitch/FD/HealthProbe采集器
- 后端新增: health_probe handler + Agent model扩展
- HostMonitor新增Tab: 健康探针/端口监控
This commit is contained in:
attacker committed 2026-06-24 19:18:10 +08:00
1 parent e1f75f0bc4
commit d656520428
25 files changed
+1700 -619

No files matched your search

+8
View File
@@ -674,6 +674,8 @@ func Register(r *gin.Engine, db *gorm.DB, log *zap.Logger, cfg *config.Config, c
agentGroup.POST("/tasks/:task_id/result", taskHandler.SubmitResult)
agentGroup.POST("/aggregate", agentHandler.AggregateMetrics)
agentGroup.POST("/exec", agentInstallHandler.RemoteExec)
// 健康探针:Agent 拉取本机配置(无需 JWT)
agentGroup.GET("/health-probes/config", agentHandler.GetHealthProbesForAgent)
}
// Agent 数据查询 + 任务管理(需要 JWT)
agentQuery := authorized.Group("/agent")
@@ -702,6 +704,12 @@ func Register(r *gin.Engine, db *gorm.DB, log *zap.Logger, cfg *config.Config, c
agentQuery.POST("/uninstall", agentInstallHandler.UninstallAgent)
agentQuery.POST("/batch-uninstall", agentInstallHandler.BatchUninstallAgent)
agentQuery.POST("/batch-upgrade", agentInstallHandler.BatchUpgradeAgent)
// 健康探针管理(CRUD)
agentQuery.GET("/health-probes", agentHandler.ListHealthProbes)
agentQuery.POST("/health-probes", agentHandler.CreateHealthProbe)
agentQuery.PUT("/health-probes/:id", agentHandler.UpdateHealthProbe)
agentQuery.DELETE("/health-probes/:id", agentHandler.DeleteHealthProbe)
}
// Agent 二进制下载(无需鉴权,Agent 升级时使用)