Fixed error with empty triggers list
This commit is contained in:
parent
86d876fd58
commit
0f23620336
@ -55,7 +55,10 @@ class Zabbix(IntervalModule):
|
|||||||
|
|
||||||
cdict["default"] = "{0}:{a[5]}/{a[4]}/{a[3]}/{a[2]}/{a[1]}/{a[0]}".format(sum(alerts), a=alerts)
|
cdict["default"] = "{0}:{a[5]}/{a[4]}/{a[3]}/{a[2]}/{a[1]}/{a[0]}".format(sum(alerts), a=alerts)
|
||||||
cdict["total"] = sum(alerts)
|
cdict["total"] = sum(alerts)
|
||||||
color = alerts_color[max(map(int, alerts_list))]
|
if alerts_list:
|
||||||
|
color = alerts_color[max(map(int, alerts_list))]
|
||||||
|
else:
|
||||||
|
color = alerts_color[0]
|
||||||
result = self.format.format(**cdict)
|
result = self.format.format(**cdict)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user