monitoring.py/run.py

29 lines
719 B
Python
Raw Normal View History

2019-12-30 15:18:42 +00:00
import time
from exporter.cli import Cli
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()
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)