mirror of
https://github.com/fankes/komari-agent.git
synced 2025-10-18 18:49:23 +08:00
deps: 更新 gopsutil 依赖至 v4 版本
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/shirou/gopsutil/cpu"
|
||||
"github.com/shirou/gopsutil/v4/cpu"
|
||||
)
|
||||
|
||||
type CpuInfo struct {
|
||||
|
@@ -3,7 +3,7 @@ package monitoring
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/shirou/gopsutil/disk"
|
||||
"github.com/shirou/gopsutil/v4/disk"
|
||||
)
|
||||
|
||||
type DiskInfo struct {
|
||||
@@ -53,10 +53,9 @@ func isPhysicalDisk(part disk.PartitionStat) bool {
|
||||
strings.HasPrefix(fstype, "smb") || fstype == "vboxsf" || fstype == "9p" ||
|
||||
strings.Contains(fstype, "fuse") {
|
||||
return false
|
||||
}
|
||||
// Windows 网络驱动器通常是映射盘符,但不容易通过fstype判断
|
||||
} // Windows 网络驱动器通常是映射盘符,但不容易通过fstype判断
|
||||
// 可以通过opts判断,Windows网络驱动通常有相关选项
|
||||
optsStr := strings.ToLower(part.Opts)
|
||||
optsStr := strings.ToLower(strings.Join(part.Opts, ","))
|
||||
if strings.Contains(optsStr, "remote") || strings.Contains(optsStr, "network") {
|
||||
return false
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package monitoring
|
||||
|
||||
import (
|
||||
"github.com/shirou/gopsutil/load"
|
||||
"github.com/shirou/gopsutil/v4/load"
|
||||
)
|
||||
|
||||
type LoadInfo struct {
|
||||
|
@@ -2,7 +2,7 @@ package monitoring
|
||||
|
||||
import (
|
||||
"github.com/komari-monitor/komari-agent/cmd/flags"
|
||||
"github.com/shirou/gopsutil/mem"
|
||||
"github.com/shirou/gopsutil/v4/mem"
|
||||
)
|
||||
|
||||
type RamInfo struct {
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/komari-monitor/komari-agent/cmd/flags"
|
||||
"github.com/shirou/gopsutil/net"
|
||||
"github.com/shirou/gopsutil/v4/net"
|
||||
)
|
||||
|
||||
func ConnectionsCount() (tcpCount, udpCount int, err error) {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package monitoring
|
||||
|
||||
import (
|
||||
"github.com/shirou/gopsutil/host"
|
||||
"github.com/shirou/gopsutil/v4/host"
|
||||
)
|
||||
|
||||
func Uptime() (uint64, error) {
|
||||
|
Reference in New Issue
Block a user