check_winfile - how to disable subdirectories checking

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.
Locked
edwardzg
Posts: 21
Joined: Fri Jan 10, 2014 5:11 am

check_winfile - how to disable subdirectories checking

Post by edwardzg »

Hi,

I have configure check_winfile plugin to check some directory, for example as below.
check_files = scripts\check_winfile.exe --target "C:\dments" --filter "name match \.fail$" --warn 1 --critical 2

How to force the plugin to only check the contents of this folder without subdirectories. Because now checks several thousand files in the subdirectories instead of just a few in the main folder.


I appreciate any idea :)



Regards,
Edward
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_winfile - how to disable subdirectories checking

Post by abrist »

You will need to specify the files to check directly, or just the handful of sub-directories that you actually want to check. From the plugin help:
--target file/directory[,file/directory]...]] [[--target ...] ... ]

This option specifies targets to check. A target can be a simple file or a recursive list of files in a directory. You can specify several comma separated targets for one --target option, as well as several --target options. At least one is required.
So I would set the target to just the sub-directories you want searched.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
edwardzg
Posts: 21
Joined: Fri Jan 10, 2014 5:11 am

Re: check_winfile - how to disable subdirectories checking

Post by edwardzg »

I'm not sure that i understand you right. I see this help explanation earlier but i don't see answer there.

I have location C:\dments and inside about 30-40 files which i wanna check. But in C:\dments is also about 20 folders with 20-30k not important files and it's checked also.

Is It to check files in folder dments, only files without subdirectories?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_winfile - how to disable subdirectories checking

Post by slansing »

As mentioned you will need to provide a direct path to each file if you do not want it to check everything in the directory, you can add additional files, by providing their paths in a coma separated list as the help output suggests. Give that a shot and let us know. If you are still having troubles post how you are manually running the command, including the directories in a coma separated list as I noted.
edwardzg
Posts: 21
Joined: Fri Jan 10, 2014 5:11 am

Re: check_winfile - how to disable subdirectories checking

Post by edwardzg »

I just configure CheckFiles using nrpe and I thing this is what I want http://www.nsclient.org/nscp/wiki/CheckDisk/CheckFiles

Thanks for help :)
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_winfile - how to disable subdirectories checking

Post by abrist »

edwardzg wrote: I thing this is what I want http://www.nsclient.org/nscp/wiki/CheckDisk/CheckFiles
It should be real simple to setup as this is a built-in nsclient check.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked