Need Event Handler execute on specified Host or Client

This forum is intended for the discussion of Nagios Core development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagios-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Need Event Handler execute on specified Host or Client

Postby anjali » Sat Aug 03, 2019 12:58 am

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

Re: Need Event Handler execute on specified Host or Client

Postby eloyd » Sat Aug 03, 2019 6:56 pm

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

Re: Need Event Handler execute on specified Host or Client

Postby scottwilkerson » Mon Aug 05, 2019 8:50 am

thanks @eloyd
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 15728
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Need Event Handler execute on specified Host or Client

Postby eloyd » Mon Aug 05, 2019 8:59 am

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

Re: Need Event Handler execute on specified Host or Client

Postby ssax » Mon Aug 05, 2019 3:58 pm

Thanks eloyd!

anjali, let us know if you have any questions or need any clarification.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
ssax
Dreams In Code
 
Posts: 4232
Joined: Wed Feb 11, 2015 12:54 pm

Re: Need Event Handler execute on specified Host or Client

Postby anjali » Wed Aug 07, 2019 8:18 am

Thanks, Team.
I achieve that by using argument in a custom command.
anjali
 
Posts: 14
Joined: Wed May 29, 2019 6:23 am

Re: Need Event Handler execute on specified Host or Client

Postby mbellerue » Thu Aug 08, 2019 5:02 pm

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!
User avatar
mbellerue
 
Posts: 375
Joined: Fri Jul 12, 2019 11:10 am

Re: Need Event Handler execute on specified Host or Client

Postby anjali » Fri Aug 09, 2019 2:34 am

Yes, it solves my issue, you can close that thread.
anjali
 
Posts: 14
Joined: Wed May 29, 2019 6:23 am

Re: Need Event Handler execute on specified Host or Client

Postby scottwilkerson » Fri Aug 09, 2019 6:56 am

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

Great!

Locking
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 15728
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios Core Development

Who is online

Users browsing this forum: No registered users and 2 guests