Page 1 of 2

check_files how to supress the unknow

Posted: Mon Sep 11, 2017 8:04 am
by DrNox
I am using this command found on this link : http://sites.box293.com/nagios/guides/c ... es-folders

Code: Select all

check_nrpe -H 192.168.142.1 -t 30 -c check_files -a path='C:\myFolder' pattern=*.* 'critical=count>0' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=ok'

When i do it on my empty folder ( i want to be sure that he is empty (that's why i want to manage him ^^), i got an Unknow : no file found.


Do you know how to correct it ?
Thanks for you eventually answer :)

Re: check_files how to supress the unknow

Posted: Mon Sep 11, 2017 4:26 pm
by scottwilkerson
What version of NSClient do you have? The site says
NSClient++ 0.4.3.138 onwards

Re: check_files how to supress the unknow

Posted: Tue Sep 12, 2017 2:33 am
by DrNox
Hey,

I am using the 4.3.2 version

Re: check_files how to supress the unknow

Posted: Tue Sep 12, 2017 7:54 am
by scottwilkerson
DrNox wrote:Hey,

I am using the 4.3.2 version
This sounds like your Nagios version. I'm looking for your NSClient version on the Windows machine.

Re: check_files how to supress the unknow

Posted: Tue Sep 12, 2017 8:00 am
by DrNox
.... sry, i failed ^^

I'am using : NSCP-0.5.0.62-x64

Re: check_files how to supress the unknow

Posted: Tue Sep 12, 2017 8:51 am
by scottwilkerson
I just looked at your command again and I think you are missing a \ in the drive location

Instead of

Code: Select all

check_nrpe -H 192.168.142.1 -t 30 -c check_files -a path='C:\myFolder' pattern=*.* 'critical=count>0' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=ok'
should be

Code: Select all

check_nrpe -H 192.168.142.1 -t 30 -c check_files -a path='C:\\myFolder' pattern=*.* 'critical=count>0' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=ok'

Re: check_files how to supress the unknow

Posted: Tue Sep 12, 2017 10:02 am
by DrNox
Hum, I don't see the difference It's the same code :?

Re: check_files how to supress the unknow

Posted: Tue Sep 12, 2017 10:08 am
by scottwilkerson
DrNox wrote:Hum, I don't see the difference It's the same code :?
sorry about that, I updated it. it is right after path=

Re: check_files how to supress the unknow

Posted: Wed Sep 13, 2017 4:55 am
by DrNox
HI, thanks for your answer.
I did you change but i got the same error :
WarningNofileFound.PNG
WarningNofileFound.PNG (7.15 KiB) Viewed 2995 times

Re: check_files how to supress the unknow

Posted: Wed Sep 13, 2017 8:34 am
by scottwilkerson
More research and it looks like there is a bug in NSClient in several versions, I just found this:
https://forums.nsclient.org/t/check-fil ... tatus/4109

According to one poster they resolved the issue by updating to 0.5.x and changing the order to:

Code: Select all

check_nrpe -H 192.168.142.1 -t 30 -c check_files -a path='C:\\myFolder' pattern=*.* 'critical=count>0' 'empty-state=ok' top-syntax='${status}: ${problem_count}/${count} files'