Page 1 of 1

File sizes and counts in the folder

Posted: Thu Jan 11, 2018 4:54 pm
by dlukinski
Hello XI support

How we could count number of files and files sizes VS XI warnings and alerts.
- for Windows 2008=2012 with NSClient installed

Thank you

Re: File sizes and counts in the folder

Posted: Fri Jan 12, 2018 11:26 am
by npolovenko
Hello, @dlukinski.
We could use some clarification on this one. You want to count files, and measure the sizes and have alerts if some threshold is reached? Is that correct?

Here's an example of the command to use with NSClient to count number of files in some directory:

Code: Select all

./check_nrpe -H 192.168.4.49 -t 30 -c check_files -a path='C:\\your_path' pattern=*.* 'warning=count>500' 'critical=count>1000' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=ok'

Re: File sizes and counts in the folder

Posted: Tue Jan 23, 2018 1:50 pm
by dlukinski
npolovenko wrote:Hello, @dlukinski.
We could use some clarification on this one. You want to count files, and measure the sizes and have alerts if some threshold is reached? Is that correct?

Here's an example of the command to use with NSClient to count number of files in some directory:

Code: Select all

./check_nrpe -H 192.168.4.49 -t 30 -c check_files -a path='C:\\your_path' pattern=*.* 'warning=count>500' 'critical=count>1000' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=ok'
Thank you so much - was a problem we could not get working for ages (together with XI support)!

- please help with 2 more things: file size and folder size command syntax

Re: File sizes and counts in the folder

Posted: Tue Jan 23, 2018 5:07 pm
by npolovenko
@dlukinski, Glad I could help!

Code: Select all

./check_nrpe -H 192.168.4.49 -c check_files -a path=’C:\\your_path\\path\\path’ pattern=*.* ’filter=size gt 100M’ ’warn= count > 0’ ’crit= count > 0’ top-syntax=’${status}: ${count} files found ${problem_list}’ ’empty-state=ok’
This will show all files with a size greater then 100 megabytes under a Critical output.
Check out this article, there are a few examples: https://support.nagios.com/kb/article/f ... s-783.html

Re: File sizes and counts in the folder

Posted: Wed Jan 31, 2018 1:43 pm
by dlukinski
npolovenko wrote:@dlukinski, Glad I could help!

Code: Select all

./check_nrpe -H 192.168.4.49 -c check_files -a path=’C:\\your_path\\path\\path’ pattern=*.* ’filter=size gt 100M’ ’warn= count > 0’ ’crit= count > 0’ top-syntax=’${status}: ${count} files found ${problem_list}’ ’empty-state=ok’
This will show all files with a size greater then 100 megabytes under a Critical output.
Check out this article, there are a few examples: https://support.nagios.com/kb/article/f ... s-783.html
Thank you so much, please close

Re: File sizes and counts in the folder

Posted: Wed Jan 31, 2018 2:58 pm
by npolovenko
@dlukinski, You're welcome! Closing this thread.