-
Notifications
You must be signed in to change notification settings - Fork 3
/
__main__.py
31 lines (30 loc) · 969 Bytes
/
__main__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from zabbixdata import *
from geckoboard import *
from otherdata import *
import configs, pieces
from time import sleep
while True:
try:
gb = Geckoboard()
for piece in pieces.pieces:
kind = piece['kind']
if kind == 'Item':
history = ZabbixData().gethistory(piece)
gb.line(history,piece)
gb.push(piece)
if kind == 'Monitoring':
webmondata = ZabbixData().gethistory(piece)
gb.monitoring(webmondata,piece)
gb.push(piece)
if kind == "Triggers":
triggers = ZabbixData().getunacktriggers()
gb.triggerlist(triggers,piece)
gb.push(piece)
if kind == "Other":
now = OtherData().now()
gb.text(now)
gb.push(piece)
except Exception, e:
print str(e)
finally:
sleep(configs.runinterval)