mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Cleanup graphs code
git-svn-id: http://www.observium.org/svn/observer/trunk@1898 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -62,4 +62,4 @@ $rrd_options .= " GPRINT:usedswap:MAX:%7.2lf%sB\\\\n";
|
|||||||
$rrd_options .= " LINE1:totalreal#050505:total";
|
$rrd_options .= " LINE1:totalreal#050505:total";
|
||||||
$rrd_options .= " GPRINT:totalreal:AVERAGE:\ \ %7.2lf%sB";
|
$rrd_options .= " GPRINT:totalreal:AVERAGE:\ \ %7.2lf%sB";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -7,27 +7,26 @@ $device = device_by_id_cache($id);
|
|||||||
|
|
||||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/altiga-ssl.rrd.rrd";
|
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/altiga-ssl.rrd.rrd";
|
||||||
|
|
||||||
$rrd_options .= " DEF:TotalSessions=$rrd_filename:TotalSessions:AVERAGE";
|
$rrd_options .= " DEF:TotalSessions=$rrd_filename:TotalSessions:AVERAGE";
|
||||||
$rrd_options .= " DEF:ActiveSessions=$rrd_filename:ActiveSessions:AVERAGE";
|
$rrd_options .= " DEF:ActiveSessions=$rrd_filename:ActiveSessions:AVERAGE";
|
||||||
$rrd_options .= " DEF:MaxSessions=$rrd_filename:MaxSessions:AVERAGE";
|
$rrd_options .= " DEF:MaxSessions=$rrd_filename:MaxSessions:AVERAGE";
|
||||||
$rrd_options .= " CDEF:a=1min,100,/";
|
$rrd_options .= " CDEF:a=1min,100,/";
|
||||||
$rrd_options .= " CDEF:b=5min,100,/";
|
$rrd_options .= " CDEF:b=5min,100,/";
|
||||||
$rrd_options .= " CDEF:c=15min,100,/";
|
$rrd_options .= " CDEF:c=15min,100,/";
|
||||||
$rrd_options .= " CDEF:cdefd=a,b,c,+,+";
|
$rrd_options .= " CDEF:cdefd=a,b,c,+,+";
|
||||||
$rrd_options .= " COMMENT:Load\ Average\ \ Current\ \ \ \ Average\ \ \ \ Maximum\\\\n";
|
$rrd_options .= " COMMENT:Load\ Average\ \ Current\ \ \ \ Average\ \ \ \ Maximum\\\\n";
|
||||||
$rrd_options .= " AREA:a#ffeeaa:1\ Min:";
|
$rrd_options .= " AREA:a#ffeeaa:1\ Min:";
|
||||||
$rrd_options .= " LINE1:a#c5aa00:";
|
$rrd_options .= " LINE1:a#c5aa00:";
|
||||||
$rrd_options .= " GPRINT:a:LAST:\ \ \ \ %7.2lf";
|
$rrd_options .= " GPRINT:a:LAST:\ \ \ \ %7.2lf";
|
||||||
$rrd_options .= " GPRINT:a:AVERAGE:\ \ %7.2lf";
|
$rrd_options .= " GPRINT:a:AVERAGE:\ \ %7.2lf";
|
||||||
$rrd_options .= " GPRINT:a:MAX:\ \ %7.2lf\\\\n";
|
$rrd_options .= " GPRINT:a:MAX:\ \ %7.2lf\\\\n";
|
||||||
$rrd_options .= " LINE1.25:b#ea8f00:5\ Min:";
|
$rrd_options .= " LINE1.25:b#ea8f00:5\ Min:";
|
||||||
$rrd_options .= " GPRINT:b:LAST:\ \ \ \ %7.2lf";
|
$rrd_options .= " GPRINT:b:LAST:\ \ \ \ %7.2lf";
|
||||||
$rrd_options .= " GPRINT:b:AVERAGE:\ \ %7.2lf";
|
$rrd_options .= " GPRINT:b:AVERAGE:\ \ %7.2lf";
|
||||||
$rrd_options .= " GPRINT:b:MAX:\ \ %7.2lf\\\\n";
|
$rrd_options .= " GPRINT:b:MAX:\ \ %7.2lf\\\\n";
|
||||||
$rrd_options .= " LINE1.25:c#cc0000:15\ Min";
|
$rrd_options .= " LINE1.25:c#cc0000:15\ Min";
|
||||||
$rrd_options .= " GPRINT:c:LAST:\ \ \ %7.2lf";
|
$rrd_options .= " GPRINT:c:LAST:\ \ \ %7.2lf";
|
||||||
$rrd_options .= " GPRINT:c:AVERAGE:\ \ %7.2lf";
|
$rrd_options .= " GPRINT:c:AVERAGE:\ \ %7.2lf";
|
||||||
$rrd_options .= " GPRINT:c:MAX:\ \ %7.2lf\\\\n";
|
$rrd_options .= " GPRINT:c:MAX:\ \ %7.2lf\\\\n";
|
||||||
|
|
||||||
|
?>
|
||||||
?>
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
if($_GET['id'] && is_numeric($_GET['id'])) { $atm_vp_id = $_GET['id']; }
|
if ($_GET['id'] && is_numeric($_GET['id'])) { $atm_vp_id = $_GET['id']; }
|
||||||
|
|
||||||
$sql = "SELECT * FROM `juniAtmVp` as J, `ports` AS I, `devices` AS D";
|
$sql = "SELECT * FROM `juniAtmVp` as J, `ports` AS I, `devices` AS D";
|
||||||
$sql .= " WHERE J.juniAtmVp_id = '".$atm_vp_id."' AND I.interface_id = J.interface_id AND I.device_id = D.device_id";
|
$sql .= " WHERE J.juniAtmVp_id = '".$atm_vp_id."' AND I.interface_id = J.interface_id AND I.device_id = D.device_id";
|
||||||
@@ -9,7 +9,7 @@ $sql .= " WHERE J.juniAtmVp_id = '".$atm_vp_id."' AND I.interface_id = J.interfa
|
|||||||
$query = mysql_query($sql);
|
$query = mysql_query($sql);
|
||||||
$vp = mysql_fetch_array($query);
|
$vp = mysql_fetch_array($query);
|
||||||
|
|
||||||
if($config['allow_unauth_graphs'] || port_permitted($vp['interface_id'])) {
|
if ($config['allow_unauth_graphs'] || port_permitted($vp['interface_id'])) {
|
||||||
|
|
||||||
$port = $vp;
|
$port = $vp;
|
||||||
$device = device_by_id_cache($port['device_id']);
|
$device = device_by_id_cache($port['device_id']);
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(is_numeric($id))
|
if (is_numeric($id))
|
||||||
{
|
{
|
||||||
|
|
||||||
$data = mysql_fetch_assoc(mysql_query("SELECT * FROM bgpPeers WHERE bgpPeer_id = '".$id."'"));
|
$data = mysql_fetch_assoc(mysql_query("SELECT * FROM bgpPeers WHERE bgpPeer_id = '".$id."'"));
|
||||||
|
|
||||||
if(is_numeric($data['device_id']) && ($config['allow_unauth_graphs'] || device_permitted($data['device_id'])))
|
if (is_numeric($data['device_id']) && ($config['allow_unauth_graphs'] || device_permitted($data['device_id'])))
|
||||||
{
|
{
|
||||||
$device = device_by_id_cache($data['device_id']);
|
$device = device_by_id_cache($data['device_id']);
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,14 @@
|
|||||||
|
|
||||||
$sensor = mysql_fetch_array(mysql_query("SELECT * FROM entPhysical as E, devices as D WHERE entPhysical_id = '".mres($_GET['a'])."' and D.device_id = E.device_id"));
|
$sensor = mysql_fetch_array(mysql_query("SELECT * FROM entPhysical as E, devices as D WHERE entPhysical_id = '".mres($_GET['a'])."' and D.device_id = E.device_id"));
|
||||||
|
|
||||||
switch ($sensor['entSensorType']) {
|
switch ($sensor['entSensorType'])
|
||||||
case 'celsius':
|
{
|
||||||
case 'watts':
|
case 'celsius':
|
||||||
case 'voltsDC':
|
case 'watts':
|
||||||
case 'amperes':
|
case 'voltsDC':
|
||||||
$scale_min = "0";
|
case 'amperes':
|
||||||
break;
|
$scale_min = "0";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
include("includes/graphs/common.inc.php");
|
include("includes/graphs/common.inc.php");
|
||||||
@@ -30,5 +31,4 @@ $rrd_options .= " GPRINT:max:MAX:%5.2lf%s";
|
|||||||
$rrd_options .= " GPRINT:max:MAX:%5.2lf%s";
|
$rrd_options .= " GPRINT:max:MAX:%5.2lf%s";
|
||||||
$rrd_options .= " GPRINT:avg:LAST:%5.2lf%s";
|
$rrd_options .= " GPRINT:avg:LAST:%5.2lf%s";
|
||||||
|
|
||||||
|
?>
|
||||||
?>
|
|
||||||
@@ -1,28 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if($_GET['from']) { $from = mres($_GET['from']); }
|
if ($_GET['from']) { $from = mres($_GET['from']); }
|
||||||
if($_GET['to']) { $to = mres($_GET['to']); }
|
if ($_GET['to']) { $to = mres($_GET['to']); }
|
||||||
if($_GET['width']) { $width = mres($_GET['width']); }
|
if ($_GET['width']) { $width = mres($_GET['width']); }
|
||||||
if($_GET['height']) { $height = mres($_GET['height']); }
|
if ($_GET['height']) { $height = mres($_GET['height']); }
|
||||||
if($_GET['inverse']) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
|
if ($_GET['inverse']) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
|
||||||
if($_GET['legend'] == "no") { $rrd_options = " -g"; }
|
if ($_GET['legend'] == "no") { $rrd_options = " -g"; }
|
||||||
|
|
||||||
if(!$scale_min && !$scale_max) { $rrd_options .= " --alt-autoscale-max"; }
|
if (!$scale_min && !$scale_max) { $rrd_options .= " --alt-autoscale-max"; }
|
||||||
|
|
||||||
if(isset($scale_min)) { $rrd_options .= " -l $scale_min"; }
|
if (isset($scale_min)) { $rrd_options .= " -l $scale_min"; }
|
||||||
if(isset($scale_max)) { $rrd_options .= " -u $scale_max"; }
|
if (isset($scale_max)) { $rrd_options .= " -u $scale_max"; }
|
||||||
|
|
||||||
$rrd_options .= " -E --start ".$from." --end " . $to . " --width ".$width." --height ".$height." ";
|
$rrd_options .= " -E --start ".$from." --end " . $to . " --width ".$width." --height ".$height." ";
|
||||||
$rrd_options .= $config['rrdgraph_def_text'];
|
$rrd_options .= $config['rrdgraph_def_text'];
|
||||||
|
|
||||||
if($_GET['bg']) { $rrd_options .= " -c CANVAS#" . mres($_GET['bg']) . " "; }
|
if ($_GET['bg']) { $rrd_options .= " -c CANVAS#" . mres($_GET['bg']) . " "; }
|
||||||
|
|
||||||
#$rrd_options .= " -c BACK#FFFFFF";
|
#$rrd_options .= " -c BACK#FFFFFF";
|
||||||
|
|
||||||
if($height < "99") { $rrd_options .= " --only-graph"; }
|
if ($height < "99") { $rrd_options .= " --only-graph"; } }
|
||||||
if($width <= "300") { $rrd_options .= " --font LEGEND:7:" . $config['mono_font'] . " --font AXIS:6:" . $config['mono_font'];
|
|
||||||
} else { $rrd_options .= " --font LEGEND:8:" . $config['mono_font'] . " --font AXIS:7:" . $config['mono_font']; }
|
if ($width <= "300") { $rrd_options .= " --font LEGEND:7:" . $config['mono_font'] . " --font AXIS:6:" . $config['mono_font'];
|
||||||
|
else { $rrd_options .= " --font LEGEND:8:" . $config['mono_font'] . " --font AXIS:7:" . $config['mono_font']; }
|
||||||
|
|
||||||
$rrd_options .= " --font-render-mode normal";
|
$rrd_options .= " --font-render-mode normal";
|
||||||
|
|
||||||
|
?>
|
||||||
?>
|
|
||||||
@@ -5,12 +5,12 @@
|
|||||||
|
|
||||||
include("includes/graphs/common.inc.php");
|
include("includes/graphs/common.inc.php");
|
||||||
|
|
||||||
if($rrd_filename) { $rrd_filename_out = $rrd_filename; $rrd_filename_in = $rrd_filename; }
|
if ($rrd_filename) { $rrd_filename_out = $rrd_filename; $rrd_filename_in = $rrd_filename; }
|
||||||
|
|
||||||
if($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
|
if ($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
|
||||||
|
|
||||||
|
|
||||||
if($multiplier)
|
if ($multiplier)
|
||||||
{
|
{
|
||||||
$rrd_options .= " DEF:p".$out."octets=".$rrd_filename_out.":".$rra_out.":AVERAGE";
|
$rrd_options .= " DEF:p".$out."octets=".$rrd_filename_out.":".$rra_out.":AVERAGE";
|
||||||
$rrd_options .= " DEF:p".$in."octets=".$rrd_filename_in.":".$rra_in.":AVERAGE";
|
$rrd_options .= " DEF:p".$in."octets=".$rrd_filename_in.":".$rra_in.":AVERAGE";
|
||||||
@@ -27,9 +27,6 @@ if($multiplier)
|
|||||||
$rrd_options .= " DEF:".$in."octets_max=".$rrd_filename_in.":".$rra_in.":MAX";
|
$rrd_options .= " DEF:".$in."octets_max=".$rrd_filename_in.":".$rra_in.":MAX";
|
||||||
}
|
}
|
||||||
|
|
||||||
## No?
|
|
||||||
#print $multiplier;
|
|
||||||
|
|
||||||
$rrd_options .= " CDEF:octets=inoctets,outoctets,+";
|
$rrd_options .= " CDEF:octets=inoctets,outoctets,+";
|
||||||
$rrd_options .= " CDEF:doutoctets=outoctets,-1,*";
|
$rrd_options .= " CDEF:doutoctets=outoctets,-1,*";
|
||||||
$rrd_options .= " CDEF:outbits=outoctets,8,*";
|
$rrd_options .= " CDEF:outbits=outoctets,8,*";
|
||||||
@@ -70,4 +67,4 @@ $rrd_options .= " GPRINT:totout:'Out %6.2lf%s)\\\\l'";
|
|||||||
$rrd_options .= " LINE1:95thin#aa0000";
|
$rrd_options .= " LINE1:95thin#aa0000";
|
||||||
$rrd_options .= " LINE1:d95thout#aa0000";
|
$rrd_options .= " LINE1:d95thout#aa0000";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -5,12 +5,12 @@
|
|||||||
|
|
||||||
include("includes/graphs/common.inc.php");
|
include("includes/graphs/common.inc.php");
|
||||||
|
|
||||||
if($rrd_filename) { $rrd_filename_out = $rrd_filename; $rrd_filename_in = $rrd_filename; }
|
if ($rrd_filename) { $rrd_filename_out = $rrd_filename; $rrd_filename_in = $rrd_filename; }
|
||||||
|
|
||||||
if($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
|
if ($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
|
||||||
|
|
||||||
|
|
||||||
if($multiplier)
|
if ($multiplier)
|
||||||
{
|
{
|
||||||
$rrd_options .= " DEF:p".$out."octets=".$rrd_filename_out.":".$rra_out.":AVERAGE";
|
$rrd_options .= " DEF:p".$out."octets=".$rrd_filename_out.":".$rra_out.":AVERAGE";
|
||||||
$rrd_options .= " DEF:p".$in."octets=".$rrd_filename_in.":".$rra_in.":AVERAGE";
|
$rrd_options .= " DEF:p".$in."octets=".$rrd_filename_in.":".$rra_in.":AVERAGE";
|
||||||
@@ -60,4 +60,4 @@ $rrd_options .= " GPRINT:totout:'Out %6.2lf%s)\\\\l'";
|
|||||||
#$rrd_options .= " LINE1:95thin#aa0000";
|
#$rrd_options .= " LINE1:95thin#aa0000";
|
||||||
#$rrd_options .= " LINE1:d95thout#aa0000";
|
#$rrd_options .= " LINE1:d95thout#aa0000";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -7,10 +7,10 @@ include("includes/graphs/common.inc.php");
|
|||||||
|
|
||||||
$length = "10";
|
$length = "10";
|
||||||
|
|
||||||
if(!isset($percentile)) { $length += "2"; }
|
if (!isset($percentile)) { $length += "2"; }
|
||||||
|
|
||||||
if(!isset($out_text)) { $out_text = "Out"; }
|
if (!isset($out_text)) { $out_text = "Out"; }
|
||||||
if(!isset($in_text)) { $in_text = "In"; }
|
if (!isset($in_text)) { $in_text = "In"; }
|
||||||
|
|
||||||
$unit_text = str_pad(truncate($unit_text,$length),$length);
|
$unit_text = str_pad(truncate($unit_text,$length),$length);
|
||||||
$in_text = str_pad(truncate($in_text,$length),$length);
|
$in_text = str_pad(truncate($in_text,$length),$length);
|
||||||
@@ -25,53 +25,69 @@ $rrd_options .= " CDEF:dout_max=out_max,-1,*";
|
|||||||
$rrd_options .= " CDEF:dout=out,-1,*";
|
$rrd_options .= " CDEF:dout=out,-1,*";
|
||||||
$rrd_options .= " CDEF:both=in,out,+";
|
$rrd_options .= " CDEF:both=in,out,+";
|
||||||
|
|
||||||
if($print_total) {
|
if ($print_total)
|
||||||
|
{
|
||||||
$rrd_options .= " VDEF:totin=in,TOTAL";
|
$rrd_options .= " VDEF:totin=in,TOTAL";
|
||||||
$rrd_options .= " VDEF:totout=out,TOTAL";
|
$rrd_options .= " VDEF:totout=out,TOTAL";
|
||||||
$rrd_options .= " VDEF:tot=both,TOTAL";
|
$rrd_options .= " VDEF:tot=both,TOTAL";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($percentile) {
|
if ($percentile)
|
||||||
|
{
|
||||||
$rrd_options .= " VDEF:percentile_in=in,".$percentile.",PERCENT";
|
$rrd_options .= " VDEF:percentile_in=in,".$percentile.",PERCENT";
|
||||||
$rrd_options .= " VDEF:percentile_out=out,".$percentile.",PERCENT";
|
$rrd_options .= " VDEF:percentile_out=out,".$percentile.",PERCENT";
|
||||||
$rrd_options .= " VDEF:dpercentile_out=dout,".$percentile.",PERCENT";
|
$rrd_options .= " VDEF:dpercentile_out=dout,".$percentile.",PERCENT";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($graph_max) {
|
if ($graph_max)
|
||||||
|
{
|
||||||
$rrd_options .= " AREA:in_max#".$colour_area_in_max.":";
|
$rrd_options .= " AREA:in_max#".$colour_area_in_max.":";
|
||||||
$rrd_options .= " AREA:dout_max#".$colour_area_out_max.":";
|
$rrd_options .= " AREA:dout_max#".$colour_area_out_max.":";
|
||||||
}
|
}
|
||||||
$rrd_options .= " AREA:in#".$colour_area_in.":";
|
$rrd_options .= " AREA:in#".$colour_area_in.":";
|
||||||
$rrd_options .= " COMMENT:'".$unit_text." Now Ave Max";
|
$rrd_options .= " COMMENT:'".$unit_text." Now Ave Max";
|
||||||
if($percentile) {
|
|
||||||
|
if ($percentile)
|
||||||
|
{
|
||||||
$rrd_options .= " ".$percentile."th %";
|
$rrd_options .= " ".$percentile."th %";
|
||||||
}
|
}
|
||||||
|
|
||||||
$rrd_options .= "\\n'";
|
$rrd_options .= "\\n'";
|
||||||
$rrd_options .= " LINE1.25:in#".$colour_line_in.":'".$in_text."'";
|
$rrd_options .= " LINE1.25:in#".$colour_line_in.":'".$in_text."'";
|
||||||
$rrd_options .= " GPRINT:in:LAST:%6.2lf%s";
|
$rrd_options .= " GPRINT:in:LAST:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:in:AVERAGE:%6.2lf%s";
|
$rrd_options .= " GPRINT:in:AVERAGE:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:in_max:MAX:%6.2lf%s";
|
$rrd_options .= " GPRINT:in_max:MAX:%6.2lf%s";
|
||||||
if($percentile) {
|
|
||||||
|
if ($percentile)
|
||||||
|
{
|
||||||
$rrd_options .= " GPRINT:percentile_in:%6.2lf%s";
|
$rrd_options .= " GPRINT:percentile_in:%6.2lf%s";
|
||||||
}
|
}
|
||||||
|
|
||||||
$rrd_options .= " COMMENT:'\\n'";
|
$rrd_options .= " COMMENT:'\\n'";
|
||||||
$rrd_options .= " AREA:dout#".$colour_area_out.":";
|
$rrd_options .= " AREA:dout#".$colour_area_out.":";
|
||||||
$rrd_options .= " LINE1.25:dout#".$colour_line_out.":'".$out_text."'";
|
$rrd_options .= " LINE1.25:dout#".$colour_line_out.":'".$out_text."'";
|
||||||
$rrd_options .= " GPRINT:out:LAST:%6.2lf%s";
|
$rrd_options .= " GPRINT:out:LAST:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:out:AVERAGE:%6.2lf%s";
|
$rrd_options .= " GPRINT:out:AVERAGE:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:out_max:MAX:%6.2lf%s";
|
$rrd_options .= " GPRINT:out_max:MAX:%6.2lf%s";
|
||||||
if($percentile) {
|
|
||||||
|
if ($percentile)
|
||||||
|
{
|
||||||
$rrd_options .= " GPRINT:percentile_out:%6.2lf%s";
|
$rrd_options .= " GPRINT:percentile_out:%6.2lf%s";
|
||||||
}
|
}
|
||||||
|
|
||||||
$rrd_options .= " COMMENT:\\\\n";
|
$rrd_options .= " COMMENT:\\\\n";
|
||||||
if($print_total) {
|
|
||||||
|
if ($print_total)
|
||||||
|
{
|
||||||
$rrd_options .= " GPRINT:tot:'Total %6.2lf%s'";
|
$rrd_options .= " GPRINT:tot:'Total %6.2lf%s'";
|
||||||
$rrd_options .= " GPRINT:totin:'(In %6.2lf%s'";
|
$rrd_options .= " GPRINT:totin:'(In %6.2lf%s'";
|
||||||
$rrd_options .= " GPRINT:totout:'Out %6.2lf%s)\\\\l'";
|
$rrd_options .= " GPRINT:totout:'Out %6.2lf%s)\\\\l'";
|
||||||
}
|
}
|
||||||
if($percentile) {
|
|
||||||
|
if ($percentile)
|
||||||
|
{
|
||||||
$rrd_options .= " LINE1:percentile_in#aa0000";
|
$rrd_options .= " LINE1:percentile_in#aa0000";
|
||||||
$rrd_options .= " LINE1:dpercentile_out#aa0000";
|
$rrd_options .= " LINE1:dpercentile_out#aa0000";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -6,7 +6,9 @@
|
|||||||
include("includes/graphs/common.inc.php");
|
include("includes/graphs/common.inc.php");
|
||||||
|
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach($rrd_filenames as $rrd_filename) {
|
|
||||||
|
foreach ($rrd_filenames as $rrd_filename)
|
||||||
|
{
|
||||||
$rrd_options .= " DEF:inoctets" . $i . "=".$rrd_filename.":".$rra_in.":AVERAGE";
|
$rrd_options .= " DEF:inoctets" . $i . "=".$rrd_filename.":".$rra_in.":AVERAGE";
|
||||||
$rrd_options .= " DEF:outoctets" . $i . "=".$rrd_filename.":".$rra_out.":AVERAGE";
|
$rrd_options .= " DEF:outoctets" . $i . "=".$rrd_filename.":".$rra_out.":AVERAGE";
|
||||||
$in_thing .= $seperator . "inoctets" . $i . ",UN,0," . "inoctets" . $i . ",IF";
|
$in_thing .= $seperator . "inoctets" . $i . ",UN,0," . "inoctets" . $i . ",IF";
|
||||||
@@ -17,9 +19,9 @@ foreach($rrd_filenames as $rrd_filename) {
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($i)
|
if ($i)
|
||||||
{
|
{
|
||||||
if($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
|
if ($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
|
||||||
$rrd_options .= " CDEF:".$in."octets=" . $in_thing . $pluses;
|
$rrd_options .= " CDEF:".$in."octets=" . $in_thing . $pluses;
|
||||||
$rrd_options .= " CDEF:".$out."octets=" . $out_thing . $pluses;
|
$rrd_options .= " CDEF:".$out."octets=" . $out_thing . $pluses;
|
||||||
$rrd_options .= " CDEF:doutoctets=outoctets,-1,*";
|
$rrd_options .= " CDEF:doutoctets=outoctets,-1,*";
|
||||||
@@ -30,31 +32,32 @@ if($i)
|
|||||||
$rrd_options .= " VDEF:95thout=outbits,95,PERCENT";
|
$rrd_options .= " VDEF:95thout=outbits,95,PERCENT";
|
||||||
$rrd_options .= " VDEF:d95thout=doutbits,5,PERCENT";
|
$rrd_options .= " VDEF:d95thout=doutbits,5,PERCENT";
|
||||||
|
|
||||||
if($legend == 'no' || $legend == '1') {
|
if ($legend == 'no' || $legend == '1')
|
||||||
$rrd_options .= " AREA:inbits#".$colour_area_in.":";
|
{
|
||||||
$rrd_options .= " LINE1.25:inbits#".$colour_line_in.":";
|
$rrd_options .= " AREA:inbits#".$colour_area_in.":";
|
||||||
$rrd_options .= " AREA:doutbits#".$colour_area_out.":";
|
$rrd_options .= " LINE1.25:inbits#".$colour_line_in.":";
|
||||||
$rrd_options .= " LINE1.25:doutbits#".$colour_line_out.":";
|
$rrd_options .= " AREA:doutbits#".$colour_area_out.":";
|
||||||
|
$rrd_options .= " LINE1.25:doutbits#".$colour_line_out.":";
|
||||||
} else {
|
} else {
|
||||||
$rrd_options .= " AREA:inbits#".$colour_area_in.":";
|
$rrd_options .= " AREA:inbits#".$colour_area_in.":";
|
||||||
$rrd_options .= " COMMENT:'bps Now Ave Max 95th %\\n'";
|
$rrd_options .= " COMMENT:'bps Now Ave Max 95th %\\n'";
|
||||||
$rrd_options .= " LINE1.25:inbits#".$colour_line_in.":In\ ";
|
$rrd_options .= " LINE1.25:inbits#".$colour_line_in.":In\ ";
|
||||||
$rrd_options .= " GPRINT:inbits:LAST:%6.2lf%s";
|
$rrd_options .= " GPRINT:inbits:LAST:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:inbits:AVERAGE:%6.2lf%s";
|
$rrd_options .= " GPRINT:inbits:AVERAGE:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:inbits:MAX:%6.2lf%s";
|
$rrd_options .= " GPRINT:inbits:MAX:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:95thin:%6.2lf%s\\\\n";
|
$rrd_options .= " GPRINT:95thin:%6.2lf%s\\\\n";
|
||||||
$rrd_options .= " AREA:doutbits#".$colour_area_out.":";
|
$rrd_options .= " AREA:doutbits#".$colour_area_out.":";
|
||||||
$rrd_options .= " LINE1.25:doutbits#".$colour_line_out.":Out";
|
$rrd_options .= " LINE1.25:doutbits#".$colour_line_out.":Out";
|
||||||
$rrd_options .= " GPRINT:outbits:LAST:%6.2lf%s";
|
$rrd_options .= " GPRINT:outbits:LAST:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:outbits:AVERAGE:%6.2lf%s";
|
$rrd_options .= " GPRINT:outbits:AVERAGE:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:outbits:MAX:%6.2lf%s";
|
$rrd_options .= " GPRINT:outbits:MAX:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:95thout:%6.2lf%s\\\\n";
|
$rrd_options .= " GPRINT:95thout:%6.2lf%s\\\\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$rrd_options .= " LINE1:95thin#aa0000";
|
$rrd_options .= " LINE1:95thin#aa0000";
|
||||||
$rrd_options .= " LINE1:d95thout#aa0000";
|
$rrd_options .= " LINE1:d95thout#aa0000";
|
||||||
}
|
}
|
||||||
|
|
||||||
#$rrd_options .= " HRULE:0#999999";
|
#$rrd_options .= " HRULE:0#999999";
|
||||||
|
|
||||||
|
?>
|
||||||
?>
|
|
||||||
@@ -1,48 +1,60 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("includes/graphs/common.inc.php");
|
include("includes/graphs/common.inc.php");
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$rrd_options .= " COMMENT:' In\: Current Maximum '";
|
|
||||||
if(!$nototal) {$rrd_options .= " COMMENT:'Total '";}
|
|
||||||
$rrd_options .= " COMMENT:'Out\: Current Maximum'";
|
|
||||||
if(!$nototal) {$rrd_options .= " COMMENT:' Total'";}
|
|
||||||
$rrd_options .= " COMMENT:'\\n'";
|
|
||||||
|
|
||||||
foreach($rrd_list as $rrd) {
|
$rrd_options .= " COMMENT:' In\: Current Maximum '";
|
||||||
if(!$config['graph_colours'][$colours_in][$iter] || !$config['graph_colours'][$colours_out][$iter]) { $iter = 0; }
|
if (!$nototal) { $rrd_options .= " COMMENT:'Total '"; }
|
||||||
|
$rrd_options .= " COMMENT:'Out\: Current Maximum'";
|
||||||
|
if (!$nototal) { $rrd_options .= " COMMENT:' Total'"; }
|
||||||
|
$rrd_options .= " COMMENT:'\\n'";
|
||||||
|
|
||||||
$colour_in=$config['graph_colours'][$colours_in][$iter];
|
foreach ($rrd_list as $rrd)
|
||||||
$colour_out=$config['graph_colours'][$colours_out][$iter];
|
{
|
||||||
|
if (!$config['graph_colours'][$colours_in][$iter] || !$config['graph_colours'][$colours_out][$iter]) { $iter = 0; }
|
||||||
|
|
||||||
$descr = str_replace(":", "\:", substr(str_pad($rrd['descr'], 18),0,18));
|
$colour_in=$config['graph_colours'][$colours_in][$iter];
|
||||||
|
$colour_out=$config['graph_colours'][$colours_out][$iter];
|
||||||
|
|
||||||
$rrd_options .= " DEF:".$in.$i."=".$rrd['filename'].":".$rra_in.":AVERAGE ";
|
$descr = str_replace(":", "\:", substr(str_pad($rrd['descr'], 18),0,18));
|
||||||
$rrd_options .= " DEF:".$out.$i."=".$rrd['filename'].":".$rra_out.":AVERAGE ";
|
|
||||||
$rrd_options .= " CDEF:inB".$i."=in".$i.",$multiplier,* ";
|
$rrd_options .= " DEF:".$in.$i."=".$rrd['filename'].":".$rra_in.":AVERAGE ";
|
||||||
$rrd_options .= " CDEF:outB".$i."=out".$i.",$multiplier,*";
|
$rrd_options .= " DEF:".$out.$i."=".$rrd['filename'].":".$rra_out.":AVERAGE ";
|
||||||
$rrd_options .= " CDEF:outB".$i."_neg=outB".$i.",-1,*";
|
$rrd_options .= " CDEF:inB".$i."=in".$i.",$multiplier,* ";
|
||||||
$rrd_options .= " CDEF:octets".$i."=inB".$i.",outB".$i.",+";
|
$rrd_options .= " CDEF:outB".$i."=out".$i.",$multiplier,*";
|
||||||
if(!$args['nototal']) {
|
$rrd_options .= " CDEF:outB".$i."_neg=outB".$i.",-1,*";
|
||||||
$rrd_options .= " VDEF:totin".$i."=inB".$i.",TOTAL";
|
$rrd_options .= " CDEF:octets".$i."=inB".$i.",outB".$i.",+";
|
||||||
$rrd_options .= " VDEF:totout".$i."=outB".$i.",TOTAL";
|
|
||||||
$rrd_options .= " VDEF:tot".$i."=octets".$i.",TOTAL";
|
if (!$args['nototal'])
|
||||||
}
|
{
|
||||||
$rrd_options .= " HRULE:999999999999999#" . $colour_out . ":\\\s:";
|
$rrd_options .= " VDEF:totin".$i."=inB".$i.",TOTAL";
|
||||||
if($i) {$stack="STACK";}
|
$rrd_options .= " VDEF:totout".$i."=outB".$i.",TOTAL";
|
||||||
$rrd_options .= " AREA:inB".$i."#" . $colour_in . ":'" . $descr . "':$stack";
|
$rrd_options .= " VDEF:tot".$i."=octets".$i.",TOTAL";
|
||||||
$rrd_optionsb .= " AREA:outB".$i."_neg#" . $colour_out . "::$stack";
|
|
||||||
$rrd_options .= " GPRINT:inB".$i.":LAST:%6.2lf%s$units";
|
|
||||||
$rrd_options .= " GPRINT:inB".$i.":MAX:%6.2lf%s$units";
|
|
||||||
if(!$nototal) { $rrd_options .= " GPRINT:totin".$i.":%6.2lf%s$total_units"; }
|
|
||||||
$rrd_options .= " COMMENT:' '";
|
|
||||||
$rrd_options .= " GPRINT:outB".$i.":LAST:%6.2lf%s$units";
|
|
||||||
$rrd_options .= " GPRINT:outB".$i.":MAX:%6.2lf%s$units";
|
|
||||||
if(!$nototal) { $rrd_options .= " GPRINT:totout".$i.":%6.2lf%s$total_unit"; }
|
|
||||||
$rrd_options .= " COMMENT:\\\\n";
|
|
||||||
$i++; $iter++;
|
|
||||||
}
|
}
|
||||||
$rrd_options .= $rrd_optionsb;
|
|
||||||
$rrd_options .= " HRULE:0#999999";
|
|
||||||
|
|
||||||
?>
|
$rrd_options .= " HRULE:999999999999999#" . $colour_out . ":\\\s:";
|
||||||
|
|
||||||
|
if ($i) { $stack="STACK"; }
|
||||||
|
|
||||||
|
$rrd_options .= " AREA:inB".$i."#" . $colour_in . ":'" . $descr . "':$stack";
|
||||||
|
$rrd_optionsb .= " AREA:outB".$i."_neg#" . $colour_out . "::$stack";
|
||||||
|
$rrd_options .= " GPRINT:inB".$i.":LAST:%6.2lf%s$units";
|
||||||
|
$rrd_options .= " GPRINT:inB".$i.":MAX:%6.2lf%s$units";
|
||||||
|
|
||||||
|
if (!$nototal) { $rrd_options .= " GPRINT:totin".$i.":%6.2lf%s$total_units"; }
|
||||||
|
|
||||||
|
$rrd_options .= " COMMENT:' '";
|
||||||
|
$rrd_options .= " GPRINT:outB".$i.":LAST:%6.2lf%s$units";
|
||||||
|
$rrd_options .= " GPRINT:outB".$i.":MAX:%6.2lf%s$units";
|
||||||
|
|
||||||
|
if (!$nototal) { $rrd_options .= " GPRINT:totout".$i.":%6.2lf%s$total_unit"; }
|
||||||
|
|
||||||
|
$rrd_options .= " COMMENT:\\\\n";
|
||||||
|
$i++; $iter++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$rrd_options .= $rrd_optionsb;
|
||||||
|
$rrd_options .= " HRULE:0#999999";
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -1,43 +1,46 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("includes/graphs/common.inc.php");
|
include("includes/graphs/common.inc.php");
|
||||||
|
|
||||||
$unit_text = str_pad($unit_text, 13);
|
$unit_text = str_pad($unit_text, 13);
|
||||||
$unit_text = substr($unit_text,0,13);
|
$unit_text = substr($unit_text,0,13);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$iter = 0;
|
$iter = 0;
|
||||||
|
|
||||||
$rrd_options .= " COMMENT:'".$unit_text." Cur Min Max Avg\\n'";
|
$rrd_options .= " COMMENT:'".$unit_text." Cur Min Max Avg\\n'";
|
||||||
|
|
||||||
|
|
||||||
foreach($rrd_list as $rrd) {
|
foreach ($rrd_list as $rrd)
|
||||||
if(!$config['graph_colours'][$colours][$iter]) { $iter = 0; }
|
{
|
||||||
|
if (!$config['graph_colours'][$colours][$iter]) { $iter = 0; }
|
||||||
|
|
||||||
$colour=$config['graph_colours'][$colours][$iter];
|
$colour=$config['graph_colours'][$colours][$iter];
|
||||||
|
|
||||||
$rra = $rrd['rra'];
|
$rra = $rrd['rra'];
|
||||||
$filename = $rrd['filename'];
|
$filename = $rrd['filename'];
|
||||||
$descr = $rrd['descr'];
|
$descr = $rrd['descr'];
|
||||||
$descr = substr(str_pad($descr, 10),0,10);
|
$descr = substr(str_pad($descr, 10),0,10);
|
||||||
$descr = str_replace(":", "\:", $descr);
|
$descr = str_replace(":", "\:", $descr);
|
||||||
|
|
||||||
$id = $rra."_".$i;
|
$id = $rra."_".$i;
|
||||||
|
|
||||||
$rrd_options .= " DEF:".$id."=$filename:$rra:AVERAGE";
|
|
||||||
$rrd_options .= " DEF:".$id."min=$filename:$rra:MIN";
|
|
||||||
$rrd_options .= " DEF:".$id."max=$filename:$rra:MAX";
|
|
||||||
if($rrd['invert'] == "1") {
|
|
||||||
$rrd_options .= " CDEF:".$id."graph=".$id.",-1,*";
|
|
||||||
$rrd_options .= " LINE1.25:".$id."graph#".$colour.":'$descr'";
|
|
||||||
} else {
|
|
||||||
$rrd_options .= " LINE1.25:".$id."#".$colour.":'$descr'";
|
|
||||||
}
|
|
||||||
|
|
||||||
$rrd_options .= " GPRINT:".$id.":LAST:%5.2lf%s GPRINT:".$id."min:MIN:%5.2lf%s";
|
$rrd_options .= " DEF:".$id."=$filename:$rra:AVERAGE";
|
||||||
$rrd_options .= " GPRINT:".$id."max:MAX:%5.2lf%s GPRINT:".$id.":AVERAGE:%5.2lf%s\\\\n";
|
$rrd_options .= " DEF:".$id."min=$filename:$rra:MIN";
|
||||||
|
$rrd_options .= " DEF:".$id."max=$filename:$rra:MAX";
|
||||||
|
|
||||||
$i++; $iter++;
|
if ($rrd['invert'] == "1")
|
||||||
|
{
|
||||||
|
$rrd_options .= " CDEF:".$id."graph=".$id.",-1,*";
|
||||||
|
$rrd_options .= " LINE1.25:".$id."graph#".$colour.":'$descr'";
|
||||||
|
} else {
|
||||||
|
$rrd_options .= " LINE1.25:".$id."#".$colour.":'$descr'";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
$rrd_options .= " GPRINT:".$id.":LAST:%5.2lf%s GPRINT:".$id."min:MIN:%5.2lf%s";
|
||||||
|
$rrd_options .= " GPRINT:".$id."max:MAX:%5.2lf%s GPRINT:".$id.":AVERAGE:%5.2lf%s\\\\n";
|
||||||
|
|
||||||
|
$i++; $iter++;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -6,18 +6,18 @@ $units_descr = substr(str_pad($units_descr, 18),0,18);
|
|||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$rrd_options .= " COMMENT:'$units_descr Current Average Maximum\\n'";
|
$rrd_options .= " COMMENT:'$units_descr Current Average Maximum\\n'";
|
||||||
if(!$nototal) {$rrd_options .= " COMMENT:' Tot'";}
|
if (!$nototal) { $rrd_options .= " COMMENT:' Tot'"; }
|
||||||
$rrd_options .= " COMMENT:'\\n'";
|
$rrd_options .= " COMMENT:'\\n'";
|
||||||
|
|
||||||
foreach($rrd_list as $rrd)
|
foreach ($rrd_list as $rrd)
|
||||||
{
|
{
|
||||||
if(!$config['graph_colours'][$colours_in][$iter] || !$config['graph_colours'][$colours_out][$iter]) { $iter = 0; }
|
if (!$config['graph_colours'][$colours_in][$iter] || !$config['graph_colours'][$colours_out][$iter]) { $iter = 0; }
|
||||||
|
|
||||||
$colour_in=$config['graph_colours'][$colours_in][$iter];
|
$colour_in=$config['graph_colours'][$colours_in][$iter];
|
||||||
$colour_out=$config['graph_colours'][$colours_out][$iter];
|
$colour_out=$config['graph_colours'][$colours_out][$iter];
|
||||||
|
|
||||||
if($rrd['colour_area_in']) { $colour_in = $rrd['colour_area_in']; }
|
if ($rrd['colour_area_in']) { $colour_in = $rrd['colour_area_in']; }
|
||||||
if($rrd['colour_area_out']) {$colour_out = $rrd['colour_area_out']; }
|
if ($rrd['colour_area_out']) { $colour_out = $rrd['colour_area_out']; }
|
||||||
|
|
||||||
$rrd_options .= " DEF:in".$i."=".$rrd['filename'].":".$rrd['rra_in'].":AVERAGE ";
|
$rrd_options .= " DEF:in".$i."=".$rrd['filename'].":".$rrd['rra_in'].":AVERAGE ";
|
||||||
$rrd_options .= " DEF:out".$i."=".$rrd['filename'].":".$rrd['rra_out'].":AVERAGE ";
|
$rrd_options .= " DEF:out".$i."=".$rrd['filename'].":".$rrd['rra_out'].":AVERAGE ";
|
||||||
@@ -25,31 +25,31 @@ foreach($rrd_list as $rrd)
|
|||||||
$rrd_options .= " CDEF:outB".$i."=out".$i.",$multiplier,*";
|
$rrd_options .= " CDEF:outB".$i."=out".$i.",$multiplier,*";
|
||||||
$rrd_options .= " CDEF:outB".$i."_neg=outB".$i.",-1,*";
|
$rrd_options .= " CDEF:outB".$i."_neg=outB".$i.",-1,*";
|
||||||
$rrd_options .= " CDEF:octets".$i."=inB".$i.",outB".$i.",+";
|
$rrd_options .= " CDEF:octets".$i."=inB".$i.",outB".$i.",+";
|
||||||
if(!$args['nototal'])
|
if (!$args['nototal'])
|
||||||
{
|
{
|
||||||
$rrd_options .= " VDEF:totin".$i."=inB".$i.",TOTAL";
|
$rrd_options .= " VDEF:totin".$i."=inB".$i.",TOTAL";
|
||||||
$rrd_options .= " VDEF:totout".$i."=outB".$i.",TOTAL";
|
$rrd_options .= " VDEF:totout".$i."=outB".$i.",TOTAL";
|
||||||
$rrd_options .= " VDEF:tot".$i."=octets".$i.",TOTAL";
|
$rrd_options .= " VDEF:tot".$i."=octets".$i.",TOTAL";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($i) {$stack="STACK";}
|
if ($i) { $stack="STACK"; }
|
||||||
|
|
||||||
$rrd_options .= " AREA:inB".$i."#" . $colour_in . ":'" . substr(str_pad($rrd['descr'], 10),0,10) . "In ':$stack";
|
$rrd_options .= " AREA:inB".$i."#" . $colour_in . ":'" . substr(str_pad($rrd['descr'], 10),0,10) . "In ':$stack";
|
||||||
$rrd_options .= " GPRINT:inB".$i.":LAST:%6.2lf%s";
|
$rrd_options .= " GPRINT:inB".$i.":LAST:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:inB".$i.":AVERAGE:%6.2lf%s";
|
$rrd_options .= " GPRINT:inB".$i.":AVERAGE:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:inB".$i.":MAX:%6.2lf%s";
|
$rrd_options .= " GPRINT:inB".$i.":MAX:%6.2lf%s";
|
||||||
|
|
||||||
if(!$nototal) { $rrd_options .= " GPRINT:totin".$i.":%6.2lf%s$total_units"; }
|
if (!$nototal) { $rrd_options .= " GPRINT:totin".$i.":%6.2lf%s$total_units"; }
|
||||||
|
|
||||||
$rrd_options .= " COMMENT:'\\n'";
|
$rrd_options .= " COMMENT:'\\n'";
|
||||||
$rrd_optionsb .= " AREA:outB".$i."_neg#" . $colour_out . "::$stack";
|
$rrd_optionsb .= " AREA:outB".$i."_neg#" . $colour_out . "::$stack";
|
||||||
$rrd_options .= " HRULE:999999999999999#" . $colour_out . ":'" . substr(str_pad('', 10),0,10) . "Out':";
|
$rrd_options .= " HRULE:999999999999999#" . $colour_out . ":'" . substr(str_pad('', 10),0,10) . "Out':";
|
||||||
$rrd_options .= " GPRINT:outB".$i.":LAST:%6.2lf%s";
|
$rrd_options .= " GPRINT:outB".$i.":LAST:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:outB".$i.":AVERAGE:%6.2lf%s";
|
$rrd_options .= " GPRINT:outB".$i.":AVERAGE:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:outB".$i.":MAX:%6.2lf%s";
|
$rrd_options .= " GPRINT:outB".$i.":MAX:%6.2lf%s";
|
||||||
|
|
||||||
if(!$nototal) { $rrd_options .= " GPRINT:totout".$i.":%6.2lf%s$total_unit"; }
|
if (!$nototal) { $rrd_options .= " GPRINT:totout".$i.":%6.2lf%s$total_unit"; }
|
||||||
|
|
||||||
$rrd_options .= " COMMENT:'\\n'";
|
$rrd_options .= " COMMENT:'\\n'";
|
||||||
$i++; $iter++;
|
$i++; $iter++;
|
||||||
}
|
}
|
||||||
@@ -57,4 +57,4 @@ foreach($rrd_list as $rrd)
|
|||||||
$rrd_options .= $rrd_optionsb;
|
$rrd_options .= $rrd_optionsb;
|
||||||
$rrd_options .= " HRULE:0#999999";
|
$rrd_options .= " HRULE:0#999999";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,29 +1,34 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("includes/graphs/common.inc.php");
|
include("includes/graphs/common.inc.php");
|
||||||
|
|
||||||
$unit_text = str_pad(truncate($unit_text,10),10);
|
$unit_text = str_pad(truncate($unit_text,10),10);
|
||||||
$rrd_options .= " COMMENT:'$unit_text Cur Max'";
|
$rrd_options .= " COMMENT:'$unit_text Cur Max'";
|
||||||
if(!$nototal) {$rrd_options .= " COMMENT:'Total '";}
|
if (!$nototal) { $rrd_options .= " COMMENT:'Total '"; }
|
||||||
$rrd_options .= " COMMENT:'\\n'";
|
$rrd_options .= " COMMENT:'\\n'";
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach($rrd_list as $rrd) {
|
foreach ($rrd_list as $rrd)
|
||||||
if(!$config['graph_colours'][$colours][$iter]) { $iter = 0; }
|
{
|
||||||
$colour=$config['graph_colours'][$colours][$iter];
|
if (!$config['graph_colours'][$colours][$iter]) { $iter = 0; }
|
||||||
$rrd_options .= " DEF:".$rrd['rra'].$i."=".$rrd['filename'].":".$rrd['rra'].":AVERAGE ";
|
$colour = $config['graph_colours'][$colours][$iter];
|
||||||
$rrd_options .= " DEF:".$rrd['rra'].$i."max=".$rrd['filename'].":".$rrd['rra'].":MAX ";
|
$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 (!$args['nototal'])
|
||||||
$rrd_options .= " VDEF:tot".$rrd['rra'].$i."=".$rrd['rra'].$i.",TOTAL";
|
{
|
||||||
}
|
$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";
|
|
||||||
$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++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
if ($i) { $stack="STACK"; }
|
||||||
|
$rrd_options .= " AREA:".$rrd['rra'].$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++;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -11,37 +11,50 @@ $line_text = str_pad(truncate($line_text,12,''),12);
|
|||||||
$rrd_options .= " DEF:".$rra."=".$rrd_filename.":".$rra.":AVERAGE";
|
$rrd_options .= " DEF:".$rra."=".$rrd_filename.":".$rra.":AVERAGE";
|
||||||
$rrd_options .= " DEF:".$rra."_max=".$rrd_filename.":".$rra.":MAX";
|
$rrd_options .= " DEF:".$rra."_max=".$rrd_filename.":".$rra.":MAX";
|
||||||
|
|
||||||
if($print_total) {
|
if ($print_total)
|
||||||
|
{
|
||||||
$rrd_options .= " VDEF:".$rra."_total=rra,TOTAL";
|
$rrd_options .= " VDEF:".$rra."_total=rra,TOTAL";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($percentile) {
|
if ($percentile)
|
||||||
|
{
|
||||||
$rrd_options .= " VDEF:".$rra."_percentile=".$rra.",".$percentile.",PERCENT";
|
$rrd_options .= " VDEF:".$rra."_percentile=".$rra.",".$percentile.",PERCENT";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($graph_max) {
|
if ($graph_max)
|
||||||
|
{
|
||||||
$rrd_options .= " AREA:".$rra."_max#".$colour_area_max.":";
|
$rrd_options .= " AREA:".$rra."_max#".$colour_area_max.":";
|
||||||
}
|
}
|
||||||
$rrd_options .= " AREA:".$rra."#".$colour_area.":";
|
$rrd_options .= " AREA:".$rra."#".$colour_area.":";
|
||||||
$rrd_options .= " COMMENT:'".$unit_text."Now Ave Max";
|
$rrd_options .= " COMMENT:'".$unit_text."Now Ave Max";
|
||||||
if($percentile) {
|
|
||||||
|
if ($percentile)
|
||||||
|
{
|
||||||
$rrd_options .= " ".$percentile."th %";
|
$rrd_options .= " ".$percentile."th %";
|
||||||
}
|
}
|
||||||
|
|
||||||
$rrd_options .= "\\n'";
|
$rrd_options .= "\\n'";
|
||||||
$rrd_options .= " LINE1.25:".$rra."#".$colour_line.":'".$line_text."'";
|
$rrd_options .= " LINE1.25:".$rra."#".$colour_line.":'".$line_text."'";
|
||||||
$rrd_options .= " GPRINT:".$rra.":LAST:%6.2lf%s";
|
$rrd_options .= " GPRINT:".$rra.":LAST:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:".$rra.":AVERAGE:%6.2lf%s";
|
$rrd_options .= " GPRINT:".$rra.":AVERAGE:%6.2lf%s";
|
||||||
$rrd_options .= " GPRINT:".$rra."_max:MAX:%6.2lf%s";
|
$rrd_options .= " GPRINT:".$rra."_max:MAX:%6.2lf%s";
|
||||||
if($percentile) {
|
|
||||||
|
if ($percentile)
|
||||||
|
{
|
||||||
$rrd_options .= " GPRINT:".$rra."_percentile:%6.2lf%s";
|
$rrd_options .= " GPRINT:".$rra."_percentile:%6.2lf%s";
|
||||||
}
|
}
|
||||||
|
|
||||||
$rrd_options .= "\\\\n";
|
$rrd_options .= "\\\\n";
|
||||||
$rrd_options .= " COMMENT:\\\\n";
|
$rrd_options .= " COMMENT:\\\\n";
|
||||||
if($print_total) {
|
|
||||||
|
if ($print_total)
|
||||||
|
{
|
||||||
$rrd_options .= " GPRINT:".$rra."_tot:Total\ %6.2lf%s\)\\\\l";
|
$rrd_options .= " GPRINT:".$rra."_tot:Total\ %6.2lf%s\)\\\\l";
|
||||||
}
|
}
|
||||||
if($percentile) {
|
|
||||||
|
if ($percentile)
|
||||||
|
{
|
||||||
$rrd_options .= " LINE1:".$rra."_percentile#aa0000";
|
$rrd_options .= " LINE1:".$rra."_percentile#aa0000";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -47,7 +47,7 @@ preg_match('/^(?P<type>[A-Za-z0-9]+)_(?P<subtype>.+)/', mres($_GET['type']), $gr
|
|||||||
$type = $graphtype['type'];
|
$type = $graphtype['type'];
|
||||||
$subtype = $graphtype['subtype'];
|
$subtype = $graphtype['subtype'];
|
||||||
|
|
||||||
if ($debug) {print_r($graphtype);}
|
if ($debug) {print_r($graphtype); }
|
||||||
|
|
||||||
$graphfile = $config['temp_dir'] . "/" . strgen() . ".png";
|
$graphfile = $config['temp_dir'] . "/" . strgen() . ".png";
|
||||||
|
|
||||||
@@ -79,8 +79,9 @@ else
|
|||||||
|
|
||||||
function graph_error($string)
|
function graph_error($string)
|
||||||
{
|
{
|
||||||
global $width, $height;
|
global $width, $height, $debug;
|
||||||
header('Content-type: image/png');
|
|
||||||
|
if (!$debug) { header('Content-type: image/png'); }
|
||||||
if ($height > "99") { $width +=75; }
|
if ($height > "99") { $width +=75; }
|
||||||
$im = imagecreate($width, $height);
|
$im = imagecreate($width, $height);
|
||||||
$orange = imagecolorallocate($im, 255, 225, 225);
|
$orange = imagecolorallocate($im, 255, 225, 225);
|
||||||
@@ -115,8 +116,8 @@ if (!$auth)
|
|||||||
if ($config['rrdcached']) { $rrd_switches = " --daemon ".$config['rrdcached'] . " "; }
|
if ($config['rrdcached']) { $rrd_switches = " --daemon ".$config['rrdcached'] . " "; }
|
||||||
$rrd_cmd = $config['rrdtool'] . " graph $graphfile $rrd_options" . $rrd_switches;
|
$rrd_cmd = $config['rrdtool'] . " graph $graphfile $rrd_options" . $rrd_switches;
|
||||||
$woo = shell_exec($rrd_cmd);
|
$woo = shell_exec($rrd_cmd);
|
||||||
if ($_GET['debug']) { echo("<pre>".$rrd_cmd."</pre>"); }
|
if ($debug) { echo("<pre>".$rrd_cmd."</pre>"); }
|
||||||
if (is_file($graphfile))
|
if (is_file($graphfile))
|
||||||
{
|
{
|
||||||
header('Content-type: image/png');
|
header('Content-type: image/png');
|
||||||
$fd = fopen($graphfile,'r');fpassthru($fd);fclose($fd);
|
$fd = fopen($graphfile,'r');fpassthru($fd);fclose($fd);
|
||||||
|
|||||||
@@ -18,17 +18,13 @@ $rrd_list[2]['filename'] = $file;
|
|||||||
$rrd_list[2]['descr'] = "Failed";
|
$rrd_list[2]['descr'] = "Failed";
|
||||||
$rrd_list[2]['rra'] = "failed";
|
$rrd_list[2]['rra'] = "failed";
|
||||||
|
|
||||||
|
if ($_GET['debug']) { print_r($rrd_list); }
|
||||||
if ($_GET['debug']) { print_r($rrd_list); }
|
|
||||||
|
|
||||||
$colours = "mixed";
|
$colours = "mixed";
|
||||||
$nototal = 1;
|
$nototal = 1;
|
||||||
$unit_text = "Sessions";
|
$unit_text = "Sessions";
|
||||||
$scale_min = "0";
|
$scale_min = "0";
|
||||||
|
|
||||||
|
|
||||||
include ("generic_multi_simplex_seperated.inc.php");
|
include ("generic_multi_simplex_seperated.inc.php");
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
?>
|
|
||||||
Reference in New Issue
Block a user