Home Directory Plugins Log Files Linux/Unix Check File Growth

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Linux/Unix Check File Growth

Rating
0 votes
Favoured:
0
Last Release Date
2013-12-07
Compatible With
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
Hits
25728
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
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.
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