Check host with multiple interfaces

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Check host with multiple interfaces

Post 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?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Check host with multiple interfaces

Post 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?
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Check host with multiple interfaces

Post 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?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Check host with multiple interfaces

Post 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.
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Check host with multiple interfaces

Post by jkinning »

Thanks just wanted to double check from the pros. :D

Close at your convenience.
Locked