shirou_gopsutil/host_unix.go

18 lines
242 B
Go
Raw Normal View History

2014-04-18 20:28:00 +08:00
// +build linux freebsd
2014-04-22 08:44:22 +08:00
package gopsutil
2014-04-18 20:28:00 +08:00
import (
"os"
"syscall"
)
func (h Host) HostInfo() (HostInfo, error) {
ret := HostInfo{}
hostname, err := os.Hostname()
ret.Hostname = hostname
ret.Uptime = sysinfo.Uptime
return ret, nil
}