[Nagios-devel] Multiple addresses per host ?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] Multiple addresses per host ?

Post by Guest »

Hi all,

In many of out server/firewall setups here we have different daemons
listening on different interfaces. For instance, we will have a firewall
with two binds running, on inside and one outside (or even three in some
special cases). Or we might have a differently configured httpd on each
interface.

The issue is that by default a host is given one ip address, and there
is no clean way of defining that two different services on two different
addresses actually belong to the same host object. The way I am doing it
at the moment is as follows:

define host {
host_name myhost
address 192.168.1.1
...
}

define service {
...
host_name myhost
service_description DNS-inside
check_command check_dns2!192.168.1.1
}
define service {
...
host_name myhost
service_description DNS-outside
check_command check_dns2!123.45.67.89
}

Where check_dns2 is a command which calls check_dns with $ARG1$ instead of
$HOSTADDRESS$ :

define command {
command_name check_dns2
command_line /usr/local/libexec/nagios/check_dns -H www.yahoo.com \
-s $ARG1$
}


I am considering modifyin the code to allow for such constructs:

define host {
host_name myhost
address 192.168.1.1 primary # this would also allow for IP aliases
address 123.45.67.89
}

or

define host {
host_name myhost
address 192.168.1.1
address2 123.45.67.89
}

Then we need some way of indication which $HOSTADDRESS$ we'll be using
for the service definitions -- but we run into the same problem which is
that we have to explicitly mention which address we want to run the check
against anyway.

Any ideas ?


On related topic which I am thinking about (though this might be made
possible in the future provided a sufficiently abstracted configuration
framework/API that would allow one to define their own config. modules/
parsers) -- it would be nice to be able to configure hosts/services in the
following fashion (BIND users will find it familiar):

host "myhost" {
host_name "myhost";
addresses { default 192.168.1.1; 123.45.67.89; };
service { dns; http; ping; } // default service checks -- template conf'ed
service { dns_in "DNS_IN" { 123.45.67.89; } // extra check, explicitly
// specify name, IP
}

Or something similar -- service template definitions allows for a very clean
separation between definition and usage -- we could benefit from this by
allowing service usage declaration within host block definitions, as above.

It's IMHO easier to configure and parse, maybe it's just me :)

Comments ?


--
_ _ |_ || regnauld@catpipe.net catpipe Systems ApS |
(_(_||_ || *BSD solutions, consulting, development |
|| Tlf.: +45 7021 0050 http://www.catpipe.net/ |





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: regnauld@catpipe.net
Locked