NSCP (CheckFileSize) strips backslashes from file paths

Frank J. Gómez frank at crop-circle.net
Mon Jun 9 19:08:26 CEST 2008


Hello,

I would like to monitor a Windows server on our network.  Before installing
anything on that machine, however, I thought I'd test NSCP (aka NSClient++)
on my laptop (Windows XP Professional, SP2).  I am getting some very weird
results.

The following service is defined on the Nagios server in my services.cfg
file:

define service{
>         host_name                 frank
>         service_description     Outlook PST
>         check_command        check_nrpe!check_pst_size
>         use                            serviceTemplate
> }
>

On my Windows machine, I've added this command to the NSC.ini file:

check_pst_size=inject CheckFileSize ShowAll MaxWarn=50K MaxCrit=75K
> File:PST=c:\\dell\DELLCIRC.ICO


When I start NSClient++.exe from the DOS command line using the "/test"
flag, I can watch everything as it happens (everything is logged to the
screen).  The prompt asks me to "Enter command to inject or exit to
terminate...", and when I enter "check_pst_size", I get exactly what I
expect.  However, when I ask Nagios to perform the check, the slashes get
stripped.  In the /test output, I see:

"Injecting: CheckFileSize: ShowAll, MaxWarn=50K, MaxCrit=75K,
File:PST=c:dellDELLCIRC.ICO"

... instead of what I normally get, which is:

"Injecting: CheckFileSize: ShowAll, MaxWarn=50K, MaxCrit=75K,
File:PST=c:\\dell\DELLCIRC.ICO"

I don't understand what's different, since in both cases "check_pst_size" is
defined on the client machine, and NRPE's only job is basically to tell the
client which command to run.  And here's another thing: when I allow Nagios
to do its scheduled check, the backslashes get stripped and the returned
file size is 0.  However, if I get on the Nagios server's CLI and type
"/usr/nagios/libexec/check_nrpe -H 10.128.128.16 -c check_pst_size", I get
the correct results.

Nagios is 2.11 on Gentoo.  NSCP is 0.3.1.

Any ideas?  I'm not sure what to do next...

Thanks!
-Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080609/18cb3046/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
-------------- 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