mirror of https://github.com/nicolargo/glances
Correct bug on the monitored interface
parent
f811fb84ff
commit
825573a210
|
@ -125,22 +125,19 @@ class monitorList:
|
|||
|
||||
# Iter uppon the monitored list
|
||||
for i in range(0, len(self.get())):
|
||||
# Search monitored processes by a regular expression
|
||||
processlist = glances_processes.getlist()
|
||||
monitoredlist = [p for p in processlist if re.search(self.regex(i), p['cmdline']) is not None]
|
||||
self.__monitor_list[i]['count'] = len(monitoredlist)
|
||||
|
||||
if (self.command(i) is None):
|
||||
# If there is no command specified in the conf file
|
||||
# then display CPU and MEM %
|
||||
|
||||
# Search monitored processes by a regular expression
|
||||
processlist = glances_processes.getlist()
|
||||
monitoredlist = [p for p in processlist if re.search(self.regex(i), p['cmdline']) is not None]
|
||||
|
||||
self.__monitor_list[i]['count'] = len(monitoredlist)
|
||||
self.__monitor_list[i]['result'] = "CPU: {0:.1f}% | MEM: {1:.1f}%".format(
|
||||
sum([p['cpu_percent'] for p in monitoredlist]),
|
||||
sum([p['memory_percent'] for p in monitoredlist]))
|
||||
continue
|
||||
else:
|
||||
# No process to count
|
||||
self.__monitor_list[i]['count'] = 1
|
||||
# Execute the user command line
|
||||
try:
|
||||
self.__monitor_list[i]['result'] = subprocess.check_output(self.command(i),
|
||||
|
|
|
@ -53,8 +53,7 @@ class Plugin(GlancesPlugin):
|
|||
|
||||
def update(self):
|
||||
"""
|
||||
Nothing to do here
|
||||
Just return the global glances_log
|
||||
Update the monitored list
|
||||
"""
|
||||
# Check if the glances_monitor instance is init
|
||||
if (self.glances_monitors == None):
|
||||
|
|
Loading…
Reference in New Issue