mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 16:08:55 +02:00
device_processor_stacked type for unix devices (where all CPUs share the same domain, not useful on network hardware where different CPUs do different jobs) Also we need inherit properties to $config['os'] from $config['os_group'], where they are not already set in $config['os']. Also updog.
git-svn-id: http://www.observium.org/svn/observer/trunk@2138 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -2,40 +2,67 @@
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$unit_text = str_pad(truncate($unit_text,10),10);
|
||||
|
||||
$descrlen = "18";
|
||||
$unitlen = "10";
|
||||
if($nototal) { $descrlen += "2"; $unitlen += "2";}
|
||||
$unit_text = str_pad(truncate($unit_text,$unitlen),$unitlen);
|
||||
|
||||
$rrd_options .= " COMMENT:'$unit_text Cur Max'";
|
||||
if (!$nototal) { $rrd_options .= " COMMENT:'Total '"; }
|
||||
$rrd_options .= " COMMENT:'\\n'";
|
||||
|
||||
$iter=0;
|
||||
foreach ($rrd_list as $rrd)
|
||||
$colour_iter=0;
|
||||
foreach ($rrd_list as $i => $rrd)
|
||||
{
|
||||
if (!$config['graph_colours'][$colours][$iter]) { $iter = 0; }
|
||||
$colour = $config['graph_colours'][$colours][$iter];
|
||||
if (!$config['graph_colours'][$colours][$colour_iter]) { $colour_iter = 0; }
|
||||
$colour = $config['graph_colours'][$colours][$colour_iter];
|
||||
$colour_iter++;
|
||||
|
||||
$rrd_options .= " DEF:".$rrd['rra'].$i."=".$rrd['filename'].":".$rrd['rra'].":AVERAGE ";
|
||||
$rrd_options .= " DEF:".$rrd['rra'].$i."max=".$rrd['filename'].":".$rrd['rra'].":MAX ";
|
||||
|
||||
## Suppress totalling?
|
||||
if (!$nototal)
|
||||
{
|
||||
$rrd_options .= " VDEF:tot".$rrd['rra'].$i."=".$rrd['rra'].$i.",TOTAL";
|
||||
}
|
||||
|
||||
## This this not the first entry?
|
||||
if ($i) { $stack="STACK"; }
|
||||
|
||||
# if we've been passed a multiplier we must make a CDEF based on it!
|
||||
$defname = $rrd['rra'];
|
||||
$g_defname = $rrd['rra'];
|
||||
if (is_numeric($multiplier))
|
||||
{
|
||||
$defname = $defname . "_cdef";
|
||||
$rrd_options .= " CDEF:" . $defname . $i . "=" . $rrd['rra'] . $i . "," . $multiplier . ",*";
|
||||
$g_defname = $rrd['rra'] . "_cdef";
|
||||
$rrd_options .= " CDEF:" . $g_defname . $i . "=" . $rrd['rra'] . $i . "," . $multiplier . ",*";
|
||||
$rrd_options .= " CDEF:" . $g_defname . $i . "max=" . $rrd['rra'] . $i . "max," . $multiplier . ",*";
|
||||
|
||||
## If we've been passed a divider (divisor!) we make a CDEF for it.
|
||||
} elseif (is_numeric($divider))
|
||||
{
|
||||
$g_defname = $rrd['rra'] . "_cdef";
|
||||
$rrd_options .= " CDEF:" . $g_defname . $i . "=" . $rrd['rra'] . $i . "," . $divider . ",/";
|
||||
$rrd_options .= " CDEF:" . $g_defname . $i . "max=" . $rrd['rra'] . $i . "max," . $divider . ",/";
|
||||
}
|
||||
$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"; }
|
||||
## Are our text values related to te multiplier/divisor or not?
|
||||
if(isset($text_orig) && $text_orig)
|
||||
{
|
||||
$t_defname = $rrd['rra'];
|
||||
} else {
|
||||
$t_defname = $g_defname;
|
||||
}
|
||||
|
||||
|
||||
$rrd_options .= " AREA:".$g_defname.$i."#".$colour.":'".substr(str_pad($rrd['descr'], $descrlen),0,$descrlen)."':$stack";
|
||||
$rrd_options .= " GPRINT:".$t_defname.$i.":LAST:%6.2lf%s".str_replace("%", "%%", $units)."";
|
||||
$rrd_options .= " GPRINT:".$t_defname.$i."max:MAX:%6.2lf%s".str_replace("%", "%%", $units)."";
|
||||
|
||||
if (!$nototal) { $rrd_options .= " GPRINT:tot".$rrd['rra'].$i.":%6.2lf%s".str_replace("%", "%%", $total_units).""; }
|
||||
|
||||
$rrd_options .= " COMMENT:'\\n'";
|
||||
$i++; $iter++;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user