Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In our office we have dual WAN setup, if our cable connection drops we still get connectivity via our T1. The only issue is that our office network is no longer available on the same IP so all Nagios check go critical because they can't connect.

What'd be awesome is if I could have Nagios try IP 1 by default but if for some reason its failing on that IP try IP 2.

I doubt this is possible with a default install but I'm wondering if there is any add-ons or some other magic that could make this work?

share|improve this question
Why not use hostnames? – Smudge Mar 13 '12 at 15:28
Where is your Nagios server? Are you saying that it connects to your office via the public internet to check services running within your office? – Skyhawk Mar 13 '12 at 15:28
Service checks shouldn't go critical when a service becomes unreachable due to a problem on your network. You should consider setting up a Nagios dependency. – Skyhawk Mar 13 '12 at 15:34
Nagios is installed on our infrastructure at Rackspace, it talks to all of our servers in our office over public ip via NRPE. – Aknosis Mar 13 '12 at 15:40
@sam: How should host names help here? You would need to update these if one of your connections goes down. – Sven Mar 13 '12 at 15:40
up vote 3 down vote accepted

I use the check_multiaddr plugin:

in my environment to execute checks against multi-homed servers. Some servers have multiple interfaces in multiple VLANs (for traffic segmentation). Only one interface is in DNS, so using hostnames in the Nagios config wasn't applicable to me. I originally started with multiple host definitions with separate IPs (host-a, host-a-vlan1) but that proved cumbersome.

I modified the check_multiaddr slightly to throw a CRITICAL if any of the interfaces is down because the default (OK as long as one interface is up) didn't meet my scenario.

share|improve this answer
This basically does what @SvenW suggested but consolidates it to only changing the arguments for each command. This is probably one step better than defining multiple host entries which just feels wrong. And for me - this is the best answer. – Aknosis Mar 14 '12 at 22:41

Configure a primary and backup VPN tunnel between your offsite Nagios server and your office LAN. Let Nagios check services using the private IP address of each, using whichever VPN tunnel is available. Configure a dependency on the VPN endpoint so that service checks go "unknown" and not "critical" if both VPN links go down.

share|improve this answer

With a little bit of work (or a lot, if your system is large), you could put every check inside a wrapper check script that tests the service in question on both possible addresses.

share|improve this answer
I know I can do this but it would make it overly cumbersome every time I need to add a new check – Aknosis Mar 13 '12 at 15:35

The answer to this depends on exactly what you're monitoring. There are plugins that can handle multi-homed hosts (the stock check_icmp, for example), but if you're checking any services, or using SNMP/NRPE/whatever, you need to get fancier.

You could cobble together something using check_multi, maintain two parallel configurations that are all children of the two different WAN connections, or look into adaptive monitoring.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.