When the alarm is resolved in Zabbix, the opsgeni does not turn off the alarm.
Asked by okan.gun:

I added zabbix to Opsgenie.  
I can see alarms in Opsgenie.  
When the alarm is resolved in Zabbix, the opsgeni does not turn off the alarm.  
/var/log/opsgenie/send2opsgenie.log  
ERROR apiUrl: <https://api.opsgenie.com/v1/json/zabbix>  
WARNING final proxy 0x64efe0

I am getting the above error.

/home/opsgenie/oec/scripts/actionExecutor.py  
alert_api_url = args\['opsgenieUrl'\] + "/v1/alerts/" + alert_id  
I updated the above line to "/v2/alerts/".  
on send2opsgenie.go\*  
apiUrl := configParameters\["opsgenie.api.url"\] + "/v1/json/zabbix"  
I updated the above line to "/v2/json/zabbix".  
Despite these  
ERROR apiUrl: <https://api.opsgenie.com/v1/json/zabbix>  
I get this error.  
send2opsgenie\* I could not open this file.  
Could that be the problem?  
I would appreciate your help


Answers:
author: Andrew Laden
body: Since your triggers from zabbix are creating opsgenie alerts, I doubt the problem is in your script.

One thing to be aware of is that there are two completely different ways to integrate zabbix and opsgenie. The old way using OEC, and the new way using the built in zabbix webhook integration. You should make sure which one you are using.

The webhook:

* <https://github.com/zabbix/zabbix/blob/master/templates/media/opsgenie/README.md>
* <https://www.zabbix.com/integrations/opsgenie#opsgenie>

The OEC based

* <https://support.atlassian.com/opsgenie/docs/integrate-opsgenie-with-zabbix-plugin/>
* <https://blog.zabbix.com/scheduling-and-escalation-made-easy-zabbix-and-opsgenie-integration/10005/>

If you are using send2opsgenie.log, then you are likely using the OEC based one, but you should make sure you aren't trying to use both. Which ever one you configure, make sure you do it completely.

I use the OEC based version, as it predates the webhook, and I have some extra functionality in it.

comments: author: okan.gun
body: Hello Andrew,

Thanks for your comment.  
When I added it with the webhook, the alarms came to opsgenie 10 minutes later.  
So I did it using OEC.  
<https://github.com/opsgenie/opsgenie-integration/issues/25>  
In the link above, api/v1 will be deprecated.  
I may be having problems because of this.  
I couldn't open the send2opsgenie file.  
Is there a way to open this file?  
I opened and edited the send2opsgeni.go file.  
I think I need to fix the log below.  
ERROR apiUrl: <https://api.opsgenie.com/v1/json/zabbix>  
but I looked at all the files. Except this send2opsgenie file.  
I haven't seen anyone with V1.  
Can you help me open the send2opsgenie file?  
Thanks in advance for your help

Thank you


author: Andrew Laden
body: the .go file is source code. It needs to be compiled to create the send2opsgenie binary.

That said, you should not need to modify it. In that post you referenced it says
> [@SvenVD](https://github.com/SvenVD) our integration endpoints will remain the same. We will only deprecate our RESTful API v1 which has endpoints like /v1/json/alerts, /v1/json/schedules, etc. Our integration endpoints like /v1/json/zabbix, /v1/json/servicenow will still be functioning the same. But thank you for your concern!

So you don't need to change that line, and don't need to update the send2opsgenie file.

If your zabbix alert is creating an opsgenie alert, then the send2opsgenie file is working, as the same file is used for all actions.

I would check your setup again and make sure you have the actions specified correctly for close, not just for open.


Tags: cloud

zabbix