monitoring.py/monitors/processes.py

12 lines
280 B
Python
Raw Normal View History

2019-12-30 15:18:42 +00:00
import os
class Processes:
interval = 10;
loopCount = 0
def __init__(self, exporter):
self.exporter = exporter
def run(self):
stream = os.popen('ps fax | wc -l')
output = stream.read()
self.exporter.gauge("processes", int(output))