Extend the system informations

This commit is contained in:
Zoltán Papp
2024-01-17 09:03:41 +01:00
parent 9fa0fbda0d
commit ef4a2ccbca
9 changed files with 286 additions and 12 deletions

17
client/system/reboot.go Normal file
View File

@@ -0,0 +1,17 @@
package system
import (
"time"
"github.com/shirou/gopsutil/host"
log "github.com/sirupsen/logrus"
)
func lastReboot() string {
info, err := host.Info()
if err != nil {
log.Errorf("failed to get boot time: %s", err)
return ""
}
return time.Unix(int64(info.BootTime), 0).String()
}