vdstatus/plugins/mem.py

14 lines
393 B
Python
Raw Normal View History

2016-10-22 19:27:28 +03:00
import psutil
import plugins
2016-10-22 19:27:28 +03:00
class PluginThread(plugins.PluginThreadCommon):
def __init__(self, section, config):
super(PluginThread, self).__init__(section, config)
2016-10-22 19:27:28 +03:00
def main(self):
mem_stat = psutil.virtual_memory()
mem_available = str(round(mem_stat.available / 2**30, 2))
mem = 'RAM: ' + mem_available + 'G'
2016-10-22 19:27:28 +03:00
self.status['full_text'] = mem