Hello Team,
I want to execute two event handler on the same service, one I need to execute when service is down and another I want to execute when service is again up.
So how I can achieve that? Please help me in that.
Two Event handler on same service
Re: Two Event handler on same service
One event handler for both things. If you read the event handler documentation (https://assets.nagios.com/downloads/nag ... dlers.html) you'll see that the event handler can be told if this is a CRITICAL (going down) or an OK (recovery/coming up) event. You would program your script to take different actions accordingly.
Re: Two Event handler on same service
Hello,
But how I can get that event handler is executed for up or downstate in my custom script?
But how I can get that event handler is executed for up or downstate in my custom script?
Re: Two Event handler on same service
Read the documentation. Assigning the event handler will make it execute for every check performed. It's up to you to write the handler in such a way that it knows whether it is supposed to do something or not.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Two Event handler on same service
Eric is right, in the documentation he referenced https://assets.nagios.com/downloads/nag ... dlers.html you can see in the script you can put the code you want to execute in different parts of the example script to run on different state changes
Re: Two Event handler on same service
ok thanks, I achieve that by using service state in my custom script.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Two Event handler on same service
Great!anjali wrote:ok thanks, I achieve that by using service state in my custom script.
Locking thread