A Nagios plugin to checking disk usage on remote systems via SNMP, using the values provided via UCD-SNMP-MIB:dskTable (.1.3.6.1.4.1.2021). This MIB table is used in favor over the others since it gives a fuller set of values, such as inodes used and percentages, as well as the thresholds configured for trapping.
This script is currently written for Python 2.7+, but uses the Python future library to provide the print() function.
At this moment, the installation is to manually copy the check-disk-snmp.py
script to the Nagios plugin directory (e.g. /usr/lib64/nagios/plugins
)
$ check-disk-snmp.py -H panparis -C public -w 80%,50%i -c 90% /tmp
OK dskPercent=14 dskPercentNode=0
define command {
command_name check_remote_disk
command_line $USER1$/check-disk-snmp.py -H $HOSTADDRESS$ -C public -w $ARG1$ -c $ARG2$ $ARG3$
}
define service {
use remote-service
host_name nas
service_description mirrors:centos Partition
check_command check_remote_disk!80%!90%!/mirrors/centos
}
- Some partitions will cause the command to fail with the error of AttributeError("'DisplayString' object has no attribute 'strip'",)
This software is open-sourced software licensed under the Mozilla Public License, v2.0
This plugin was created 2018 July 17 by Douglas Needham.