Host Dependencies trouble


Hello. I am trying to get a reliable nagios setup running, and am trying to make host dependencies work. I believe I have followed the instructions here, but it is not working as I would like it to.

The problem I am running into is that nagios appears to be using the current state of the ‘depended on’ host when a dependent host goes down. For example:

define hostdependency {
  host_name                      HOST_A
  dependent_host_name            HOST_B
  notification_failure_criteria  d,u 

In my test, I set up the above dependency relationship. Both systems were up and being monitorer properly. I then took them both offline, and scheduled and immediate service check for all services on HOST_B. As the service checks failed, it performed the host check on HOST_B, and discovered it was down. However, instead of then checking if HOST_A was up or down, it used the last-known state, which was UP. I got an alert that HOST_B was down, A few minutes later, once HOST_A’s services came up in the scheduling queue, I finally started receiving notices that HOST_A was down, and I received no more notices about HOST_B (which should have been the case from the beginning).

Is there something I’m missing here? Is there a way to force nagios to perform a host check on the ‘depended on’ hosts when walking up the dependency tree, instead of using the last known state?


Dan Goyette
[email protected]
Edited ]


Make your life more simple. Define parents in the hosts.cfg file, and then later expand into dependencies when you have more time. The parent definitions should accomplish most everything that you need.