Page 1 of 1

Parent Child query

Posted: Wed Oct 26, 2011 6:09 am
by mtech
Hi, I am relatively new to Nagios and wondered if someone could just confirm something on parent/child relationship configs? I am trying to set up a correct hierachy as we are now monitoring a number of sites successfully, but if we lose our broadband we get hundreds of alerts for each individual monitor! So I am trying to put in a parent child relationship which (using our site and one other as the example) goes like this:

master site router. If our broadband here goes down, only create one alert. For this I have put a hostdependency definition in our own router config file for the other sites routers.
remote site router. If this goes down, just send one alert, do not send alerts for servers below this. For this I have put a hostdependency definition in that router config file for the remote servers at that site.
remote site server. IF this goes down, just send one alert, do not send alerts for the services on this server. For this I have put a servicedependancy definition in the Server config.

Nagios has reloaded OK, but I just wanted to check if the above is sufficient or if I have to follow the dependencies up multiple levels? i.e. Do I need to replicate the service dependancy up to the remote sites Router AND on to our router config? Or does the one entry suffice.

I hope I've explained that OK, any pointers will be warmly welcomed.

Thanks

Re: Parent Child query

Posted: Wed Oct 26, 2011 4:48 pm
by jsmurphy
Nagios is actually smart enough if you use the inbuilt parent directive in the host definition to work this stuff out itself...

So if you had (as an abstract example)

define host {
host_name master_site_router
}

define host {
host_name remote_site_router
parents master_site_router
}

define host {
host_name remote_site_server
parents remote_site_router
}

It will be able to resolve the host/service dependency tree. What you have already done however should still work if I understand it correctly :)
More information: http://nagios.sourceforge.net/docs/3_0/ ... ility.html Aaaaannnddd my personal favourite http://nagios.sourceforge.net/docs/3_0/ ... tance.html

Re: Parent Child query

Posted: Fri Oct 28, 2011 4:26 am
by mtech
Thanks for that, working on it all now and have cut my alerts if our line goes from hundreds to dozens! One final query that I don't THINK I can see anywhere, is it possible to have a service dependent on a host? The 'parents' entry is invalid and you can't leave 'service_description' out of a servicedependency entry, is there another option?

Re: Parent Child query

Posted: Sun Oct 30, 2011 5:27 pm
by jsmurphy
Not to my knowledge... What you can do as a work around though is make a check_ping service on the host you want the service to be dependent upon and then make that the dependency for the service.