Need Event Handler execute on specified Host or Client

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
anjali
Posts: 14
Joined: Wed May 29, 2019 6:23 am

Need Event Handler execute on specified Host or Client

Post 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.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Need Event Handler execute on specified Host or Client

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Need Event Handler execute on specified Host or Client

Post by scottwilkerson »

thanks @eloyd
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Need Event Handler execute on specified Host or Client

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Need Event Handler execute on specified Host or Client

Post by ssax »

Thanks eloyd!

anjali, let us know if you have any questions or need any clarification.
anjali
Posts: 14
Joined: Wed May 29, 2019 6:23 am

Re: Need Event Handler execute on specified Host or Client

Post by anjali »

Thanks, Team.
I achieve that by using argument in a custom command.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Need Event Handler execute on specified Host or Client

Post by mbellerue »

Did the custom command solve your issue? If so, I will close the thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
anjali
Posts: 14
Joined: Wed May 29, 2019 6:23 am

Re: Need Event Handler execute on specified Host or Client

Post by anjali »

Yes, it solves my issue, you can close that thread.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Need Event Handler execute on specified Host or Client

Post by scottwilkerson »

anjali wrote:Yes, it solves my issue, you can close that thread.
Great!

Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked