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))