NSClient and NRPE - check_file.exe howto (error receiving)

Hi everyone -

I’m trying to set up check_file to verify dates on backups.

(For those not familiar with it, “check_file.exe” is an NRPE plugin for Windows
itefix.no/i2/check_file

Nagios is 3.X, running on Centos 5.3

check_file.exe is running on a Windows 2003 server,
which has NSClient++ installed.
(NSClient++ is my preferred Windows solution for Nagios integration, over SNMP or anything older)

I have a check_file command built on the Win2003 server
"c:\nagiosplugins\check_file\check_file.exe -t “d:\backups” --filter “name match *.*” --filter “age ge -24 hours” --critical 0"

That works fine - returns the required
"FILE OK - 0 files out of 22 to consider"

I have uncommented
NRPEListener.dll

From NSClient.INI, under section NRPE Handlers, I don’t understand this at all:
";command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10"

So I tried to use the NRPE handlers variant of "simple"
thusly, my NSClient.INI contains the line

ccmbackup=c:\nagiosbat\checkccmbackups.bat

which I think of as being an “alias” for check_file and all the parameters I’m giving it.

I have tried this command on the Centos Nagios server
"/usr/local/nagios/libexec/check_nrpe -n -H -c ccmbackup"

That gives me “CHECK_NRPE: Error receiving data from daemon.” on the Centos server

The batch file runs fine on Windows - gives the correct output for a current backup, gives critical errors if files don’t exist or are older than 24 hours.

I know this is some misunderstanding I have about how to “call” the check_file batch file
(or direct script) from NRPE…

What am I doing wrong?

Other checks are running fine on this server (ping, mem use, uptime, etc) as configured in NSClient.INI and services in the hosts file

So it’s not a global problem with NSClient

NSClient++ in test mode looks OK:
"Launching test mode…
d \NSClient++.cpp(401) Loading plugin: CheckDisk…
d \NSClient++.cpp(401) Loading plugin: CheckSystem…
d \CheckSystem.cpp(79) Autodetected W2K>, using TOOLHELP process enumeration.
d \PDHCollector.cpp(65) Autodetected w2k or later, using w2k PDH counters.
d \NSClient++.cpp(401) Loading plugin: CheckWMI…
d \PDHCollector.cpp(102) Using index to retrive counternames
d \NSClient++.cpp(401) Loading plugin: NRPE server…
d \PDHCollector.cpp(122) Found countername: CPU: \Processor(_total)% Process
or Time
d \PDHCollector.cpp(123) Found countername: UPTIME: \System\System Up Time
d \PDHCollector.cpp(124) Found countername: MCL: \Memory\Commit Limit
d \PDHCollector.cpp(125) Found countername: MCB: \Memory\Committed Bytes
d \NSClient++.cpp(401) Loading plugin: NSClient server…
d \NSClient++.cpp(401) Loading plugin: SystemTray…
e \SysTray.cpp(40) SysTray is not installed (or it cannot interact with the desk
top) SysTray won’t be loaded. Run NSClient++ SysTray install to change this.
d \Socket.h(627) Bound to: 192.168.0.9:5666
d \Socket.h(627) Bound to: 192.168.0.9:12489
l \NSClient++.cpp(136) Using settings from: INI-file
l \NSClient++.cpp(137) Enter command to inject or exit to terminate…
d \NSClientListener.cpp(143) Data: nagioscheckscoa&7
d \NSClientListener.cpp(168) Data:
d \NSClient++.cpp(516) Injecting: checkMem: nsclient
d \NSClient++.cpp(536) Injected Result: OK '6263549952&1847824384’
d \NSClient++.cpp(537) Injected Performance Result: ‘’

[quote]From NSClient.INI, under section NRPE Handlers, I don’t understand this at all:
“;command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10”[/quote]

That section is for something else. Read more carefully.

[quote]ccmbackup=c:\nagiosbat\checkccmbackups.bat

which I think of as being an “alias” for check_file and all the parameters I’m giving it.[/quote]

Well, this is not part of NSCLIENT or nagios? Hard to give any advice.
I guess this is the definition of an external script in which case you need to enable also external scripts.

Well there is no mention of checkccmbackups. check the log file instead

Unless -H is case sensitive it looks ok, but try without -n and -h

Also I would advice you to skip the bat file for now. Start by getting checkfile to work from command line first. Read the examples on in the NSCLIENT documentation.