提交 09a8b744 编写于 作者: N Nicolas Hennion

Correct a bug on CPU log

上级 ce1799ae
......@@ -83,7 +83,7 @@ mem_critical=90
# * description: Description of the processes (max 16 chars)
# * regex: regular expression of the processes to monitor
# * command: (optional) full path to shell command/script for extended stat
# Use with caution. Should return a single line string.
# Use with caution. Should return a single line string.
# * countmin: (optional) minimal number of processes
# A warning will be displayed if number of process < count
# * countmax: (optional) maximum number of processes
......
......@@ -1909,6 +1909,7 @@ class glancesScreen:
# If current > CAREFUL of max then alert = CAREFUL
# If current > WARNING of max then alert = WARNING
# If current > CRITICAL of max then alert = CRITICAL
# stat is USER, SYSTEM or IOWAIT
try:
variable = (current * 100) / max
except ZeroDivisionError:
......@@ -2343,15 +2344,12 @@ class glancesScreen:
# Log
if cpu:
try:
logs.add(self.__getCpuAlert(cpu['user']), "CPU user",
cpu['user'], proclist)
logs.add(self.__getCpuAlert(cpu['system']), "CPU system",
cpu['system'], proclist)
logs.add(self.__getCpuAlert(cpu['iowait']), "CPU IOwait",
cpu['iowait'], proclist)
except:
pass
logs.add(self.__getCpuAlert(cpu['user'], stat = "USER"), "CPU user",
cpu['user'], proclist)
logs.add(self.__getCpuAlert(cpu['system'], stat = "SYSTEM"), "CPU system",
cpu['system'], proclist)
logs.add(self.__getCpuAlert(cpu['iowait'], stat = "IOWAIT"), "CPU IOwait",
cpu['iowait'], proclist)
# Display per-CPU stats
if screen_y > self.cpu_y + 5 and tag_percpu:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册