add hostname to system info

This commit is contained in:
Henry Dollman
2024-09-14 18:09:38 -04:00
parent 53b02dd55f
commit 3e95269a7c
4 changed files with 22 additions and 3 deletions

View File

@@ -201,7 +201,7 @@ func (a *Agent) getSystemStats() (system.Info, system.Stats) {
// add host info
if info, err := host.Info(); err == nil {
systemInfo.Uptime = info.Uptime
// systemInfo.Os = info.OS
systemInfo.Hostname = info.Hostname
}
// add cpu stats
if info, err := cpu.Info(); err == nil && len(info) > 0 {

View File

@@ -45,6 +45,8 @@ type NetIoStats struct {
}
type Info struct {
Hostname string `json:"h"`
Cores int `json:"c"`
Threads int `json:"t"`
CpuModel string `json:"m"`