Linux

Check File and Dir Size for BASH

Description:

Bash shell script to check min/max size of files and/or directories. Relies on “stat” and “du”, which most distributions should have. Usage: check_file_size.sh [–minwarn size] [–maxwarn size] [–mincrit size] [–maxcrit size] [-m

Current Version

Last Release Date

June 16, 2009

Compatible With

Owner


Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Project Files
Project Notes
Bash shell script to check min/max size of files and/or directories. Relies on "stat" and "du", which most distributions would have. Usage: check_file_size.sh [--minwarn size] [--maxwarn size] [--mincrit size] [--maxcrit size] [-m|--missingok] [-v|--verbose] --minwarn,maxwarn,mincrit,maxcrit all take size in bytes --missingok prevents errors from being raised if passed in files are missing Examples: # Warn if /tmp is above 1GB, Critical if above 2GB sh check_file_size.sh --maxwarn 1000000000 --maxcrit 2000000000 /tmp # Warn if any one file in /tmp is above 1GB, Critical if above 2GB sh check_file_size.sh --maxwarn 1000000000 --maxcrit 2000000000 /tmp/*
Reviews (1) Add a Review
Works well with NRPE
by falqueb, December 31, 2020
Thanks a lot, I'm using nrpe and it works well with it
Helpful? Yes  No 
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4 (5)
Favorites
1
Views
169,371