AW: Sending $HOSTADDRESS$ or other to NRPE

Thomas.Zimmer at oppenheim.de Thomas.Zimmer at oppenheim.de
Thu Dec 29 11:43:57 CET 2005


Has your printer host-def. An IP-address assigned?
What is the output of the service-check?
Did you try to write the output of the check_printer command to a file? Is
there an IP-address?
You should set the passed args for the nrpe-command into "", like this:
define command {
         command_name    check_printer
         command_line    /usr/lib/nagios/plugin/check_nrpe -H kg -c
check_printer -a "$HOSTADDRESS$ $ARG1$ $ARG2$"
         }
But this should not be the problem in your config, I think...

Greetz,
Thomas Zimmer
Produktservice & Betrieb
Betrieb & Support
Sal. Oppenheim jr. & Cie., Frankfurt a. Main
Internet: http://www.oppenheim.de
E-Mail: thomas.zimmer at oppenheim.de



-----Ursprüngliche Nachricht-----
Von: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] Im Auftrag von Henrik
Morsing
Gesendet: Donnerstag, 29. Dezember 2005 11:26
An: nagios-users at lists.sourceforge.net
Betreff: [Nagios-users] Sending $HOSTADDRESS$ or other to NRPE



'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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Zimmer, Thomas (Produktservices und Betrieb).vcf
Type: application/octet-stream
Size: 254 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20051229/ab1511f8/attachment.obj>


More information about the Users mailing list