|
@@ -51,11 +51,13 @@ func Func_serverStatus(connBot api.WsBot, user_id int) {
|
|
_disk, _ := disk.Usage("/")
|
|
_disk, _ := disk.Usage("/")
|
|
// _net, _ := net.IOCounters(true)
|
|
// _net, _ := net.IOCounters(true)
|
|
|
|
|
|
- response_text := fmt.Sprintf("内存: %v%%,\nCPU:%v%%,\n磁盘:%v%%", fmt.Sprintf("%.1f", _mem.UsedPercent), fmt.Sprintf("%.1f", _cpu[0]), fmt.Sprintf("%.1f", _disk.UsedPercent))
|
|
|
|
- print(response_text)
|
|
|
|
|
|
+ // response_text := fmt.Sprintf("内存: %v%%,\nCPU:%v%%,\n磁盘:%v%%", fmt.Sprintf("%.1f", _mem.UsedPercent), fmt.Sprintf("%.1f", _cpu[0]), fmt.Sprintf("%.1f", _disk.UsedPercent))
|
|
|
|
+ response_text := fmt.Sprintf("内存: %v%%,CPU:%v%%,磁盘:%v%%", fmt.Sprintf("%.1f", _mem.UsedPercent), fmt.Sprintf("%.1f", _cpu[0]), fmt.Sprintf("%.1f", _disk.UsedPercent))
|
|
|
|
+ println(response_text)
|
|
if err != nil {
|
|
if err != nil {
|
|
connBot.Send_private_msg(user_id, "服务器异常")
|
|
connBot.Send_private_msg(user_id, "服务器异常")
|
|
} else {
|
|
} else {
|
|
|
|
+ connBot.Send_private_msg(user_id, "服务器状态:")
|
|
connBot.Send_private_msg(user_id, response_text)
|
|
connBot.Send_private_msg(user_id, response_text)
|
|
}
|
|
}
|
|
}
|
|
}
|