Page 1 of 1
Check host with multiple interfaces
Posted: Wed Jul 22, 2015 9:14 am
by jkinning
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?
Re: Check host with multiple interfaces
Posted: Wed Jul 22, 2015 9:31 am
by jdalrymple
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?
Re: Check host with multiple interfaces
Posted: Wed Jul 22, 2015 9:44 am
by jkinning
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?
Re: Check host with multiple interfaces
Posted: Wed Jul 22, 2015 9:53 am
by jdalrymple
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
Posted: Wed Jul 22, 2015 10:27 am
by jkinning
Thanks just wanted to double check from the pros.
Close at your convenience.