Argument for check_files

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.
cocoyanouck
Posts: 96
Joined: Fri Apr 08, 2016 3:17 am

Re: Argument for check_files

Post by cocoyanouck »

Ok, I have delete all the files on my directory and tested it again. The code :

http://hpics.li/9d19177
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Argument for check_files

Post by rkennedy »

Looks good, you'll want to modify your service's check_command's accordingly now. It's exiting properly, so it shouldn't show as unknown.
Former Nagios Employee
cocoyanouck
Posts: 96
Joined: Fri Apr 08, 2016 3:17 am

Re: Argument for check_files

Post by cocoyanouck »

I've already wrote these command and the output on web interface is the same that on the output of the nagios-debian => notification by email because "status unknown" and in description "no files found" (when 0 files in this directory.

Idem with 0.50 and 0.4.4. Very strange !
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Argument for check_files

Post by rkennedy »

This is bizarre, can you post the new service definition that you're using now?

Also, please post the command definition for check_nrpe.

I'll try to replicate things on my end once I have that information.
Former Nagios Employee
cocoyanouck
Posts: 96
Joined: Fri Apr 08, 2016 3:17 am

Re: Argument for check_files

Post by cocoyanouck »

For sure :

Define service in windows.cfg :

http://hpics.li/a6e4457

NRPE in command.cfg :

http://hpics.li/2dc593f
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Argument for check_files

Post by lmiltchev »

I noticed some inconsistencies with the output from the CLI ("OK"), and the one in the web UI ("UNKNOWN") too. :(

Try changing this:

Code: Select all

check_nrpe!check_files!path='c:\\GESTION\\REQUEST' pattern=*.* 'warning=count>5' 'critical=count>10' top-syntax='${status}:${problem_count}/${count} files' 'empty-state=ok'
to this:

Code: Select all

check_nrpe!check_files!path='c:\\GESTION\\REQUEST' pattern=*.* 'warning=count>5' 'critical=count>10' 'empty-state=ok' top-syntax='${status}:${problem_count}/${count} files' 
This seems like a useless mod, but it worked for me...

BTW, I didn't use double backward slashes in my path, i.e. path='c:\temp'. I am not sure if this is going to make any difference.

Let us know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
cocoyanouck
Posts: 96
Joined: Fri Apr 08, 2016 3:17 am

Re: Argument for check_files

Post by cocoyanouck »

Ok, thanks a lot, I come back from holidays next monday and I'll try this !!!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Argument for check_files

Post by rkennedy »

Sounds good - enjoy your time off!
Former Nagios Employee
cocoyanouck
Posts: 96
Joined: Fri Apr 08, 2016 3:17 am

Re: Argument for check_files

Post by cocoyanouck »

This is awesome, it's Ok when I write this :

Code: Select all

check_nrpe!check_files!path='c:\\GESTION\\REQUEST' pattern=*.* 'warning=count>5' 'critical=count>10' 'empty-state=ok' top-syntax='${status}:${problem_count}/${count} files'
You can put this topic to "RESOLVE" and I want to thank you warmly !
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Argument for check_files

Post by rkennedy »

Great to hear! Marking this as resolved and closing it out.
Former Nagios Employee
Locked