Sending $HOSTADDRESS$ or other to NRPE

Henrik Morsing henrik at morsing.cc
Thu Dec 29 11:25:38 CET 2005


'morning and merry christmas to all.

I spent a good many hours yesterday on trying to simplify using NRPE by
grouping some tests and sending a hostname to NRPE at the other end. I've
tried all possible (almost) configuration and order of variables etc. but
this just doesn't seem to be possible.

So, in services.cfg I have:

# Service definition
define service{
         use                             generic-service         ; Name of
service template to use
         hostgroup_name                  kg-printer
         service_description             KG-Printer
         [...]
         check_command                   check_nrpe!check_printer
         }

In checkcommands.cfg I have:

define command {
         command_name    check_printer
         command_line    /usr/lib/nagios/plugin/check_nrpe -H kg -c
check_printer -a $HOSTADDRESS$ $ARG1$ $ARG2$
         }

And in nrpe_local.cfg I have:

command[check_printer]=/usr/lib/nagios/plugins/check_ping -H $ARG1$ -w
100.0,20% -c 500.0,60%

My question is why it is not possible to send the host address to nrpe at
the other end? I've tried doing this for check-printer-alive in ping.cfg
as well with no luck.

I even replaced check_printer which is called by NRPE with a script that
showed me which variables got passed on the command line and all I got was
$HOSTADDRESS$ which was "sh" with a control character at the end!

Has someone actually tried this before? Or am I doing this the wrong way
completely? Googling has given me virtually nothing.

Thanks for any pointers!

Regards,
Henrik Morsing


-------------------------------------------------------
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://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
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