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 was written for Python 2.7+, but uses the Python future library to provide the print() function, and has been updated and tested on Python 2.7 and 3.9.
It also requires the installation of the pysnmp
package using PIP.
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
}
This software is open-sourced software licensed under the Mozilla Public License, v2.0
This plugin was created 2018 July 17 by Douglas Needham.