mirror of https://github.com/cppla/ServerStatus
不统计k8s的虚拟挂载点方案临时解决
parent
c659ea5894
commit
353996ef14
|
@ -458,7 +458,7 @@ func main() {
|
|||
//fmt.Println(time.Now().Format("2006-01-02 15:04:05")," [main]Error transforming client info: ", err)
|
||||
break
|
||||
}
|
||||
logger.Info("\nInfo:\n"+data+"\n")
|
||||
//logger.Info("\nInfo:\n"+data+"\n")
|
||||
info := "update " + data + "\n"
|
||||
_ , err = mainConnect.Write(str2bytes(info))
|
||||
if err != nil {
|
||||
|
|
|
@ -187,8 +187,12 @@ func spaceCount() {
|
|||
continue
|
||||
} else {
|
||||
diskUsageOf, _ := disk.Usage(d.Mountpoint)
|
||||
used += diskUsageOf.Used
|
||||
total += diskUsageOf.Total
|
||||
path := diskUsageOf.Path
|
||||
//不统计K8s的虚拟挂载点,see here:https://github.com/shirou/gopsutil/issues/1007
|
||||
if !strings.Contains(path,"/var/lib/kubelet") {
|
||||
used += diskUsageOf.Used
|
||||
total += diskUsageOf.Total
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue