Opsgenie integration fails to close alerts

Hey,

I am experiencing the same issue as described here: Opsgenie plugin in CEE 1.6.0p8 does not send complete close

I am running CRE 1.6.0p13 - the logs tell me Check MK successfully closes the alert, but on the Opsgenie side it complains as it cannot correlate the “close” message with any open ticket due to SVC_PROBLEM_ID being 0.

I’ve read through the code for the Opsgenie integration, and I’ve looked at logs - I have not gotten a lot wiser. It might seem like the integration is doing what it should, but is being passed a problem ID of 0…regardless?

Any pointers would be great! If I cannot make this work, I’ll have to go the old route of installing the Opsgenie RPMs and using my custom Opsgenie plugin (which I created long before there was an internal integration in Check MK…) which calls Opsgenie on the command line…

Best regards,
Christian :slight_smile:

I haven’t gotten much deeper into this, but I’ve been dumping variables in custom notification scripts as well as enabling “full notification logs” w/variable dumps. It does appear the plugins are doing what they should, but the SERVICEPROBLEMID is 0 from Nagios/Check MK. I don’t quite get why it would ever be 0, so I’m puzzled.

As a side note, it didn’t quite work out for me to just shell out/use my old integration, as the Opsgenie CLI stuff does not seem to allow me to set different baseURLs via CLI. I need to send alerts to two separate Opsgenie-accounts, and one uses “app.opsgenie.com” and the other needs “app.eu.opsgenie.com”. I can override the apiKey via command line parameters, but the baseURL is only read from config.json (…and I’ve yet to find a way to override the config path…) - in other words I cannot, by default, use one binary with two different Opsgenie accounts if the accounts are not using the same Opsgenie endpoint.

So, my workaround here (for now) was patching the Opsgenie send2nagios Go code to allow passing a baseUrl parameter on the command line, compiling it and copying it back to this monitoring server. As I just copied the/my Check MK plugin wrapper for this specific purpose (I had a “Notify by Opsgenie” plugin, which I - for now - copied into “Notify by Opsgenie-OTHERTEAM” (or something like that :wink: ) ) instead of mangling/passing parameters through WATO, I just edited the “Notify by Opsgenie-OTHERTEAM” plugin. Originally I just added the apiKey parameter. I changed this to use my patched send2nagios under its own name, so now I call send2nagios-otherteam -baseUrl "https://api.eu.opsgenie.com" -apiKey "mykey" (follow by all the other parameters…).

It works (hooray!), so I have a solution for now - but I wish I could get to the bottom of the PROBLEM ID being 0.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.