23 lines
496 B
Python
23 lines
496 B
Python
import logging as log
|
|
from zabbix import get_active_problems
|
|
from config import conf
|
|
from time import sleep
|
|
|
|
|
|
def main_loop():
|
|
active_alerts = get_active_problems()
|
|
for i in active_alerts:
|
|
print(i)
|
|
print(len(active_alerts))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
log.info("Starting app")
|
|
try:
|
|
while True:
|
|
main_loop()
|
|
sleep(conf.zabbix.upd_interval)
|
|
except KeyboardInterrupt:
|
|
log.info("Manual app stopped")
|
|
log.info("App stopped")
|