mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Adds some basic NFSEN integration support. by falz.
git-svn-id: http://www.observium.org/svn/observer/trunk@2033 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -7,21 +7,28 @@ $rrd_options .= " COMMENT:'$unit_text Cur Max'";
|
||||
if (!$nototal) { $rrd_options .= " COMMENT:'Total '"; }
|
||||
$rrd_options .= " COMMENT:'\\n'";
|
||||
|
||||
$i = 0;
|
||||
$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 (!$args['nototal'])
|
||||
if (!$nototal)
|
||||
{
|
||||
$rrd_options .= " VDEF:tot".$rrd['rra'].$i."=".$rrd['rra'].$i.",TOTAL";
|
||||
}
|
||||
|
||||
if ($i) { $stack="STACK"; }
|
||||
$rrd_options .= " AREA:".$rrd['rra'].$i."#" . $colour . ":'" . substr(str_pad($rrd['descr'], 18),0,18) . "':$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";
|
||||
|
||||
@@ -31,4 +38,4 @@ foreach ($rrd_list as $rrd)
|
||||
$i++; $iter++;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user