Allow to monitor Windows hosts (#6803)

This commit is contained in:
Fabian Affolter 2017-03-27 22:11:15 +02:00 committed by GitHub
parent b8c1bc9542
commit d027df5a89

View file

@ -133,7 +133,11 @@ class GlancesSensor(Entity):
elif self.type == 'swap_free': elif self.type == 'swap_free':
return round(value['memswap']['free'] / 1024**3, 1) return round(value['memswap']['free'] / 1024**3, 1)
elif self.type == 'processor_load': elif self.type == 'processor_load':
return value['load']['min15'] # Windows systems don't provide load details
try:
return value['load']['min15']
except KeyError:
return value['cpu']['total']
elif self.type == 'process_running': elif self.type == 'process_running':
return value['processcount']['running'] return value['processcount']['running']
elif self.type == 'process_total': elif self.type == 'process_total':