View FAQ

[ Return To FAQ Index | Search The FAQs ]

FAQ Database : Nagios : Configuration

Title:Can I specify multiple addresses for a host?
FAQ ID:F0146
Submitted By:Ethan Galstad 
Last Updated:02/25/2003


User would like to specify multiple addresses for a single host in their configuration file. This is often useful for devices that have multiple interfaces (routers, multi-homed hosts, etc.).



Yes, you can define multiple address for a host. In fact, you can add anything you want for a host address. You can specify an IP address, MAC address, GPS coordinates, etc. Nagios does not directly interpret a host's address (or addresses), so you can do pretty much anything you want. Nagios simply passes this address to plugins and external commands via the $HOSTADDRESS$ macro. You'll have to make sure that you host check command (and possibly service checks, etc.) can understand the format of your host's address in order to check it though.

If you want to specify multiple IP addresses for a host, you might use something like this in the address directive of the host definition:,

Nagios is designed to treat hosts (as well as services) in an abstract manner. Here's one valid example of a "host" you could monitor... Let's say you have a cat named Nightmare. Nightmare wears an RFID tag on his collar (claw attacks in the middle of the night have left you emotionally scarred and you want to track him). The asset number stored in that RFID tag is what we'll use as cat's "address". How do we check the status of the host (i.e. is the rascal still moving)? Hmmm... Well, we could create a host check command that sent out a radio-controlled Lego Mindstorm with an RFID locater that either a) prodded the cat or b) dangled some catnip in the air when it was in close proximity to the little devil. If the cat meowed, pounced, or just moved we could safely say the cat was still in good shape. And you thought you could only monitor network devices...


Keywords:hosts multiple addresses