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

check_disk_space

Rating
0 votes
Favoured:
0
Current Version
0.93
Last Release Date
2014-10-31
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
License
GPL
Hits
62700
Files:
FileDescription
check_disk_spacecheck_disk_space ver. 0.93
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
check_disk_space is a Nagios plugin for checking disk used space. It returns the following information:
- total disk space on the partition (in Bytes)
- currently used disk space (in Bytes and in %)
- free disk space (in Bytes and in %)
check_disk_space is written in Bash and uses df, grep and awk - no Perl, no PHP, no SNMP. This ensures that it is able to run on minimal systems, with few packages installed, and it is compatible with UNIX, Linux and BSD.

The thresholds for warning and critical may be specified as integer or float numbers.

Performance data:
- used disk space (Bytes)
- used disk space (%)
Performance data is reported in bytes instead of MB (GB, TerraBytes etc.) because the performance data is supposed to be processed by the monitoring tool (e.g. Nagios or Centreon) which should scale the graph accordingly and apply the correct multiplier.
Performance data complies to Nagios standards and has min/max values and warning/critical thresholds.

Usage:
check_disk_space [-v] [-h] [-w UsedSpaceWarning] [-c UsedSpaceCritical] [-p Partition]

Options:
--version|-v)
prints the program version
--help|-h)
prints this help information
-w)
warning threshold (in percents without % sign) for used space
-c)
critical threshold (in percents without % sign) for used space
-p)
disk partition to check

Example:

# ./check_disk_space -w 1 -c 90 -p /var
Warning; /var: total 1007.9MB, used 115.0MB (11.4%>1%), free 841.7MB (83.5%) | 'used space'=120590336B;10568581;951172300;0;1056858112 'used space (pct.)'=11.4%;1;90;0;100

=============
Oct. 31, 2014 What's new in version 0.93
- improved error detection. The script exits gracefully if the partition does not exist or it can not be checked or if you simply forget to provide it as an argument.
- the path for binary executables is no more hard coded, which makes the script capable to run on virtually any Linux or UNIX system, without the need to edit it.
- the path for binary executables (grep, awk, free) can be overwritten in the parameters section, at the beginning of the script
- introduced a new function for bringing the size strings to humanly readable format (ex.: 1024 bytes=>1KB)