check_files how to supress the unknow

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.
User avatar
DrNox
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

check_files how to supress the unknow

Post 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 :)
French Baguette
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_files how to supress the unknow

Post by scottwilkerson »

What version of NSClient do you have? The site says
NSClient++ 0.4.3.138 onwards
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
DrNox
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Re: check_files how to supress the unknow

Post by DrNox »

Hey,

I am using the 4.3.2 version
French Baguette
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_files how to supress the unknow

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
DrNox
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Re: check_files how to supress the unknow

Post by DrNox »

.... sry, i failed ^^

I'am using : NSCP-0.5.0.62-x64
French Baguette
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_files how to supress the unknow

Post 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'
Last edited by scottwilkerson on Tue Sep 12, 2017 10:08 am, edited 1 time in total.
Reason: edited code
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
DrNox
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Re: check_files how to supress the unknow

Post by DrNox »

Hum, I don't see the difference It's the same code :?
French Baguette
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_files how to supress the unknow

Post 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=
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
DrNox
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Re: check_files how to supress the unknow

Post 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 2993 times
French Baguette
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_files how to supress the unknow

Post 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'
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked