Here is my custom Pnp4nagios template for
check_diskio_ucd Nagios plugin to check DiskIO via SNMP (plugin uses UCD-DISKIO MIB 1.3.6.1.4.1.2021.13.15.1 ):
- Code: Select all
<?php
#
# PNP template for check_diskio_ucd plugin output
#
# (c) Lik, 2013
#
# perfdata output example : ReadMB=0.02MB/s WriteMB=0.00MB/s ReadIO=1.40IO/s WriteIO=0.00IO/s TotalIO=1.40IO/s
#
$ds_name[1] = "HDD Read/Write MB/s";
$opt[1] = "--slope-mode --step 300 --base 1024 --vertical-label $UNIT[1] --title \"Disk Read/Write MB per second - $hostname\" ";
$def[1] = "DEF:ReadMB=$RRDFILE[1]:$DS[1]:AVERAGE ";
$def[1] .= "DEF:WriteMB=$RRDFILE[2]:$DS[2]:AVERAGE ";
$def[1] .= "LINE1:0#7BC648 " ;
$def[1] .= "CDEF:$LABEL[2]_i=$LABEL[2],-1,* ";
$def[1] .= "AREA:$LABEL[1]#7BC648:\"$LABEL[1]\\t\" ";
$def[1] .= "GPRINT:$LABEL[1]:LAST:\"%3.2lf last\\t\\t\" ";
$def[1] .= "GPRINT:$LABEL[1]:AVERAGE:\"%3.2lf avg\\t\\t\" ";
$def[1] .= "GPRINT:$LABEL[1]:MAX:\"%3.2lf max\\n\" ";
$def[1] .= "AREA:$LABEL[2]_i#F09F3F:\"$LABEL[2]\\t\" ";
$def[1] .= "GPRINT:$LABEL[2]:LAST:\"%3.2lf last\\t\\t\" ";
$def[1] .= "GPRINT:$LABEL[2]:AVERAGE:\"%3.2lf avg\\t\\t\" ";
$def[1] .= "GPRINT:$LABEL[2]:MAX:\"%3.2lf max\\n\" ";
$ds_name[2] = "HDD Read/Write IOPS";
$opt[2] = "--slope-mode --step 300 --vertical-label $UNIT[3] --title \"Disk Input/Output operations per second - $hostname\" ";
$def[2] = "DEF:ReadIO=$RRDFILE[3]:$DS[3]:AVERAGE ";
$def[2] .= "DEF:WriteIO=$RRDFILE[4]:$DS[4]:AVERAGE ";
$def[2] .= "DEF:TotalIO=$RRDFILE[5]:$DS[5]:AVERAGE ";
$def[2] .= "LINE1:0#7BC648 " ;
$def[2] .= "CDEF:$LABEL[4]_i=$LABEL[4],-1,* ";
$def[2] .= "AREA:$LABEL[3]#7BC648:\"$LABEL[3]\\t\" ";
$def[2] .= "GPRINT:$LABEL[3]:LAST:\"%4.2lf last\\t\\t\" ";
$def[2] .= "GPRINT:$LABEL[3]:AVERAGE:\"%4.2lf avg\\t\\t\" ";
$def[2] .= "GPRINT:$LABEL[3]:MAX:\"%4.2lf max\\n\" ";
$def[2] .= "AREA:$LABEL[4]_i#F09F3F:\"$LABEL[4]\\t\" ";
$def[2] .= "GPRINT:$LABEL[4]:LAST:\"%4.2lf last\\t\\t\" ";
$def[2] .= "GPRINT:$LABEL[4]:AVERAGE:\"%4.2lf avg\\t\\t\" ";
$def[2] .= "GPRINT:$LABEL[4]:MAX:\"%4.2lf max\\n\" ";
$def[2] .= "LINE1:$LABEL[5]#000000:\"$LABEL[5]\\t\" ";
$def[2] .= "GPRINT:$LABEL[5]:LAST:\"%4.2lf last\\t\\t\" ";
$def[2] .= "GPRINT:$LABEL[5]:AVERAGE:\"%4.2lf avg\\t\\t\" ";
$def[2] .= "GPRINT:$LABEL[5]:MAX:\"%4.2lf max\\n\" ";
?>