<?php

/*
 * PNP4Nagios template for check_mio Nagios plugin
 *
 * Version 2016050901 (YYYYMMDDxx)
 *
 * Author: Dimitar Fidanov <dimitar@fidanov.net>
 *
 * The latest version can be found at:
 * https://fidanov.net/c0d3/nagios-plugins/mio/
 *
 * See README for more details
*/

$ds_name[1] = "I/O Data";
$opt[1]  = "--slope-mode --step 300 --base 1024 --vertical-label $UNIT[4] --title \"[$hostname] I/O Data\" ";
$def[1]  = "DEF:$LABEL[4]=$RRDFILE[4]:$DS[4]:AVERAGE ";
$def[1] .= "DEF:$LABEL[5]=$RRDFILE[5]:$DS[5]:AVERAGE ";
$def[1] .= "VDEF:$LABEL[4]_total=$LABEL[4],TOTAL ";
$def[1] .= "VDEF:$LABEL[5]_total=$LABEL[5],TOTAL ";

$def[1] .= "AREA:$LABEL[5]#1DAAF180:\"\" ";
$def[1] .= "AREA:$LABEL[4]#F9772180:\"\" ";
$def[1] .= "LINE1.5:$LABEL[4]#F97721:\"read \\t\" ";
$def[1] .= "GPRINT:$LABEL[4]:LAST:\"last\: %.0lf%sB/s \\t\" ";
$def[1] .= "GPRINT:$LABEL[4]:AVERAGE:\"avg\: %.0lf%sB/s \\t\" ";
$def[1] .= "GPRINT:$LABEL[4]:MAX:\"max\: %.0lf%sB/s \\t\" ";
$def[1] .= "GPRINT:$LABEL[4]_total:\"total\: %.0lf%sB \\n\" ";
$def[1] .= "LINE1.5:$LABEL[5]#1DAAF1:\"write\\t\" ";
$def[1] .= "GPRINT:$LABEL[5]:LAST:\"last\: %.0lf%sB/s \\t\" ";
$def[1] .= "GPRINT:$LABEL[5]:AVERAGE:\"avg\: %.0lf%sB/s \\t\" ";
$def[1] .= "GPRINT:$LABEL[5]:MAX:\"max\: %.0lf%sB/s \\t\" ";
$def[1] .= "GPRINT:$LABEL[5]_total:\"total\: %.0lf%sB \\n\" ";

$ds_name[2] = "IOPS";
$opt[2]  = "--slope-mode --step 300 --vertical-label tps --title \"[$hostname] IOPS\" ";
$def[2]  = "DEF:$LABEL[1]=$RRDFILE[1]:$DS[1]:AVERAGE ";
$def[2] .= "DEF:$LABEL[2]=$RRDFILE[2]:$DS[2]:AVERAGE ";
$def[2] .= "VDEF:$LABEL[1]_total=$LABEL[1],TOTAL ";
$def[2] .= "VDEF:$LABEL[2]_total=$LABEL[2],TOTAL ";

$def[2] .= "AREA:$LABEL[2]#1DAAF180:\"\" ";
$def[2] .= "AREA:$LABEL[1]#F9772180:\"\" ";
$def[2] .= "LINE1.5:$LABEL[1]#F97721:\"reads \\t\" ";
$def[2] .= "GPRINT:$LABEL[1]:LAST:\"last\: %.0lf%s \\t\" ";
$def[2] .= "GPRINT:$LABEL[1]:AVERAGE:\"avg\: %.0lf%s \\t\" ";
$def[2] .= "GPRINT:$LABEL[1]:MAX:\"max\: %.0lf%s \\t\" ";
$def[2] .= "GPRINT:$LABEL[1]_total:\"total\: %.0lf%s \\n\" ";
$def[2] .= "LINE1.5:$LABEL[2]#1DAAF1:\"writes\\t\" ";
$def[2] .= "GPRINT:$LABEL[2]:LAST:\"last\: %.0lf%s \\t\" ";
$def[2] .= "GPRINT:$LABEL[2]:AVERAGE:\"avg\: %.0lf%s \\t\" ";
$def[2] .= "GPRINT:$LABEL[2]:MAX:\"max\: %.0lf%s \\t\" ";
$def[2] .= "GPRINT:$LABEL[2]_total:\"total\: %.0lf%s \\n\" ";

$ds_name[3] = "I/O Wait";
$opt[3]  = "--slope-mode --step 300 --vertical-label ms --title \"[$hostname] I/O Wait\" ";
$def[3]  = "DEF:$LABEL[3]=$RRDFILE[3]:$DS[3]:AVERAGE ";
$def[3] .= "AREA:$LABEL[3]#F9772180:\"\" ";
$def[3] .= "LINE1.5:$LABEL[3]#F97721:\"await\\t\\t\" ";
$def[3] .= "GPRINT:$LABEL[3]:LAST:\"%4.2lf last\\t\\t\" ";
$def[3] .= "GPRINT:$LABEL[3]:AVERAGE:\"%4.2lf avg\\t\\t\" ";
$def[3] .= "GPRINT:$LABEL[3]:MAX:\"%4.2lf max\\n\" ";

?>

