Service on an IP address different from the host

Marc Haber mh+nagios-users at zugschlus.de
Thu Feb 2 11:25:23 CET 2006


Hi,

some systems I am responsible for have multiple IP addresses, with
services that are not running on all IP addresses. I thus need service
definitions that don't check the service on the host address, but on a
dedicated "service address" while still being associated to the host
which has a different address.

I have come up with various ways to do this, each of them ugly, but
differently so.

(1)
Duplicate each command definition for a service check like

define command{
        command_name    check_http
        command_line    $USER1$/check_http -H $HOSTADDRESS$
        }

define command{
        command_name    check_http_addr
        command_line    $USER1$/check_http -H $ARG1$
        }


(2)
One other idea I have come up with would be having a thing like an "optional
argument", which could be configured like

define command{
        command_name    check_http
        command_line    $USER1$/check_http -H $IFDEF $ARG1$$ $ARG1$ $ELSE$ $HOSTADDRESS$ $ENDIF$
        }

(3)
A different approach (which is what I did back in netsaint days) was a
metaplugin, which allows command configuration like

define command {
	command_name	check_http
	command_line	$USER2$/modify_address $HOSTADDRESS$-$ARG1$ $USER1$/check_dns_random modify_address
}

which allows service definitions like

define service {
	...
	check_command	check_http
}

which checks the service on $HOSTADDRESS$ and

define service {
	...
	check_command	check_http!192.168.130.5
}

which checks the service on 192.168.130.5.

In the example, the metaplugin replaces the occurence of the string
modify_address with $HOSTADDRESS$ if $ARG1$ is empty, and $ARG1$
otherwise. This has the advantage of having a very straightforward
service configuration, at the price of having a confusing and complex
command definition which does not use nagios standard mechanisms.

(4)
The last approach would be to have host definitions for both IP
addresses, but that would probably be confusing for notification
recipients who are not so intimately familiar with system
architecture.



Which approach would, in your opinion, be appropriate for a new
installation? I am currently inclined towards (4).

What is your opinion?

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list