cinnion / check-disk-snmp

A Nagios plugin to checking disk usage on remote systems via SNMP
Mozilla Public License 2.0
0 stars 2 forks source link
disk-usage monitoring nagios-plugin snmp sysadmin

check-disk-snmp

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.

Requirements

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.

Installation

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)

Example

CLI Usage

$ check-disk-snmp.py -H panparis -C public -w 80%,50%i -c 90% /tmp
OK dskPercent=14 dskPercentNode=0

Nagios command definition

define command {
    command_name        check_remote_disk
    command_line        $USER1$/check-disk-snmp.py -H $HOSTADDRESS$ -C public -w $ARG1$ -c $ARG2$ $ARG3$
}

Nagios service definition

define service {
    use             remote-service
    host_name           nas
    service_description     mirrors:centos Partition
    check_command       check_remote_disk!80%!90%!/mirrors/centos
}

Known issues

License

This software is open-sourced software licensed under the Mozilla Public License, v2.0

Author Information

This plugin was created 2018 July 17 by Douglas Needham.