remove todo for fga, add support for hide_ok in mem
This commit is contained in:
parent
b163eb516e
commit
e783b5c86e
2 changed files with 9 additions and 4 deletions
|
@ -1,4 +1,3 @@
|
||||||
# TODO: tidy up the fucking code
|
|
||||||
import plugins
|
import plugins
|
||||||
import requests
|
import requests
|
||||||
import time
|
import time
|
||||||
|
|
|
@ -4,10 +4,16 @@ import plugins
|
||||||
|
|
||||||
class PluginThread(plugins.PluginThreadCommon):
|
class PluginThread(plugins.PluginThreadCommon):
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
super(PluginThread, self).__init__(config)
|
defaults = {'problem': 85}
|
||||||
|
super(PluginThread, self).__init__(config, defaults)
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
mem_stat = psutil.virtual_memory()
|
mem_stat = psutil.virtual_memory()
|
||||||
|
if mem_stat.percent > self.conf['problem']:
|
||||||
|
self.hide = False
|
||||||
|
self.status['urgent'] = True
|
||||||
|
else:
|
||||||
|
self.hide = True
|
||||||
|
self.status['urgent'] = False
|
||||||
mem_available = str(round(mem_stat.available / 2**30, 2))
|
mem_available = str(round(mem_stat.available / 2**30, 2))
|
||||||
mem = 'RAM: ' + mem_available + 'G'
|
self.status['full_text'] = 'RAM: ' + str(mem_available) + 'G'
|
||||||
self.status['full_text'] = mem
|
|
||||||
|
|
Loading…
Reference in a new issue