Page 1 of 1

help me escape (NRPE check_files path)

Posted: Sat Jun 04, 2016 12:17 pm
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 ???

Re: help me escape (NRPE check_files path)

Posted: Sun Jun 05, 2016 11:26 pm
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.

Re: help me escape (NRPE check_files path)

Posted: Mon Jun 06, 2016 4:00 pm
by thenomad
OK Thanks

Re: help me escape (NRPE check_files path)

Posted: Mon Jun 06, 2016 4:38 pm
by mcapra
Let us know if you need anything additional!

Re: help me escape (NRPE check_files path)

Posted: Tue Jun 07, 2016 1:57 pm
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

Re: help me escape (NRPE check_files path)

Posted: Tue Jun 07, 2016 2:50 pm
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)

Re: help me escape (NRPE check_files path)

Posted: Tue Jun 07, 2016 3:22 pm
by thenomad
that did it ... thanks

Re: help me escape (NRPE check_files path)

Posted: Tue Jun 07, 2016 3:35 pm
by mcapra
Is it alright if we lock this thread and mark the issue as resolved?