refactor(agent): 简化CLI——去掉-p/-D flag,改用子命令 output/discover

- ./aiops-agent output  → Zabbix风格输出全部上报指标(与API一致,含Heartbeat)
- ./aiops-agent discover → Zabbix LLD端口发现JSON
- ./aiops-agent -server URL → 正常采集模式(不变)
- runOutput 构建与 collectAndReport 完全相同的 Report 结构体
- 新增 net.tcp.close_wait 采集(解析/proc/net/tcp state=08)
- 静态编译 (CGO_ENABLED=0) 兼容 Alpine 容器
This commit is contained in:
attacker committed 2026-06-24 14:01:52 +00:00
1 parent d656520428
commit ad714c49f1
3 files changed
+249 -40

No files matched your search

+1
View File
@@ -4,6 +4,7 @@ package model
type NetworkStat struct {
TCPEstablished int `json:"tcp_established"` // ESTABLISHED 连接数
TCPTimeWait int `json:"tcp_time_wait"` // TIME_WAIT 连接数
TCPCloseWait int `json:"tcp_close_wait"` // CLOSE_WAIT 连接数
TCPTotal int `json:"tcp_total"` // TCP 总连接数
NicName string `json:"nic_name"` // 主网卡名
NetRxBPS float64 `json:"net_rx_bps"` // 网卡接收速率 (bytes/s)