Page 1 of 1

Need Event Handler execute on specified Host or Client

Posted: Sat Aug 03, 2019 12:58 am
by anjali
Hello Team,
1) I want to execute Event handler on some different host, so I need your help to do that.
For Example: Assume we have a Nagios server and 2 clients or Host : Client 1 and Client 2. Now if notification service get down in Client 1 so I want to execute some service in Client 2.

2) I also want to execute Event handler on host groups.

Re: Need Event Handler execute on specified Host or Client

Posted: Sat Aug 03, 2019 6:56 pm
by eloyd
#2 first: Event handlers occur on hosts and services. Not groups of hosts or services. So make a host template called "event handler hosts" and set the event handler on that template and assign a hostgroup to that template. Then use that template to assign to your hosts and now you've assigned a host group and an event handler with one template.

#1 next: See your other question about event handlers. Then read the event handler documentation at https://assets.nagios.com/downloads/nag ... dlers.html. Event handlers can be specific to each host or service and custom for that host/service. Or you can make them generic and pass in the information that they need to know what host or service they're running on so the script can make decisions about what actions to take.

Re: Need Event Handler execute on specified Host or Client

Posted: Mon Aug 05, 2019 8:50 am
by scottwilkerson
thanks @eloyd

Re: Need Event Handler execute on specified Host or Client

Posted: Mon Aug 05, 2019 8:59 am
by eloyd
It just dawned on me that you may be talking about service dependencies for #1. If you just want to execute service check 2 when service check 1 is in a failure state, then that's a service dependency.

Re: Need Event Handler execute on specified Host or Client

Posted: Mon Aug 05, 2019 3:58 pm
by ssax
Thanks eloyd!

anjali, let us know if you have any questions or need any clarification.

Re: Need Event Handler execute on specified Host or Client

Posted: Wed Aug 07, 2019 8:18 am
by anjali
Thanks, Team.
I achieve that by using argument in a custom command.

Re: Need Event Handler execute on specified Host or Client

Posted: Thu Aug 08, 2019 5:02 pm
by mbellerue
Did the custom command solve your issue? If so, I will close the thread.

Re: Need Event Handler execute on specified Host or Client

Posted: Fri Aug 09, 2019 2:34 am
by anjali
Yes, it solves my issue, you can close that thread.

Re: Need Event Handler execute on specified Host or Client

Posted: Fri Aug 09, 2019 6:56 am
by scottwilkerson
anjali wrote:Yes, it solves my issue, you can close that thread.
Great!

Locking