NRPE work from command line but not from windows.cfg

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jasgot
Posts: 19
Joined: Sat Feb 14, 2015 7:52 pm

NRPE work from command line but not from windows.cfg

Post by jasgot »

I hope this is easy. I've been staring at it so long I am sure it's simple and I just don't see it.

This command works from the command line of my nagios core server:
./check_nrpe -H xxx.xxx.xxx.245 -t 30 -c CheckFiles -a path='C:\' pattern=*.MOLE02 'filter=size gt 0b' 'master-syntax={%total% Files Found}' MaxCrit=1

Here is the response:
{4 Files Found}, found files: 4 > critical|'found files'=4;0;1

Here is my windows.cfg service that does not work:
define service{
use generic-service
host_name FS.XXX.Com
service_description MOLE
check_command check_nrpe!check_files!path='c:\\' pattern=*.MOLE02 'warning=count>1' 'critical=count>2' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=ok'
}

Here is the nrpe command from commands.cfg:
define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 90 -c $ARG1$ $ARG2$
}



I would greatly appreciate being pointed in the right direction,

Thanks
Jason
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE work from command line but not from windows.cfg

Post by tgriep »

You are missing the -a from the $ARG2$ field in the service check.
Try changing the command to the following and see if that fixes the issue.

Code: Select all

check_command check_nrpe!check_files!-a path='c:\\' pattern=*.MOLE02 'warning=count>1' 'critical=count>2' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=ok'
Be sure to check out our Knowledgebase for helpful articles and solutions!
jasgot
Posts: 19
Joined: Sat Feb 14, 2015 7:52 pm

Re: NRPE work from command line but not from windows.cfg

Post by jasgot »

I added the "-a" but it did not help, but in the end it was required.

After a LOT of more reading and searching, I updated to the newest nsclient++ and it resolved the issue for me.

So I had two issues. You helped by having me add the "-a" and I also updated the client.

Thank you! Your advice caused me to search further and I found several comments on bug fixes in the newer versions.

Thanks again!

Jason
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: NRPE work from command line but not from windows.cfg

Post by lmiltchev »

I am glad your issue has been resolved! Can we close this thread?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked