Page 1 of 1

nsc command to count files in the directory

Posted: Wed Mar 25, 2015 9:07 pm
by newbieatnagios
Hi Expert,

I'm new in this tool, I would just want to ask if possible to monitor or count how many files in the specific directory ex. c:\nagios.

Thanks

Re: nsc command to count files in the directory

Posted: Thu Mar 26, 2015 10:36 am
by jdalrymple
Here is a plugin that does what you want:

http://exchange.nagios.org/directory/Pl ... nt/details

It doesn't really relate to the NSC product, I'm not sure how that relates... but this plugin will do what you ask and report back to Nagios.

Re: nsc command to count files in the directory

Posted: Thu Mar 26, 2015 6:18 pm
by Box293
NSClient++ includes this capability:

Check the amount of files in a folder (and sub-folders). Generate a warning if more that 500 files exist, critical if more than 1000 files exist.

NSClient++ 0.3.9

Code: Select all

Command:
check_nrpe -H 192.168.142.1 -t 30 -c CheckFiles -a path='C:\\NO BACKUP' pattern=*.* 'filter=size gt 0b' 'master-syntax={%total% Files Found}' MaxWarn=500 MaxCrit=1000

Output:
{12347 Files Found}, found files: 12347 > critical|'found files'=12347;500;1000
NSClient++ 0.4.1

Code: Select all

Command:
check_nrpe -H 192.168.142.1 -t 30 -c CheckFiles -a path='C:\\NO BACKUP' pattern=*.* 'master-syntax={%total% Files Found}' MaxWarn=500 MaxCrit=1000

Output:
{12347 Files Found}, found files: 12347 > critical|'found files'=12347;500;1000