Installation and configuration

Start by copying to your Nagios plugins directory, eg. /usr/lib/nagios/plugins. Make sure the Nagios user can read and execute the file.

Next create a Nagios command definition:

define command{
    command_name check_snmp_disks
    command_line /usr/lib/nagios/plugins/ -v -H $HOSTADDRESS$ -C $ARG1$

Now create a service definition:

define service {
    host_name server1
    service_description Disk space
    check_command check_snmp_disks!public
    use generic-service
    notification_interval 0

Finally, check_snmp_disks expects to find a config file called /etc/check_snmp_disks.conf. In this file you can configure thresholds and exclude partitions from checking. More details can be found in the Config File section.

That should get you up and running. The plug accepts some flags to modify behavior. These are:

-H hostname: Specifies the hostnmae of the SNMP server. This must be specified.

-C community: Specifies the SNMP community name. Again, this must be specified.

-h: Causes the plugin to print help and exit.

-t seconds: Specifies the timeout in seconds. This is set to 10 seconds by default.

-v: Specifies the verbosity. This can be specified up to three times, giving more information:

Verbosity settings

not specified: Prints a summary of the number of partitions that are Critical, Warning and OK. -v: Prints a condensed summary of status in the format CnWnOn where C = Critical, W = Warning, O = OK and n = number of partitions in that state eg C3W2O6: three disks are critical, two are warning and six are OK. -vv: Uses the same summary as -v but also includes details of the partition usage against the threshold set -vvv: Same as -vv but also includes debugging such as parsing the config file

The config file

The config file uses a line to specify each partition and is colon (:) separated. The format is:


The first field determines if this is an include or an exclude. For an exclude you only need specify the host and partition. There probably isn't much point specifying a warning and critical limit on a partition you're excluding! If you think that by including a file system, all other file systems on the host that are not specified are therefore ignored, you'd be 100% wrong. It's just referred to as an include because it's not an exclude :-)

The host field should go some way to explaining itself. Please note that it much match exactly the host specified by the -H flag on the plugin. server1 is not the same as! There is a special case. If you specify "global" as the host name, this is taken a default for any partition that does not have a definition in the config file for either itself or a global definition for that host. If you have a host called global that you want to define in the config file, you're screwed!

Again, the partition field should be fairly self explanatory. Again, it must match the partition reported by SNMP. To see a list of partition names, run check_snmp_disks with the -v -v -v option. You can specify the partition name as "global" and this will apply to all partitions on this host that do not have an individual definition.

The fourth field determines whether disk usage should be measured in blocks free or percent used.

The warn field specifies the warning point. For blocks, a warning is generated if the amount of free space reaches or drops below this point. For percentage, a warning is generated if the percentage of disk space used reaches or exceeds this point.

The critical field specifies the critical point. For blocks, a critical alert is generated if the amount of free space reaches or drops below this point. For percentage, a critical alert is generated if the percentage of disk space used reaches or exceeds this point.


# Default: warn at 80%, critical at 90%
# Default for server1: warn below 200MB, critical below 100MB
# Settings for server1, /var: warn at 50%, critical at 75%
# Settings for server2, /tmp: Exclude this partition from reporting


check_snmp_disks was written by BOfH.


Flames, abuse, mailbombs, etc can be sent to