nice fixes! :D

git-svn-id: http://www.observium.org/svn/observer/trunk@247 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong 2008-09-03 20:04:34 +00:00
parent bab0efc956
commit 9d2fdf3a38
7 changed files with 138 additions and 31 deletions

View File

@ -65,6 +65,15 @@
case 'multi_bits':
$graph = graph_multi_bits ($_GET['interfaces'], $graphfile, $from, $to, $width, $height);
break;
case 'adsl_rate':
$graph = graph_adsl_rate ($hostname. "/adsl-4.rrd", $graphfile, $from, $to, $width, $height);
break;
case 'adsl_snr':
$graph = graph_adsl_snr ($hostname. "/adsl-4.rrd", $graphfile, $from, $to, $width, $height);
break;
case 'adsl_atn':
$graph = graph_adsl_atn ($hostname. "/adsl-4.rrd", $graphfile, $from, $to, $width, $height);
break;
case 'global_bits':
$graph = graph_global_bits ("global_bits.png", $from, $to, $width, $height);
break;

View File

@ -0,0 +1,17 @@
<?php
echo("<div class=graphhead>IP Statistics</div>");
$graph_type = "ip_graph"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>TCP Statistics</div>");
$graph_type = "tcp_graph"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>UDP Statistics</div>");
$graph_type = "udp_graph"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>ICMP Statistics</div>");
$graph_type = "icmp_graph"; include ("includes/print-device-graph.php");
echo("<br />");
?>

View File

@ -0,0 +1,8 @@
<?php
echo("<div class=graphhead>Device Uptime</div>");
$graph_type = "uptime"; include ("includes/print-device-graph.php");
echo("<br />");
?>

View File

@ -16,6 +16,10 @@ while($device = mysql_fetch_array($device_query)) {
$graph_type = "dev_temp"; include ("includes/print-device-graph.php");
echo("<br />");
}
include("blocks/netstats.inc.php");
include("blocks/uptime.inc.php");
break;
@ -26,6 +30,26 @@ while($device = mysql_fetch_array($device_query)) {
$graph_type = "fortigate_memory"; include ("includes/print-device-graph.php");
echo("<div class=graphhead>Firewall Sessions</div>");
$graph_type = "fortigate_sessions"; include ("includes/print-device-graph.php");
include("blocks/netstats.inc.php");
include("blocks/uptime.inc.php");
break;
case "BCM96348":
echo("<div class=graphhead>ADSL Attainable Rate</div>");
$graph_type = "adsl_rate"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>ADSL Signal-to-Noise Margin</div>");
$graph_type = "adsl_snr"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>ADSL Attenuation</div>");
$graph_type = "adsl_atn"; include ("includes/print-device-graph.php");
echo("<br />");
include("blocks/netstats.inc.php");
include("blocks/uptime.inc.php");
break;
case "ScreenOS":
@ -35,6 +59,11 @@ while($device = mysql_fetch_array($device_query)) {
$graph_type = "netscreen_memory"; include ("includes/print-device-graph.php");
echo("<div class=graphhead>Firewall Sessions</div>");
$graph_type = "netscreen_sessions"; include ("includes/print-device-graph.php");
include("blocks/netstats.inc.php");
include("blocks/uptime.inc.php");
break;
case "ProCurve":
@ -99,18 +128,10 @@ while($device = mysql_fetch_array($device_query)) {
$graph_type = "dev_temp"; include ("includes/print-device-graph.php");
echo("<br />");
}
echo("<div class=graphhead>IP Statistics</div>");
$graph_type = "ip_graph"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>TCP Statistics</div>");
$graph_type = "tcp_graph"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>UDP Statistics</div>");
$graph_type = "udp_graph"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>ICMP Statistics</div>");
$graph_type = "icmp_graph"; include ("includes/print-device-graph.php");
echo("<br />");
include("blocks/netstats.inc.php");
include("blocks/uptime.inc.php");
echo("<div class=graphhead>System Load</div>");
$graph_type = "load"; include ("includes/print-device-graph.php");
echo("<br />");
@ -141,9 +162,6 @@ while($device = mysql_fetch_array($device_query)) {
$graph_type = "apachebits"; include ("includes/print-device-graph.php");
echo("<br />");
}
echo("<div class=graphhead>Device Uptime</div>");
$graph_type = "uptime"; include ("includes/print-device-graph.php");
echo("<br />");
break;
case "IOS":
echo("<div class=graphhead>CPU Usage</div>");
@ -157,21 +175,10 @@ while($device = mysql_fetch_array($device_query)) {
$graph_type = "dev_temp"; include ("includes/print-device-graph.php");
echo("<br />");
}
echo("<div class=graphhead>IP Statistics</div>");
$graph_type = "ip_graph"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>TCP Statistics</div>");
$graph_type = "tcp_graph"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>UDP Statistics</div>");
$graph_type = "udp_graph"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>ICMP Statistics</div>");
$graph_type = "icmp_graph"; include ("includes/print-device-graph.php");
echo("<br />");
echo("<div class=graphhead>Uptime</div>");
$graph_type = "uptime"; include ("includes/print-device-graph.php");
break;
include("blocks/netstats.inc.php");
include("blocks/uptime.inc.php");
case "Snom":
echo("<div class=graphhead>Calls</div>");
$graph_type = "calls"; include ("includes/print-device-graph.php");

View File

@ -331,6 +331,69 @@ function graph_cpu_generic_single ($rrd, $graph , $from, $to, $width, $height) {
}
function graph_adsl_rate ($rrd, $graph, $from, $to, $width, $height) {
global $config, $installdir;
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = "graphs/" . "$graph";
$options = "--alt-autoscale-max -l 0 -E --start $from --end $to --width $width --height $height ";
if($width <= "300") {$options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:adslAtucCurrAtt=$database:adslAtucCurrAtt:AVERAGE";
$options .= " DEF:adslAturCurrAtt=$database:adslAturCurrAtt:AVERAGE";
$options .= " CDEF:dslAtucCurrAtt=adslAtucCurrAtt,1000,/";
$options .= " CDEF:dslAturCurrAtt=adslAturCurrAtt,1000,/";
$options .= " COMMENT:Bytes\ \ \ \ \ Current\ \ Minimum\ \ Maximum\ \ Average\\\\n";
$options .= " LINE1.25:adslAtucCurrAtt#aa2200:Up\ \ \ \ ";
$options .= " GPRINT:dslAtucCurrAtt:LAST:%5.0lfk\ GPRINT:dslAtucCurrAtt:AVERAGE:%5.0lfk\ ";
$options .= " GPRINT:dslAtucCurrAtt:MAX:%5.0lfk\ GPRINT:dslAtucCurrAtt:AVERAGE:%5.0lfk\\\\n";
$options .= " LINE1.25:adslAturCurrAtt#22aa00:Down\ \ ";
$options .= " GPRINT:dslAturCurrAtt:LAST:%5.0lfk\ GPRINT:dslAturCurrAtt:AVERAGE:%5.0lfk\ ";
$options .= " GPRINT:dslAturCurrAtt:MAX:%5.0lfk\ GPRINT:dslAturCurrAtt:AVERAGE:%5.0lfk\\\\n";
$thing = shell_exec($config['rrdtool'] . " graph $imgfile $options");
return $imgfile;
}
function graph_adsl_snr ($rrd, $graph, $from, $to, $width, $height) {
global $config, $installdir;
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = "graphs/" . "$graph";
$options = "--alt-autoscale-max -l 0 -E --start $from --end $to --width $width --height $height ";
if($width <= "300") {$options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:adslAtucCurrSnr=$database:adslAtucCurrSnr:AVERAGE";
$options .= " DEF:adslAturCurrSnr=$database:adslAturCurrSnr:AVERAGE";
$options .= " CDEF:dslAtucCurrSnr=adslAtucCurrSnr,10,/";
$options .= " CDEF:dslAturCurrSnr=adslAturCurrSnr,10,/";
$options .= " COMMENT:\ \ \ \ \ \ \ \ \ \ Current\ \ Minimum\ \ Maximum\ \ Average\\\\n";
$options .= " LINE1.25:dslAtucCurrSnr#aa2200:SNR\ Up\ \ ";
$options .= " GPRINT:dslAtucCurrSnr:LAST:%3.1lfdB GPRINT:dslAtucCurrSnr:AVERAGE:%3.1lfdB\ ";
$options .= " GPRINT:dslAtucCurrSnr:MAX:%3.1lfdB GPRINT:dslAtucCurrSnr:AVERAGE:%3.1lfdB\\\\n";
$options .= " LINE1.25:dslAturCurrSnr#22aa00:SNR\ Down";
$options .= " GPRINT:dslAturCurrSnr:LAST:%3.1lfdB GPRINT:dslAturCurrSnr:AVERAGE:%3.1lfdB\ ";
$options .= " GPRINT:dslAturCurrSnr:MAX:%3.1lfdB GPRINT:dslAturCurrSnr:AVERAGE:%3.1lfdB\\\\n";
$thing = shell_exec($config['rrdtool'] . " graph $imgfile $options");
return $imgfile;
}
function graph_adsl_atn ($rrd, $graph, $from, $to, $width, $height) {
global $config, $installdir;
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = "graphs/" . "$graph";
$options = "--alt-autoscale-max -l 0 -E --start $from --end $to --width $width --height $height ";
if($width <= "300") {$options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:adslAtucCurrAtn=$database:adslAtucCurrAtn:AVERAGE";
$options .= " DEF:adslAturCurrAtn=$database:adslAturCurrAtn:AVERAGE";
$options .= " CDEF:dslAtucCurrAtn=adslAtucCurrAtn,10,/";
$options .= " CDEF:dslAturCurrAtn=adslAturCurrAtn,10,/";
$options .= " COMMENT:\ \ \ \ \ \ \ \ \ \ Current\ \ Minimum\ \ Maximum\ \ Average\\\\n";
$options .= " LINE1.25:dslAtucCurrAtn#aa2200:Atten\ Up\ \ ";
$options .= " GPRINT:dslAtucCurrAtn:LAST:%3.1lfdB GPRINT:dslAtucCurrAtn:AVERAGE:%3.1lfdb";
$options .= " GPRINT:dslAtucCurrAtn:MAX:%3.1lfdB GPRINT:dslAtucCurrAtn:AVERAGE:%3.1lfdb\\\\n";
$options .= " LINE1.25:dslAturCurrAtn#22aa00:Atten\ Down";
$options .= " GPRINT:dslAturCurrAtn:LAST:%3.1lfdB GPRINT:dslAturCurrAtn:AVERAGE:%3.1lfdb";
$options .= " GPRINT:dslAturCurrAtn:MAX:%3.1lfdB GPRINT:dslAturCurrAtn:AVERAGE:%3.1lfdb\\\\n";
$thing = shell_exec($config['rrdtool'] . " graph $imgfile $options");
return $imgfile;
}
function cpugraph ($rrd, $graph , $from, $to, $width, $height) {
global $config, $installdir;
$database = $config['rrd_dir'] . "/" . $rrd;

View File

@ -30,7 +30,7 @@ function graph_netscreen_cpu ($rrd, $graph, $from, $to, $width, $height, $title,
$options .= " DEF:av=$database:average:AVERAGE";
$options .= " DEF:5m=$database:5min:AVERAGE";
$options .= " COMMENT:Usage\ \ \ \ \ \ \ Current\ \ \ \ \ Average\ \ \ \ Maximum\\\\n";
$options .= " AREA:5m#ffcccc";
$options .= " AREA:5m#ffeeaa";
$options .= " LINE1.25:5m#aa2000:5min";
$options .= " GPRINT:5m:LAST:\ \ \ \ \ %5.2lf%%";
$options .= " GPRINT:5m:AVERAGE:\ \ \ %5.2lf%%";

View File

@ -179,6 +179,9 @@ while ($device = mysql_fetch_array($device_query)) {
}
include("includes/polling/device-procurve.inc.php");
break;
case "BCM96348":
include("includes/polling/adslline.inc.php");
break;
case "Snom":
include("includes/polling/device-snom.inc.php");
break;