NSCP (CheckFileSize) strips backslashes from file paths

Michael Medin michael at medin.name
Tue Jun 10 09:50:03 CEST 2008


Hello,

Do you escape the back-slashes in the nagios config?

Try running from the command line (ie. not nagios) like so:
check_nrpe ... -c CheckFileSize -a ShowAll MaxWarn=50K MaxCrit=75K
'File:PST=c:\dell\DELLCIRC.ICO'
(note the ticks)

Also for back-slashes to work you need to enable an option in the NSCP
config (something about dangerous meta chars, as well as allow options
IIRC)
(I can look it up for you if you want, but am at work now, so have to
pretend I am working :)

// Michael Medin

> 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
> -------------------------------------------------------------------------
> 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_______________________________________________
> 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



-------------------------------------------------------------------------
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
_______________________________________________
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