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
Run script when operator ACKs an event
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Run script when operator ACKs an event
An acknowledgement submits a subsystem command via nagios to write the acknowledgement to status.dat, which is normally located here:
You can also see this in the web interface under Home > Incident Management > Acknowledgements.
Code: Select all
/usr/local/nagios/var/status.datRe: Run script when operator ACKs an event
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¤t_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
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¤t_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
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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.