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) .
Please Sponsor me at http://www.justgiving.com/Assaf-Flatto

------------------------------------------------------------------------------
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
_______________________________________________
Nagios-users mailing list
Nagios-users@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

Reply via email to