monitoring.py/run.py
2019-12-30 16:22:35 +01:00

30 lines
775 B
Python

import time
from exporter.cli import Cli
from exporter.statsd import Statsd
from monitors.load import Load
from monitors.hdd import HDD
from monitors.processes import Processes
from monitors.ram import Ram
from monitors.cpu import CPU
from monitors.user import User
from monitors.network import Network
#exporter = Cli()
exporter = Statsd()
checks = []
checks.append(Load(exporter))
checks.append(HDD(exporter))
checks.append(Processes(exporter))
checks.append(Ram(exporter))
checks.append(CPU(exporter))
checks.append(User(exporter))
checks.append(Network(exporter))
while True:
for check in checks:
if check.loopCount > check.interval:
check.run()
check.loopCount = -1;
check.loopCount = check.loopCount + 1
time.sleep(1)