|
|
@ -15,6 +15,7 @@ import (
|
|
|
|
"unsafe"
|
|
|
|
"unsafe"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/shirou/gopsutil/internal/common"
|
|
|
|
"github.com/shirou/gopsutil/internal/common"
|
|
|
|
|
|
|
|
"github.com/shirou/gopsutil/process"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// from utmpx.h
|
|
|
|
// from utmpx.h
|
|
|
@ -37,6 +38,7 @@ func Info() (*InfoStat, error) {
|
|
|
|
ret.PlatformFamily = family
|
|
|
|
ret.PlatformFamily = family
|
|
|
|
ret.PlatformVersion = version
|
|
|
|
ret.PlatformVersion = version
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
system, role, err := Virtualization()
|
|
|
|
system, role, err := Virtualization()
|
|
|
|
if err == nil {
|
|
|
|
if err == nil {
|
|
|
|
ret.VirtualizationSystem = system
|
|
|
|
ret.VirtualizationSystem = system
|
|
|
@ -49,6 +51,11 @@ func Info() (*InfoStat, error) {
|
|
|
|
ret.Uptime = uptime(boot)
|
|
|
|
ret.Uptime = uptime(boot)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
procs, err := process.Pids()
|
|
|
|
|
|
|
|
if err == nil {
|
|
|
|
|
|
|
|
ret.Procs = uint64(len(procs))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return ret, nil
|
|
|
|
return ret, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|