Page 1 of 1

Nagios XI / Opsgenie integration

Posted: Wed Sep 09, 2020 3:59 pm
by seaward1983
Nagios XI version: 5.7.3
Red Hat Enterprise Linux Server release 7.8 (Maipo)
Opsgenie - SaaS
Nagios - EC2 instance on AWS

Have followed the setup provided by Opsgenie - https://docs.opsgenie.com/docs/nagiosxi ... ntegration

• Using the contacts they have you set up (with the Manage Host Notification Commands and Manage Service Notification Commands configured)
• The notifications are successfully making it to Opsgenie, ack are not.
• In the "alert log" within Opsgenie (saas solution), we can see that the ack are being sent
[system] Sent [Acknowledge] action to NagiosXIV2 [Nagios XI]
• We do not see any information - at all - the alerts are making it to our Nagios server

I have a ticket opened with Opsgenie - I've asked them the following:

• We do have the NagiosXI plugin (with OEC) installed.
• We are receiving the notifications within Opsgenie FROM Nagios.
• When the notification is ack in Opsgenie - it does not make it back to Nagios. There are no errors in the logs. But there are no receipt notifications in any logs on the Nagios server.

The question surrounds

• Is there any ports that need to be open on the Nagios server that Opsgenie is sending to?
• What is the “source” URL that the response is coming from Opsgenie to Nagios? api.opgenie.com?
• Does my Nagios server have to be public facing?
• If in AWS - does it require a public facing ALB?

Re: Nagios XI / Opsgenie integration

Posted: Thu Sep 10, 2020 4:34 pm
by benjaminsmith
HI,
When the notification is ack in Opsgenie - it does not make it back to Nagios. There are no errors in the logs. But there are no receipt notifications in any logs on the Nagios server.
I believe there is a bug in the opsgenie script where acknowledgments are working for hosts but not for services. Can you verify this behavior or confirm this with Opsgenie support.
Is there any ports that need to be open on the Nagios server that Opsgenie is sending to?
It looks like the opsgenie integration is using the API, so this communication would be over HTTP ports, so that should be ok. However you server would need to have access to the internet.
What is the “source” URL that the response is coming from Opsgenie to Nagios? api.opgenie.com?
That looks to be the main URL for the API, see:
https://docs.opsgenie.com/docs/integration-api

Let us know what you find out. Thanks, Benjamin

Re: Nagios XI / Opsgenie integration

Posted: Mon Sep 14, 2020 9:29 am
by seaward1983
I believe there is a bug in the opsgenie script where acknowledgments are working for hosts but not for services. Can you verify this behavior or confirm this with Opsgenie support.
In this case - it it not working for either. I was on a 1.5 hr call Friday with Opsgenie support. They're still researching. If they provide an answer - will let this thread know - so we can know next time.

Re: Nagios XI / Opsgenie integration

Posted: Mon Sep 14, 2020 5:03 pm
by benjaminsmith
HI,
In this case - it it not working for either. I was on a 1.5 hr call Friday with Opsgenie support. They're still researching. If they provide an answer - will let this thread know - so we can know next time.
Good luck and let us know what you find out.

Re: Nagios XI / Opsgenie integration

Posted: Mon Nov 02, 2020 10:37 am
by seaward1983
Still working on this. Now, up to a point - we're trying to run some commands manually - we've reverted to nagios core --


``Error: No command was specified``

When we're submitting the following payload to http://localhost/nagios/cgi-bin/cmd.cgi:
{'btnSubmit': 'Commit', 'cmd_mod': '2 ', 'send_notification': 'off', 'host': '****', 'com_author': 'opsgenie', 'service': 'Disk Usage on /data', 'com_data': ' Acknowledged by user via Opsgenie', 'sticky_ack': 'on', 'cmd_typ': '34'}

If they could share a way to manually execute this command (with curl or something like that) in a way that works for you, we should be able to take that information and modify what we're doing on our end so that the script executes in the same exact way. Let me know if they're able to provide an example using curl or something similar to execute an ack on a Nagios alert, and we should (hopefully) be able to get this resolved.

Re: Nagios XI / Opsgenie integration

Posted: Mon Nov 02, 2020 4:00 pm
by benjaminsmith
Hi,
If they could share a way to manually execute this command (with curl or something like that) in a way that works for you, we should be able to take that information and modify what we're doing on our end so that the script executes in the same exact way
So the good news here is that you can run any of those Nagios Core external commands via the REST API.

The API Documentation is found in the GUI at Help > API Docs > System Reference > Core System > Core Command. The Nagios Core Command to acknowledge a service is this one:

https://assets.nagios.com/downloads/nag ... mand_id=40

It has the following structure.

Code: Select all

ACKNOWLEDGE_SVC_PROBLEM;<host_name>;<service_description>;<sticky>;<notify>;<persistent>;<author>;<comment>
The Details:
Description:
Allows you to acknowledge the current problem for the specified service. By acknowledging the current problem, future notifications (for the same servicestate) are disabled. If the "sticky" option is set to two (2), the acknowledgement will remain until the service returns to an OK state. Otherwise the acknowledgement will automatically be removed when the service changes state. If the "notify" option is set to one (1), a notification will be sent out to contacts indicating that the current service problem has been acknowledged. If the "persistent" option is set to one (1), the comment associated with the acknowledgement will survive across restarts of the Nagios process. If not, the comment will be deleted the next time Nagios restarts.t>
A sample command from API:

Code: Select all

curl -XPOST "https://192.168.23.112/nagiosxi/api/v1/system/corecommand?apikey=AAXHBIAkAHq5L7nnrHdgah5RKMi7b4uKDrIrqu5ZcukdFKTmH7FRnZInLhtdk0dd" -d "cmd=ACKNOWLEDGE_SVC_PROBLEM;localhost;SSH;2;1;1;%user%;Some Acknowledgement Comment"
Let me know if that's something they can work out a solution with.

Regards,
Benjamin

Reference:
Nagios Command Pipe and CGIs

Re: Nagios XI / Opsgenie integration

Posted: Tue Dec 08, 2020 10:46 am
by seaward1983
Okay - so this can be closed out. Opsgenie had to create a specific actionExecutor.py script to support 5.7.3, but they also changed the .json file to reflect a different command URL

"command_url": "http://localhost/nagiosxi/api/v1/system ... nd?apikey={####}",

Re: Nagios XI / Opsgenie integration

Posted: Tue Dec 08, 2020 11:21 am
by scottwilkerson
seaward1983 wrote:Okay - so this can be closed out. Opsgenie had to create a specific actionExecutor.py script to support 5.7.3, but they also changed the .json file to reflect a different command URL

"command_url": "http://localhost/nagiosxi/api/v1/system ... nd?apikey={####}",
Locking thread