monitoring.py/run.py

31 lines
784 B
Python
Raw Normal View History

2019-12-30 15:18:42 +00:00
import time
from exporter.cli import Cli
2019-12-30 15:24:22 +00:00
from exporter.statsd-exporter import Statsd
2019-12-30 15:18:42 +00:00
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
2019-12-30 15:22:35 +00:00
#exporter = Cli()
exporter = Statsd()
2019-12-30 15:18:42 +00:00
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)