help me escape (NRPE check_files path)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
thenomad
Posts: 35
Joined: Thu Mar 03, 2016 10:55 am

help me escape (NRPE check_files path)

Post by thenomad »

I am just not getting this right. I am doing a file count from nrpe - it works from the command line

Code: Select all

./check_nrpe -H 2.2.2.2 -n -t 60 -c check_files -a path='c:\path\to\files' pattern=*.* 'warning=count>500' 'critical=count>1000' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=warn'
but when I try to use that in service management I get a return like this

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 2.2.2.2  -t 30 -c check_files -a path='c:'c:\path\to\files' pattern=\*.\* 'warning=count\>500' 'critical=count\>1000' top-syntax='\$\{status\}: \$\{problem_count\}/\$\{count\} files' 'empty-state=ok'
OUTPUT: CHECK_NRPE: Socket timeout after 30 seconds.
So help me out ... where is the definitive guide to getting the escaping right to correctly pass this to nrpe ???
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: help me escape (NRPE check_files path)

Post by Box293 »

I can see you are running into a problem which can lead to the issues you are having, using the "Test Check Command" button. Due to some issues with how PHP escapes characters the "Test Check Command" does not work in these situations and should be ignored.

So for all further testing of this service you need to:

Make the changes to the service
Save the Service
Apply Configuration
Go back to the home screen and find the Service
When viewing the Service Status Details page click the Schedule a forced immediate check link

Just to re-iterate, for all further testing for this service DO NOT use the "Test Check Command" button, follow the steps above.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
thenomad
Posts: 35
Joined: Thu Mar 03, 2016 10:55 am

Re: help me escape (NRPE check_files path)

Post by thenomad »

OK Thanks
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: help me escape (NRPE check_files path)

Post by mcapra »

Let us know if you need anything additional!
Former Nagios employee
https://www.mcapra.com/
thenomad
Posts: 35
Joined: Thu Mar 03, 2016 10:55 am

Re: help me escape (NRPE check_files path)

Post by thenomad »

I know it is bad form to chain problems BUT with the above command is there a way to look at only the folder in question and not sub folders ??

Thanks
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: help me escape (NRPE check_files path)

Post by lmiltchev »

You can try adding to your command "searchdepth:1". According to the plugins documentation:
' searchdepth: search down x subdirs (searchdepth:1 - do not go down in directory hierarchy)
Be sure to check out our Knowledgebase for helpful articles and solutions!
thenomad
Posts: 35
Joined: Thu Mar 03, 2016 10:55 am

Re: help me escape (NRPE check_files path)

Post by thenomad »

that did it ... thanks
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: help me escape (NRPE check_files path)

Post by mcapra »

Is it alright if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
Locked