Page 1 of 1

Run script when operator ACKs an event

Posted: Tue Mar 18, 2014 10:01 am
by linuxnag
What is the proper procedure of running a script when an operator acknowledges an event?
How do I dig up a comment (if one was entered) ?

GKH

Re: Run script when operator ACKs an event

Posted: Tue Mar 18, 2014 10:12 am
by slansing
An acknowledgement submits a subsystem command via nagios to write the acknowledgement to status.dat, which is normally located here:

Code: Select all

/usr/local/nagios/var/status.dat
You can also see this in the web interface under Home > Incident Management > Acknowledgements.

Re: Run script when operator ACKs an event

Posted: Tue Mar 18, 2014 10:24 am
by linuxnag
Ok, I knew that. And I should have been more detailed in my post.
But, the problem is my "/usr/local/nagios/var/status.dat" is
110,000 lines long and it will get much longer soon.

I can scan through it but running this once a minute
seems like a lot of work.

A better way would be:
/nagiosxi/backend/?cmd=getservicestatus&brevity=0&current_state=ne:0

I'm ok with this except that it is polled rather than dynamic.
If the operator ACKs and the un-ACKS quickly, I can miss
the ACK. But, I can work with it.

Is there any other way maybe? A dynamic way?

GKH

Re: Run script when operator ACKs an event

Posted: Tue Mar 18, 2014 10:32 am
by abrist
You could also look at using the actions component to create an "acknowledge" action that not only acknowledges, but runs a script. The biggest downside to this method is that you will not be able to specify the user used to acknowledge the issue, nor customize the acknowledgement text.