Trying to count files in a windows directory usring nrpe.

From my nagios server, this test works: ./check_nrpe -t 30 -H mywinserver -c directory_file_count
it calls this line in my nsc.ini file on the windows server: directory_file_count=c:\windows\system32\cscript.exe //NoLogo //T:30 c:\scripts\directory_file_count.wsf c: \temp\servstat\ 5 10
This works perfectly. But, not when I put it into a host service.

define service{
use generic-service
host_name mywinserver
service_description Queue Size
check_command check_nrpe!directory_file_count!30

define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 20 -c $ARG1$ -t $ARG2$

I get a no handler for that command. I have a similar service that works fine. It is using nrpe too, but passes this in the check_command: check_nrpe!check_ad!30. What did I miss?

BTW, running nagios 3.2.3, plugins: 1.4.15, nrpe 2.12 on Ubuntu 10.10 server. Win server is 2008 x64 SP2 with nsclient 0.3.8-x64


command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 20 -c $ARG1$ -t $ARG2$
why is -t defined twice? could it be it gives problems?


I noticed that too after posting and changed it to $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ and took !30 off the check_command in the service definition. No difference, however.


From my nagios server, this test works: ./check_nrpe -t 30 -H mywinserver -c directory_file_count

as user nagios or root? are you running other checks on the same server?


I can run it as nagios. I’m running another command that also uses check_nrpe and it works fine. Both call commands in the nsc.ini file. I can’t figure out why one works and not the other. I’m guessing I’m passing the wrong arguments. I’ll see if i can get an email to the author of that script.


Just to be sure, try rearranging the arguments so that you have the same order as on command line.