Skip to content

Commit

Permalink
Trigger detection fixed when item name != item key
Browse files Browse the repository at this point in the history
  • Loading branch information
NSDDataDope committed Dec 17, 2019
1 parent 8830932 commit 9cafab3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions elastalert/zabbix.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ def alert(self, matches):
# All host triggers are obtained and then locally filtered to avoid
# multiple ZabbixAPI requests
triggers = self.zbx_client.trigger.get(selectTags=['tag', 'value'],
selectItems=['name'],
selectItems=['key_'],
filter={'host': self.zbx_host})

filtered_triggers = []
for trigger in triggers:
found = False
for item in trigger['items']:
if item['name'] == self.zbx_key:
if item['key_'] == self.zbx_key:
found = True
break
if found:
Expand Down

0 comments on commit 9cafab3

Please sign in to comment.