Check host with multiple interfaces
Check host with multiple interfaces
I have a host with 3 interfaces and I am trying to determine the best method to check that all interfaces are up. I have the host keyed in and using the primary IP address but how do I create additional service checks to check pings(icmp) on the other two interfaces? Do I need to create a new check command? Or is there another way to check multiple interfaces on a host with multiple IP addresses?
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Check host with multiple interfaces
The answer to this is going to be a matter of opinion from one person to the next. Assuming your Nagios host is able to get to all 3 IPs (and all 3 IPs have a way back) my suggestion is to create each interface as a service - no different than you would do with a network switch, except in this context you're doing check_icmp instead of check_snmp.
The inherent host check is a check_ping - there is no reason you can't add an arbitrary number of services to any host that ping any arbitrary address - make sense?
The inherent host check is a check_ping - there is no reason you can't add an arbitrary number of services to any host that ping any arbitrary address - make sense?
Re: Check host with multiple interfaces
I was thinking that but in the service check I would need to create a new check command that didn't include the $HOSTADDRESS$ right?
Example: $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
Create a new check command like this $USER1$/check_ping -H $ARG1$ -w $ARG@$ -c $ARG3$ -p 5
Then create this service to the appropriate host.
Or is there a more efficient way?
Example: $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
Create a new check command like this $USER1$/check_ping -H $ARG1$ -w $ARG@$ -c $ARG3$ -p 5
Then create this service to the appropriate host.
Or is there a more efficient way?
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Check host with multiple interfaces
There is no more efficient way. There are other ways - like using custom host macros, but the way you've designed is definitely the most efficient.
Re: Check host with multiple interfaces
Thanks just wanted to double check from the pros.
Close at your convenience.
Close at your convenience.