[ Agent ] [ Status ] - refresh status part

This commit is contained in:
zeaslity
2023-12-20 15:50:08 +08:00
parent 3312052645
commit 4d56083b5a
15 changed files with 423 additions and 68 deletions

22
agent-go/status/Host.go Normal file
View File

@@ -0,0 +1,22 @@
package status
import (
"github.com/shirou/gopsutil/v3/host"
)
type HostInfo struct {
host.InfoStat
}
func GetHostInfo() (*HostInfo, error) {
info, err := host.Info()
if err != nil {
log.ErrorF("get host info error => %v", err)
return nil, err
}
return &HostInfo{
InfoStat: *info,
}, nil
}