check_files how to supress the unknow

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

check_files how to supress the unknow

Postby DrNox » Mon Sep 11, 2017 8:04 am

I am using this command found on this link : http://sites.box293.com/nagios/guides/common-checks/files-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
User avatar
DrNox
 
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Re: check_files how to supress the unknow

Postby scottwilkerson » Mon Sep 11, 2017 4:26 pm

What version of NSClient do you have? The site says
NSClient++ 0.4.3.138 onwards
User avatar
scottwilkerson
CTO
 
Posts: 7620
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_files how to supress the unknow

Postby DrNox » Tue Sep 12, 2017 2:33 am

Hey,

I am using the 4.3.2 version
French Baguette
User avatar
DrNox
 
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Re: check_files how to supress the unknow

Postby scottwilkerson » Tue Sep 12, 2017 7:54 am

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.
User avatar
scottwilkerson
CTO
 
Posts: 7620
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_files how to supress the unknow

Postby DrNox » Tue Sep 12, 2017 8:00 am

.... sry, i failed ^^

I'am using : NSCP-0.5.0.62-x64
French Baguette
User avatar
DrNox
 
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Re: check_files how to supress the unknow

Postby scottwilkerson » Tue Sep 12, 2017 8:51 am

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
User avatar
scottwilkerson
CTO
 
Posts: 7620
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_files how to supress the unknow

Postby DrNox » Tue Sep 12, 2017 10:02 am

Hum, I don't see the difference It's the same code :?
French Baguette
User avatar
DrNox
 
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Re: check_files how to supress the unknow

Postby scottwilkerson » Tue Sep 12, 2017 10:08 am

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=
User avatar
scottwilkerson
CTO
 
Posts: 7620
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_files how to supress the unknow

Postby DrNox » Wed Sep 13, 2017 4:55 am

HI, thanks for your answer.
I did you change but i got the same error :

WarningNofileFound.PNG
WarningNofileFound.PNG (7.15 KiB) Viewed 89 times
French Baguette
User avatar
DrNox
 
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Re: check_files how to supress the unknow

Postby scottwilkerson » Wed Sep 13, 2017 8:34 am

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-files-return-unkwown-status/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'
User avatar
scottwilkerson
CTO
 
Posts: 7620
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Next

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 31 guests