Translations of this page:

This is an old revision of the document!


gradient

Template Description

This is a preview of the rrd::gradient function which will be introduced in version 0.6.5 of pnp4nagios
Template Helper Functions

Preview

Template Code

gradient.php
<?php
#
# Copyright (c) 2006-2010 Joerg Linge (http://www.pnp4nagios.org)
# Plugin: check_icmp [Multigraph]
#
# RTA
#
$ds_name[1] = "Round Trip Times";
$opt[1]  = "--lower=0 --vertical-label \"RTA\" --title \"Ping times\" ";
$def[1]  =  rrd::def("var1", $RRDFILE[1], $DS[1], "AVERAGE") ;
$def[1] .=  rrd::gradient('var1','f0f0f0','0000a0','Round Trip Times',20);
$def[1] .=  rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%6.2lf $UNIT[1]") ;
 
if($WARN[1] != ""){
    if($UNIT[1] == "%%"){ $UNIT[1] = "%"; };
    $def[1] .= rrd::hrule($WARN[1], "#FF8c00", "Warning  ".$WARN[1].$UNIT[1]."\\n");
}
if($CRIT[1] != ""){
    if($UNIT[1] == "%%"){ $UNIT[1] = "%"; };
    $def[1] .= rrd::hrule($CRIT[1], "#FF0000", "Critical  ".$CRIT[1].$UNIT[1]."\\n");
}
 
?>
templates/gradient.1276717963.txt.gz · Last modified: 2010/06/16 21:52 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