mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
more graph improvements
git-svn-id: http://www.observium.org/svn/observer/trunk@3065 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -61,9 +61,10 @@ $graph_title .= "::bits";
|
||||
|
||||
$colour_line_in = "006600";
|
||||
$colour_line_out = "000099";
|
||||
$colour_area_in = "CDEB8B";
|
||||
$colour_area_out = "C3D9FF";
|
||||
$colour_area_in = "91B13C";
|
||||
$colour_area_out = "8080BD";
|
||||
|
||||
include("includes/graphs/generic_multi_bits_separated.inc.php");
|
||||
#include("includes/graphs/generic_multi_bits_separated.inc.php");
|
||||
include("includes/graphs/generic_multi_data.inc.php");
|
||||
|
||||
?>
|
||||
|
||||
@@ -18,6 +18,19 @@ foreach ($rrd_filenames as $key => $rrd_filename)
|
||||
$pluses .= $plus;
|
||||
$seperator = ",";
|
||||
$plus = ",+";
|
||||
|
||||
if($_GET['previous'])
|
||||
{
|
||||
$rrd_options .= " DEF:".$in."octets" . $i . "X=".$rrd_filename.":".$ds_in.":AVERAGE:start=".$prev_from.":end=".$from;
|
||||
$rrd_options .= " DEF:".$out."octets" . $i . "X=".$rrd_filename.":".$ds_out.":AVERAGE:start=".$prev_from.":end=".$from;
|
||||
$rrd_options .= " SHIFT:".$in."octets" . $i . "X:$period";
|
||||
$rrd_options .= " SHIFT:".$out."octets" . $i . "X:$period";
|
||||
$in_thingX .= $seperatorX . "inoctets" . $i . "X,UN,0," . "inoctets" . $i . "X,IF";
|
||||
$out_thingX .= $seperatorX . "outoctets" . $i . "X,UN,0," . "outoctets" . $i . "X,IF";
|
||||
$plusesX .= $plusX;
|
||||
$seperatorX = ",";
|
||||
$plusX = ",+";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -34,6 +47,19 @@ if ($i)
|
||||
$rrd_options .= " VDEF:95thout=outbits,95,PERCENT";
|
||||
$rrd_options .= " VDEF:d95thout=doutbits,5,PERCENT";
|
||||
|
||||
if($_GET['previous'] == "yes")
|
||||
{
|
||||
$rrd_options .= " CDEF:".$in."octetsX=" . $in_thingX . $pluses;
|
||||
$rrd_options .= " CDEF:".$out."octetsX=" . $out_thingX . $pluses;
|
||||
$rrd_options .= " CDEF:doutoctetsX=outoctetsX,-1,*";
|
||||
$rrd_options .= " CDEF:inbitsX=inoctetsX,8,*";
|
||||
$rrd_options .= " CDEF:outbitsX=outoctetsX,8,*";
|
||||
$rrd_options .= " CDEF:doutbitsX=doutoctetsX,8,*";
|
||||
$rrd_options .= " VDEF:95thinX=inbitsX,95,PERCENT";
|
||||
$rrd_options .= " VDEF:95thoutX=outbitsX,95,PERCENT";
|
||||
$rrd_options .= " VDEF:d95thoutX=doutbitsX,5,PERCENT";
|
||||
}
|
||||
|
||||
if ($legend == 'no' || $legend == '1')
|
||||
{
|
||||
$rrd_options .= " AREA:inbits#".$colour_area_in.":";
|
||||
@@ -58,6 +84,13 @@ if ($i)
|
||||
|
||||
$rrd_options .= " LINE1:95thin#aa0000";
|
||||
$rrd_options .= " LINE1:d95thout#aa0000";
|
||||
|
||||
if($_GET['previous'] == "yes")
|
||||
{
|
||||
$rrd_options .= " AREA:inbitsX#9999966:";
|
||||
$rrd_options .= " AREA:doutbitsX#99999966:";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#$rrd_options .= " HRULE:0#999999";
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
/// Draws aggregate bits graph from multiple RRDs
|
||||
/// Variables : colour_[line|area]_[in|out], rrd_filenames
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
if($format == "octets" || $format == "bytes")
|
||||
{
|
||||
$units = "Bps";
|
||||
$format = "octets";
|
||||
} else {
|
||||
$units = "bps";
|
||||
$format = "bits";
|
||||
}
|
||||
|
||||
$i=0;
|
||||
|
||||
foreach ($rrd_filenames as $key => $rrd_filename)
|
||||
{
|
||||
if ($rrd_inverted[$key]) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
|
||||
|
||||
$rrd_options .= " DEF:".$in."octets" . $i . "=".$rrd_filename.":".$ds_in.":AVERAGE";
|
||||
$rrd_options .= " DEF:".$out."octets" . $i . "=".$rrd_filename.":".$ds_out.":AVERAGE";
|
||||
$in_thing .= $seperator . "inoctets" . $i . ",UN,0," . "inoctets" . $i . ",IF";
|
||||
$out_thing .= $seperator . "outoctets" . $i . ",UN,0," . "outoctets" . $i . ",IF";
|
||||
$pluses .= $plus;
|
||||
$seperator = ",";
|
||||
$plus = ",+";
|
||||
|
||||
if($_GET['previous'])
|
||||
{
|
||||
$rrd_options .= " DEF:".$in."octets" . $i . "X=".$rrd_filename.":".$ds_in.":AVERAGE:start=".$prev_from.":end=".$from;
|
||||
$rrd_options .= " DEF:".$out."octets" . $i . "X=".$rrd_filename.":".$ds_out.":AVERAGE:start=".$prev_from.":end=".$from;
|
||||
$rrd_options .= " SHIFT:".$in."octets" . $i . "X:$period";
|
||||
$rrd_options .= " SHIFT:".$out."octets" . $i . "X:$period";
|
||||
$in_thingX .= $seperatorX . "inoctets" . $i . "X,UN,0," . "inoctets" . $i . "X,IF";
|
||||
$out_thingX .= $seperatorX . "outoctets" . $i . "X,UN,0," . "outoctets" . $i . "X,IF";
|
||||
$plusesX .= $plusX;
|
||||
$seperatorX = ",";
|
||||
$plusX = ",+";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($i)
|
||||
{
|
||||
if ($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
|
||||
$rrd_options .= " CDEF:".$in."octets=" . $in_thing . $pluses;
|
||||
$rrd_options .= " CDEF:".$out."octets=" . $out_thing . $pluses;
|
||||
$rrd_options .= " CDEF:doutoctets=outoctets,-1,*";
|
||||
$rrd_options .= " CDEF:inbits=inoctets,8,*";
|
||||
$rrd_options .= " CDEF:outbits=outoctets,8,*";
|
||||
$rrd_options .= " CDEF:doutbits=doutoctets,8,*";
|
||||
$rrd_options .= " VDEF:95thin=inbits,95,PERCENT";
|
||||
$rrd_options .= " VDEF:95thout=outbits,95,PERCENT";
|
||||
$rrd_options .= " VDEF:d95thout=doutbits,5,PERCENT";
|
||||
|
||||
if($_GET['previous'] == "yes")
|
||||
{
|
||||
$rrd_options .= " CDEF:".$in."octetsX=" . $in_thingX . $pluses;
|
||||
$rrd_options .= " CDEF:".$out."octetsX=" . $out_thingX . $pluses;
|
||||
$rrd_options .= " CDEF:doutoctetsX=outoctetsX,-1,*";
|
||||
$rrd_options .= " CDEF:inbitsX=inoctetsX,8,*";
|
||||
$rrd_options .= " CDEF:outbitsX=outoctetsX,8,*";
|
||||
$rrd_options .= " CDEF:doutbitsX=doutoctetsX,8,*";
|
||||
$rrd_options .= " VDEF:95thinX=inbitsX,95,PERCENT";
|
||||
$rrd_options .= " VDEF:95thoutX=outbitsX,95,PERCENT";
|
||||
$rrd_options .= " VDEF:d95thoutX=doutbitsX,5,PERCENT";
|
||||
}
|
||||
|
||||
if ($legend == 'no' || $legend == '1')
|
||||
{
|
||||
$rrd_options .= " AREA:in".$format."#".$colour_area_in.":";
|
||||
# $rrd_options .= " LINE1.25:in".$format."#".$colour_line_in.":";
|
||||
$rrd_options .= " AREA:dout".$format."#".$colour_area_out.":";
|
||||
# $rrd_options .= " LINE1.25:dout".$format."#".$colour_line_out.":";
|
||||
} else {
|
||||
$rrd_options .= " AREA:in".$format."#".$colour_area_in.":";
|
||||
$rrd_options .= " COMMENT:'bps Now Ave Max 95th %\\n'";
|
||||
# $rrd_options .= " LINE1.25:in".$format."#".$colour_line_in.":In\ ";
|
||||
$rrd_options .= " GPRINT:in".$format.":LAST:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:in".$format.":AVERAGE:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:in".$format.":MAX:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:95thin:%6.2lf%s\\\\n";
|
||||
$rrd_options .= " AREA:dout".$format."#".$colour_area_out.":";
|
||||
# $rrd_options .= " LINE1.25:dout".$format."#".$colour_line_out.":Out";
|
||||
$rrd_options .= " GPRINT:out".$format.":LAST:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:out".$format.":AVERAGE:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:out".$format.":MAX:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:95thout:%6.2lf%s\\\\n";
|
||||
}
|
||||
|
||||
$rrd_options .= " LINE1:95thin#aa0000";
|
||||
$rrd_options .= " LINE1:d95thout#aa0000";
|
||||
|
||||
if($_GET['previous'] == "yes")
|
||||
{
|
||||
$rrd_options .= " AREA:in".$format."X#99999999:";
|
||||
$rrd_options .= " AREA:dout".$format."X#99999999:";
|
||||
$rrd_options .= " LINE1.25:in".$format."X#666666:";
|
||||
$rrd_options .= " LINE1.25:dout".$format."X#666666:";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#$rrd_options .= " HRULE:0#999999";
|
||||
|
||||
?>
|
||||
@@ -18,7 +18,6 @@ if ($multiplier)
|
||||
$rrd_options .= " DEF:".$ds."=".$rrd_filename.":".$ds.":AVERAGE";
|
||||
$rrd_options .= " DEF:".$ds."_max=".$rrd_filename.":".$ds.":MAX";
|
||||
}
|
||||
|
||||
if ($print_total)
|
||||
{
|
||||
$rrd_options .= " VDEF:".$ds."_total=ds,TOTAL";
|
||||
@@ -28,11 +27,42 @@ if ($percentile)
|
||||
{
|
||||
$rrd_options .= " VDEF:".$ds."_percentile=".$ds.",".$percentile.",PERCENT";
|
||||
}
|
||||
|
||||
if ($graph_max)
|
||||
{
|
||||
$rrd_options .= " AREA:".$ds."_max#".$colour_area_max.":";
|
||||
}
|
||||
|
||||
if($_GET['previous'] == "yes")
|
||||
{
|
||||
if ($multiplier)
|
||||
{
|
||||
$rrd_options .= " DEF:".$ds."_oX=".$rrd_filename.":".$ds.":AVERAGE:start=".$prev_from.":end=".$from;
|
||||
$rrd_options .= " DEF:".$ds."_max_oX=".$rrd_filename.":".$ds.":MAX:start=".$prev_from.":end=".$from;
|
||||
$rrd_options .= " SHIFT:".$ds."_oX:$period";
|
||||
$rrd_options .= " SHIFT:".$ds."_max_oX:$period";
|
||||
$rrd_options .= " CDEF:".$ds."X=".$ds."_oX,$multiplier,*";
|
||||
$rrd_options .= " CDEF:".$ds."_maxX=".$ds."_max_oX,$multiplier,*";
|
||||
} else {
|
||||
$rrd_options .= " DEF:".$ds."X=".$rrd_filename.":".$ds.":AVERAGE:start=".$prev_from.":end=".$from;
|
||||
$rrd_options .= " DEF:".$ds."_maxX=".$rrd_filename.":".$ds.":MAX:start=".$prev_from.":end=".$from;
|
||||
$rrd_options .= " SHIFT:".$ds."X:$period";
|
||||
$rrd_options .= " SHIFT:".$ds."_maxX:$period";
|
||||
}
|
||||
if ($print_total)
|
||||
{
|
||||
$rrd_options .= " VDEF:".$ds."_totalX=ds,TOTAL";
|
||||
}
|
||||
if ($percentile)
|
||||
{
|
||||
$rrd_options .= " VDEF:".$ds."_percentileX=".$ds.",".$percentile.",PERCENT";
|
||||
}
|
||||
# if ($graph_max)
|
||||
# {
|
||||
# $rrd_options .= " AREA:".$ds."_max#".$colour_area_max.":";
|
||||
# }
|
||||
}
|
||||
|
||||
|
||||
$rrd_options .= " AREA:".$ds."#".$colour_area.":";
|
||||
$rrd_options .= " COMMENT:'".$unit_text."Now Ave Max";
|
||||
|
||||
@@ -65,4 +95,9 @@ if ($percentile)
|
||||
$rrd_options .= " LINE1:".$ds."_percentile#aa0000";
|
||||
}
|
||||
|
||||
if($_GET['previous'] == "yes")
|
||||
{
|
||||
$rrd_options .= " LINE1.25:".$ds."X#666666:'Prev \\\\n'";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -26,6 +26,6 @@ $colour_line_out = "000099";
|
||||
$colour_area_in = "CDEB8B";
|
||||
$colour_area_out = "C3D9FF";
|
||||
|
||||
include("includes/graphs/generic_multi_bits.inc.php");
|
||||
include("includes/graphs/generic_multi_data.inc.php");
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user