From 8f33fe30b320683bed8a7fc566ff1abdf33cc66a Mon Sep 17 00:00:00 2001 From: Nathan Liefting Date: Thu, 30 Jan 2020 15:42:03 +0100 Subject: [PATCH] Updated zabbix2opsgenie.go to allow for ack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated zabbix2opsgenie.go to allow for filtering on acknowledged yes or no. Important to add: /etc/opsgenie/zabbix2opsgenie -triggerName='{TRIGGER.NAME}' -triggerId='{TRIGGER.ID}' -triggerStatus='{TRIGGER.STATUS}' -triggerSeverity='{TRIGGER.SEVERITY}' -triggerDescription='{TRIGGER.DESCRIPTION}' -triggerUrl='{TRIGGER.URL}' -triggerValue='{TRIGGER.VALUE}' -triggerHostGroupName='{TRIGGER.HOSTGROUP.NAME}' -hostName='{HOST.NAME}' -ipAddress='{IPADDRESS}' -eventId='{EVENT.ID}' -date='{DATE}' -time='{TIME}' -itemKey='{ITEM.KEY}' -itemValue='{ITEM.VALUE}' -recoveryEventStatus='{EVENT.RECOVERY.STATUS} -eventAck='{EVENT.ACK.STATUS}’ To Zabbix action 'Update Operation' OpsGenie should filters should allow for filtering on this as well to make this change possible. --- zabbix/zabbix/zabbix2opsgenie.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zabbix/zabbix/zabbix2opsgenie.go b/zabbix/zabbix/zabbix2opsgenie.go index 4fc6cef..8c9809e 100755 --- a/zabbix/zabbix/zabbix2opsgenie.go +++ b/zabbix/zabbix/zabbix2opsgenie.go @@ -264,7 +264,8 @@ func parseFlags()map[string]string{ tags := flag.String ("tags","","tags") responders := flag.String ("responders","","responders") logPath := flag.String("logPath", "", "LOGPATH") - + eventAck := flag.string("eventAck", "", "EVENTACK") + flag.Parse() parameters["triggerName"] = *triggerName @@ -283,6 +284,7 @@ func parseFlags()map[string]string{ parameters["itemValue"] = *itemValue parameters["eventId"] = *eventId parameters["recoveryEventStatus"] = *recoveryEventStatus + parameters["eventAck"] = *eventAck if *apiKey != ""{ configParameters["apiKey"] = *apiKey