mirror of
https://github.com/fankes/komari-agent.git
synced 2025-10-19 11:09:22 +08:00
feat(monitoring): 增加网络总量和进程计数监控
- 在 net.go 中添加总量统计功能,记录上次采样值 - 在 main.go 中添加进程计数监控 - 修改 remote.go 中的 JSON 字段名称 - 优化 report 函数,增加网络总量和进程计数数据
This commit is contained in:
@@ -16,10 +16,10 @@ type RemoteConfig struct {
|
||||
Swap bool `json:"swap"`
|
||||
Load bool `json:"load"`
|
||||
Uptime bool `json:"uptime"`
|
||||
Temperature bool `json:"temperature"`
|
||||
Temperature bool `json:"temp"`
|
||||
Os bool `json:"os"`
|
||||
Disk bool `json:"disk"`
|
||||
Network bool `json:"network"`
|
||||
Network bool `json:"net"`
|
||||
Process bool `json:"process"`
|
||||
Interval int `json:"interval"`
|
||||
Connections bool `json:"connections"`
|
||||
@@ -38,7 +38,7 @@ func LoadRemoteConfig(endpoint string, token string) (RemoteConfig, error) {
|
||||
var err error
|
||||
|
||||
for attempt := 1; attempt <= maxRetry; attempt++ {
|
||||
resp, err = http.Get(endpoint,)
|
||||
resp, err = http.Get(endpoint)
|
||||
if err == nil && resp.StatusCode == http.StatusOK {
|
||||
break
|
||||
}
|
||||
|
Reference in New Issue
Block a user