Nagios child/parent relationship for host that is reachable by multiple paths?

Consider the following network setup below:

Example network map

Further, assume that Switch 1 and 2 are managed switches, but only have an IP address assigned on vlan3.

How would you set up the parent/child tree for a setup like this? If switch 1 or 2 goes down, client 2 will not be reachable.

If Router B goes down, Switch1 and Switch2 will still be reachable, because to get to their management IPs, you are routed over Router A. But Client 2 will be down. So, Client 2 depends on Router B and Switch 2 (and therefore Switch 1) being up.

What's the usual way to set this up? Do you just have a policy that every Vlan on every managed switch shall have a management IP, and have each IP address as a different host ("switch1-vlan4" and "switch1-vlan3")?


The parents config directive in the host definition can be a comma-delimited list of parent hosts.

A host is considered to be reachable if at least one of its parents is reachable. The reachability docs are pretty good, but don't make the multiple-parent situation clear.

You might find this forum thread on the subject helpful.


Create a host object for every VLAN on every switch that only ping checks the switch IP.

In your example you would have a "switch2-vlan4" host object with the IP address of Switch 2 and just a hostcheck.

Client 2 would then have switch2-vlan4 as parent object. switch2-vlan4 would have switch1-vlan4 as parent which itself has Router B as parent.

If Switch 2 goes down, switch2-vlan4 is down too and Client 2 is unreachable. Dito with all the parent objects.