Translations of this page:

alerter_gr

Template Description

This is a preview of the rrd::alerter_gr function of pnp4nagios
Template Helper Functions

Preview

Template Code

alerter.php
<?php
#
# Copyright (c) 2006-2010 Joerg Linge (http://www.pnp4nagios.org)
# Default Template used if no other template is found.
# Don`t delete this file !
#
# Define some colors ..
#
$_WARNRULE = '#FFFF00';
$_CRITRULE = '#FF0000';
#
# Initial Logic ...
#

        $opt[1] = '-X0 --vertical-label "' . $UNIT[1] . '" -u"'. $CRIT[1] . '" --title "' . $this->MACRO['DISP_SERVICEDESC'] . '"';
        $ds_name[1] = $LABEL[1];
        $def[1]  = rrd::def("var1", $RRDFILE[1], $DS[1], "MAX");
        $def[1] .= rrd::def("var2", $RRDFILE[2], $DS[2], "MAX");
        $def[1] .= rrd::alerter_gr("var2", rrd::cut($NAME[2],16), $WARN[1], $CRIT[1], "FF", $UNIT[1], "#00ff00", "#ffff00", "#ff0000", "#000000");
        $def[1] .= rrd::line1   ("var2", "#000000" );
        $def[1] .= rrd::gprint  ("var2", array("LAST","MAX","AVERAGE"), "%3.4lf ".$UNIT[1]);
        $def[1] .= rrd::line2   ("var1", "#0000ff", rrd::cut($NAME[1],16) );
        $def[1] .= rrd::gprint  ("var1", array("LAST","MAX","AVERAGE"), "%3.4lf ".$UNIT[1]);
        if ($WARN[1] != "") {
                $def[1] .= rrd::hrule($WARN[1], $_WARNRULE, "Warning  $WARN[1] \\n");
        }
        if ($CRIT[1] != "") {
                $def[1] .= rrd::hrule($CRIT[1], $_CRITRULE, "Critical $CRIT[1] \\n");
        }
        $def[1] .= rrd::comment("Provider " . $this->MACRO['LONGSERVICEOUTPUT'] . "\\r");
 
        $opt[2] = '-X0 --vertical-label "Retrans" -u"'. $CRIT[1] . '" --title "' . $this->MACRO['DISP_SERVICEDESC'] . '"';
        $ds_name[2] = $LABEL[1];
        $def[2]  = rrd::def("var3", $RRDFILE[3], $DS[3], "MAX");
        $def[2] .= rrd::alerter("var3", rrd::cut($NAME[3],16), $WARN[3], $CRIT[3], "FF", "", "#00ff00", "#ffff00", "#ff0000", "#000000");
        $def[2] .= rrd::line1   ("var3", "#000000" );
        $def[2] .= rrd::gprint  ("var3", array("LAST","MAX","AVERAGE"), "%3.4lf ");
        if ($WARN[3] != "") {
                $def[2] .= rrd::hrule($WARN[3], $_WARNRULE, "Warning  $WARN[3] \\n");
        }
        if ($CRIT[1] != "") {
                $def[2] .= rrd::hrule($CRIT[3], $_CRITRULE, "Critical $CRIT[3] \\n");
        }
        $def[2] .= rrd::comment("Provider " . $this->MACRO['LONGSERVICEOUTPUT'] . "\\r");
?>
templates/alerter_gr.txt · Last modified: 2012/01/25 12:20 by striep
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0