I am trying to write checks that refer to a parent. In its most simplistic form, that would mean a check where the host pings its parent
The reason I want to find an 'easy' way to do this is that I would only have to define a host as a child of a parent and the checks would "update". And more importantly, if I change the parent of a host to another one, it would start pinging that parent instead
I actually want to extend this in the end for more complex checks as well, such as I want to make a command based on check_by_ssh that would connect to the parent and probe the host (as the host is not directly reachable, and moves between various sites - aka parent firewalls), if anyone has a better way that would do as well! So in the end if that host moves to another site I just update it's parent and the probes now go via the new parent not the old one
Thanks
Refer to parent in host checks
Re: Refer to parent in host checks
I'm not aware of any way to do this the way you describe. This is what DNS is for. If I were you I'd set up a DNS server and update the IP addresses there when a host moves.
Re: Refer to parent in host checks
The problem for me is that the parent changes quite often - we have temporary sites where, for example, ten switches are behind a firewall, and using check_by_ssh to the firewall I am checking they are reachable behind the firewall. Next week they are behind a different firewall. I didnt want to change the checks, just the defined parent of those ten devices and all the checks seamlessly update themselves.
Thx, --Chris
Thx, --Chris
Re: Refer to parent in host checks
I'm not sure I fully understand your situation, but it might be easier to set up passive checks so that your hosts are sending check results out of the firewall rather than you trying to get through the firewall and updating IP addresses all the time.
Re: Refer to parent in host checks
Yeah, that's what I thought too. Easier said than done on a switch though, or a wireless AP, except for maybe snmp traps. These kind of have to be actively polled 
Re: Refer to parent in host checks
You could try defining these addresses in custom macros and reference those in your checks.