passing a string with spaces to nrpe

Lori Adams ladams at cloudmark.com
Wed Sep 29 19:55:08 CEST 2010


Yes, we pass arguments all the time to nrpe.  I'm just having an issue with a passing a string that contains spaces.

From: Assaf Flatto [mailto:nagios at flatto.net]
Sent: Wednesday, September 29, 2010 10:08 AM
To: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] passing a string with spaces to nrpe

On 29/09/10 18:00, Lori Adams wrote:
I'm having a terrible time setting up nrpe to allow me to pass a string with spaces.  This is with nagios 3.x and nrpe 2.0.

The service config is trying to check a log on a remote server for a string that contains spaces.

The service block has the check_command set to:
check_command                   check_log_perl_nofilter_test!/srv/logs/spamnet/log-parser/log-parser.log!/srv/nagios_nrpe/tmp/log-parser.log.out!\"ERROR: Parent: Fatal error\"

The check_command is set to:
define command {
        command_name    check_log_perl_nofilter_test
        command_line    $USER2$/check_nrpe -u -t 30 -H $HOSTADDRESS$ -c check_log_perl_nofilter -a $ARG1$ $ARG2$ "$ARG3$"
}

The nrpe config is then:
command[check_log_perl_nofilter]= /srv/nagios_nrpe/scripts/check_log.pl --filename=$ARG1$ --oldlog=$ARG2$ --query=$ARG3$

If I change the nrpe config to echo the command, so that it looks like:
                command[check_log_perl_nofilter]= echo /srv/nagios_nrpe/scripts/check_log.pl --filename=$ARG1$ --oldlog=$ARG2$ --query=$ARG3$
Then, the output of the echo is:
/srv/nagios_nrpe/scripts/check_log.pl --filename=/srv/logs/spamnet/log-parser/log-parser.log --oldlog=/srv/nagios_nrpe/tmp/log-parser.log.out --query=ERROR:

I've tried quoting the $ARG3$ in the nrpe command, and I get the same thing.

I've seed other threads on the list that in order to pass quotes to nrpe, you must escape them.  You can see I've tried that.   Any guidance would be extremely helpful.


Thanks,
Lori Adams

Have you compiled nrpe with the allow command arguments ?

to get the proper syntax do ./configure --help




--

Never,Ever Cut A Deal With a Dragon





Next year I will be doing the London to Paris bike ride to

raise money for the DogTrust (www.dogstrust.co.uk<http://www.dogstrust.co.uk>) .

Please Sponsor me at http://www.justgiving.com/Assaf-Flatto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20100929/8a28cdfe/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
-------------- 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