$HOSTADDRESS$ being ignored with nrpe?

Haydn Haines haydn.haines at halian.com
Mon Apr 16 12:06:56 CEST 2007


Hi All,

I'm currently evaluating Nagios for use in our company and I've run in to a small problem. For some reason the nrpe plugin is ignoring the $HOSTADDRESS$ argument and always returns stats for the localhost. The relevant parts of the configuration files are as follows:

/etc/nagios/nagios.cfg:
-----------------------
cfg_dir=/etc/nagios/hosts


/etc/nagios/commands.cfg:
-------------------------
define command{
        command_name    check_nrpe
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
        }

/etc/nagios/nrpe.cfg:
---------------------
command[check_disk1]=/usr/lib/nagios/plugins/check_disk -w 10% -c 5% -p /


hostX:/etc/nrpe.cfg:
--------------------
command[check_disk1]=/usr/local/nagios/libexec/check_disk -w 10% -c 5% -p /


/etc/hosts/hostX.cfg:
---------------------
define host{
        use                     linux-server            ; Name of host template to use
        host_name               hostX
        alias                   hostX
        address                 192.168.1.1
        }

define service{
        use                             remote-service            ; Name of service template to use
        host_name                       hostX
        service_description             Root Partition
        check_command                   check_nrpe!check_disk1
        }



If I change the check_nrpe command line in commands.cfg and the check_command of the hostX.cfg file to the following it works, but I don't want to repeat the hostname over and over as it will make adding new hosts awkward:

        command_line    $USER1$/check_nrpe -H $ARG1$ -c $ARG2$
        check_command                   check_nrpe!hostX!check_disk1


Please would somebody advise me why the $HOSTADDRESS$ argument isn't working??

Thanks,

Haydn.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: HALIAN_Disclaimer.txt
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070416/25415a8e/attachment.txt>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
-------------- next part --------------
_______________________________________________
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