Ability to update Alerts from external system?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
tp13nomad
Posts: 2
Joined: Mon Dec 05, 2011 2:36 pm

Ability to update Alerts from external system?

Post by tp13nomad »

Hello,
I am looking into writing an integration to Nagios Core to send notifications, handle the responses and then update the alerts in Nagios. I have been able to find examples and documentation for sending out, but I can't seem to find much in the way of an API for updating the alerts. Can someone point me in the right direction?

Thanks!
--- Travis
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Ability to update Alerts from external system?

Post by agriffin »

I think by alerts you mean status, in which case the API is just UNIX exit codes and stdout. A successful exit code of 0 gives a status of OK, 1 is WARNING, 2 is CRITICAL, and 3 is UNKNOWN. There is also a command file which is meant for passive check results, but I guess you could use it for this too: http://nagios.sourceforge.net/docs/3_0/extcommands.html
tp13nomad
Posts: 2
Joined: Mon Dec 05, 2011 2:36 pm

Re: Ability to update Alerts from external system?

Post by tp13nomad »

Hi hi,
Ok, that looks promising. So, I imagine the workflow like this:
1) An Alert occurs (say disk space at 95%)
2) Nagios runs a command i have set up in command management to fire the notification to my application
3) The user responds with "Ack"
4) My application adds a line to the command file, let's say it is a "ACKNOWLEDGE_HOST_PROBLEM" command.
5) Nagios wakes up and reads this file and performs the actions specified in the ACKNOWLEDGE_HOST_PROBLEM details.

Sound about right?
Happy Monday!
--- Travis
Locked