summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVon Random <von@vdrandom.org>2019-03-06 11:31:39 +0300
committerVon Random <von@vdrandom.org>2019-03-06 11:31:39 +0300
commite783b5c86ee080167de404f86587d3ae965dd931 (patch)
treec4c044cac82873436014474b662bbfc1479f6f6b
parentb163eb516e2d53fe4206971ea735afd603d94d3d (diff)
remove todo for fga, add support for hide_ok in mem
-rw-r--r--plugins/fga.py1
-rw-r--r--plugins/mem.py12
2 files changed, 9 insertions, 4 deletions
diff --git a/plugins/fga.py b/plugins/fga.py
index 4a5da75..ecc5857 100644
--- a/plugins/fga.py
+++ b/plugins/fga.py
@@ -1,4 +1,3 @@
-# TODO: tidy up the fucking code
import plugins
import requests
import time
diff --git a/plugins/mem.py b/plugins/mem.py
index b26a8a6..327020a 100644
--- a/plugins/mem.py
+++ b/plugins/mem.py
@@ -4,10 +4,16 @@ import plugins
class PluginThread(plugins.PluginThreadCommon):
def __init__(self, config):
- super(PluginThread, self).__init__(config)
+ defaults = {'problem': 85}
+ super(PluginThread, self).__init__(config, defaults)
def main(self):
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 = 'RAM: ' + mem_available + 'G'
- self.status['full_text'] = mem
+ self.status['full_text'] = 'RAM: ' + str(mem_available) + 'G'