File sizes and counts in the folder

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

File sizes and counts in the folder

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: File sizes and counts in the folder

Post 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'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: File sizes and counts in the folder

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: File sizes and counts in the folder

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: File sizes and counts in the folder

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: File sizes and counts in the folder

Post by npolovenko »

@dlukinski, You're welcome! Closing this thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked