Page 1 of 1

Setting up Host dependencies

Posted: Tue Nov 06, 2012 12:56 pm
by Phil7269
I would like to configure my Nagios installation with Host dependencies so when I bring down my Hypervisor for maintenance I dont need to manually schedule downtime for the 25 guest on the hypervisor.

The problem I am running into is I dont know what configuration file to place these host dependencies in? Should I place them in Windows.cfg, where I have configured all my host? Does it need its own cfg file? I did not see anything in nagios.cfg referencing a dependencies.cfg file.

I am just not sure where to get started with this. The documentation on the internet is lacking.

thanks.

PT

Re: Setting up Host dependencies

Posted: Tue Nov 06, 2012 2:27 pm
by agriffin
It doesn't matter which config it goes in. The only reason for separating out your configuration into files like hosts.cfg, services.cfg, etc. is to make it easier manage. Just put the dependency information in any file you want. If it's a new file, you'll need to add a line to nagios.cfg that looks like this:

Code: Select all

cfg_file=/path/to/new/file.cfg

Re: Setting up Host dependencies

Posted: Tue Nov 13, 2012 12:07 pm
by Phil7269
OK, so I created a new file named dependencies.cfg and modified nagios.cfg to add this file. I then put the following entry in dependencies.cfg

define hostdependency{

host_name Server A

dependent_host_name Server B

notification_failure_criteria d

}


I then scheduled downtime for Server B and selected "Schedule non-triggered downtime for all child host". Once the downtime was scheduled nagios showed Server B as Scheduled Downtime with the "zzzzzz" icon next to it. I then powered off Server A and after a few minutes I received an alert email that Server A was down. What I am trying to accomplish is scheduling downtime for my Hypervisor and not having all the guest on the hypervisor send alerts that they are down. I basically want to schedule downtime for the hypervisor and have it also schedule downtime for all the guest on the hypervisor. Please help point me in the right direction to implement this.

thanks.

Re: Setting up Host dependencies

Posted: Tue Nov 13, 2012 4:15 pm
by jsmurphy
Is it a hypervisor cluster such as a vCenter solution or a standalone hypervisor?

I'm going to assume a standalone hypervisor given that turning it off causes all the hosts to go off. The easiest way to solve your problem is not to use host dependencies but to use "parenting" instead. On each host there is a very, very important field called "parents" if you assign it the name of another Nagios object(s) it will then automatically create those dependency chains and you never have to bother with maintaining host dependency objects.

More information: http://nagios.sourceforge.net/docs/3_0/ ... .html#host scroll down a bit to the parents directive.