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?
Nagios xi / Opsgenie integration
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Nagios xi / Opsgenie integration
HI,
https://docs.opsgenie.com/docs/integration-api
Let us know what you find out. Thanks, Benjamin
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.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.
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.Is there any ports that need to be open on the Nagios server that Opsgenie is sending to?
That looks to be the main URL for the API, see:What is the “source” URL that the response is coming from Opsgenie to Nagios? api.opgenie.com?
https://docs.opsgenie.com/docs/integration-api
Let us know what you find out. Thanks, Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 69
- Joined: Wed Jul 17, 2019 2:09 pm
Re: Nagios xi / Opsgenie integration
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.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.
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Nagios xi / Opsgenie integration
HI,
Good luck and let us know what you find out.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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 69
- Joined: Wed Jul 17, 2019 2:09 pm
Re: Nagios xi / Opsgenie integration
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.
``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.
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Nagios xi / Opsgenie integration
Hi,
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.
The Details:
Let me know if that's something they can work out a solution with.
Regards,
Benjamin
Reference:
Nagios Command Pipe and CGIs
So the good news here is that you can run any of those Nagios Core external commands via the REST API.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
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>
A sample command from API: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>
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"
Regards,
Benjamin
Reference:
Nagios Command Pipe and CGIs
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 69
- Joined: Wed Jul 17, 2019 2:09 pm
Re: Nagios xi / Opsgenie integration
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={####}",
"command_url": "http://localhost/nagiosxi/api/v1/system ... nd?apikey={####}",
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
Re: Nagios xi / Opsgenie integration
Locking threadseaward1983 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={####}",