mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
git-svn-id: http://www.observium.org/svn/observer/trunk@2033 61d68cd4-352d-0410-923a-c4978735b2b8
42 lines
1.4 KiB
PHP
42 lines
1.4 KiB
PHP
<?php
|
|
|
|
include("includes/graphs/common.inc.php");
|
|
|
|
$unit_text = str_pad(truncate($unit_text,10),10);
|
|
$rrd_options .= " COMMENT:'$unit_text Cur Max'";
|
|
if (!$nototal) { $rrd_options .= " COMMENT:'Total '"; }
|
|
$rrd_options .= " COMMENT:'\\n'";
|
|
|
|
$iter=0;
|
|
foreach ($rrd_list as $rrd)
|
|
{
|
|
if (!$config['graph_colours'][$colours][$iter]) { $iter = 0; }
|
|
$colour = $config['graph_colours'][$colours][$iter];
|
|
$rrd_options .= " DEF:".$rrd['rra'].$i."=".$rrd['filename'].":".$rrd['rra'].":AVERAGE ";
|
|
$rrd_options .= " DEF:".$rrd['rra'].$i."max=".$rrd['filename'].":".$rrd['rra'].":MAX ";
|
|
if (!$nototal)
|
|
{
|
|
$rrd_options .= " VDEF:tot".$rrd['rra'].$i."=".$rrd['rra'].$i.",TOTAL";
|
|
}
|
|
|
|
if ($i) { $stack="STACK"; }
|
|
|
|
# if we've been passed a multiplier we must make a CDEF based on it!
|
|
$defname = $rrd['rra'];
|
|
if (is_numeric($multiplier))
|
|
{
|
|
$defname = $defname . "_cdef";
|
|
$rrd_options .= " CDEF:" . $defname . $i . "=" . $rrd['rra'] . $i . "," . $multiplier . ",*";
|
|
}
|
|
$rrd_options .= " AREA:" . $defname . $i . "#" . $colour . ":'" . substr(str_pad($rrd['descr'], 18),0,18) . "':$stack";
|
|
$rrd_options .= " GPRINT:".$rrd['rra'].$i.":LAST:%6.2lf%s$units";
|
|
$rrd_options .= " GPRINT:".$rrd['rra'].$i."max:MAX:%6.2lf%s$units";
|
|
|
|
if (!$nototal) { $rrd_options .= " GPRINT:tot".$rrd['rra'].$i.":%6.2lf%s$total_units"; }
|
|
|
|
$rrd_options .= " COMMENT:'\\n'";
|
|
$i++; $iter++;
|
|
}
|
|
|
|
?>
|