Log Files

Linux/Unix Check File Growth

Description:

Shell script that checks the level of byte growth of a file for a time interval.
Also, check that a file is growing.

Tested on Linux, FreeBSD, OSX, and AIX.

Current Version

Last Release Date

2013-12-07

Compatible With

  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI

Owner


Project Notes
Check the level of byte growth of a file for a time interval. Also, check that a file is growing. Options: -f Specify filename as full path -i Interval in seconds -M Command to use for the checks "wc/stat" wc is portable but slower, stat is faster but less portable -T Type of concern for thresholds "bigger/smaller" than thresholds -c Critical threshold in bytes -w Warning threshold in bytes Usage: $0 -f big.log -M stat -T bigger -c 1000000 -w 5000000 -i 30 # Author: Jon Schipp # Date: 11-07-2013 ######## # Examples: # 1.) Check if file has grown in the last 30 seconds # $ ./check_file_growth.sh -f /var/log/system.log -M stat -i 30 # File grew by 118 bytes # # 2.) If file has grown by more than (c)ritical or (w)arning bytes in 30 seconds exit with critical or warning status. Use the stat program to check the bytes. # $ ./check_file_growth -f big.log -M stat -T bigger -c 1000000 -w 5000000 -i 30
Reviews (0) Add a Review
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
0 (0)
Favorites
0
Views
26,195