summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_rrd_graph_img.php
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-02-23 02:22:30 +0000
committerErmal Luçi <eri@pfsense.org>2008-02-23 02:22:30 +0000
commit21a0464c1a66792acd91e852c47d7838c49df303 (patch)
treed8d106d0dab053c921ab41a2a142faff0202648e /usr/local/www/status_rrd_graph_img.php
parent8e2a7e8a28d893c287afc69538e7fdb30002ba86 (diff)
downloadpfsense-21a0464c1a66792acd91e852c47d7838c49df303.zip
pfsense-21a0464c1a66792acd91e852c47d7838c49df303.tar.gz
* Unbreak rrd graphs for queues and make them multiinterface aware
* Add a new tab for queuedrops with multiinterface there is no way to have them in the same tab * Remove $GLOBAL where used and use proper accessor functions * Remove Manuel from copyright this file has been rewritten * Some bugs fixes in general
Diffstat (limited to 'usr/local/www/status_rrd_graph_img.php')
-rw-r--r--usr/local/www/status_rrd_graph_img.php26
1 files changed, 9 insertions, 17 deletions
diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php
index 71c9a1d..77b9c1c 100644
--- a/usr/local/www/status_rrd_graph_img.php
+++ b/usr/local/www/status_rrd_graph_img.php
@@ -106,7 +106,7 @@ rsort($databases);
/* compare bytes/sec counters, divide bps by 8 */
read_altq_config();
-if (is_array($altq_list_queues[$curif])) {
+if ($altq_list_queues[$curif]) {
$altq =& $altq_list_queues[$curif];
switch ($altq->GetBwscale()) {
case "Gb":
@@ -128,7 +128,7 @@ if (is_array($altq_list_queues[$curif])) {
$upif = $curif;
$downif = "lan"; /* XXX should this be set to something else?! */
} else {
- $altq = array();
+ $altq = null;
$downstream = 12500000;
$upstream = 12500000;
$upif = "wan";
@@ -503,17 +503,13 @@ elseif((strstr($curdatabase, "-queues.rrd")) && (file_exists("$rrddbpath$curdata
--color SHADEA#eeeeee --color SHADEB#eeeeee \\
--title \"`hostname` - $prettydb - $hperiod - $havg average\" \\
--height 200 --width 620 -x \"$scale\" \\";
- if (!is_array($config['shaper']['queue'])) {
- $config['shaper']['queue'] = array();
- }
- if (count($altq) > 0)
- $a_queue =& $altq->get_queue_list($notused);
+ if ($altq)
+ $a_queues =& $altq->get_queue_list();
else
$a_queues = array();
$i = 0;
$t = 0;
- foreach ($a_queues as $queue) {
- $name = $queue->GetQname();
+ foreach ($a_queues as $name => $q) {
$color = "$colorqueuesup[$t]";
if($t > 0) { $stack = ":STACK"; }
$graphcmd .= "DEF:$name=$rrddbpath$curdatabase:$name:AVERAGE \\
@@ -527,7 +523,7 @@ elseif((strstr($curdatabase, "-queues.rrd")) && (file_exists("$rrddbpath$curdata
$graphcmd .= "COMMENT:\"\\n\" \\";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\"";
}
-elseif((strstr($curdatabase, "-queuesdrop.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
+elseif((strstr($curdatabase, "-queuedrops.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
/* define graphcmd for queuedrop stats */
$graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$interval.png \\
--start -$seconds -e -$average \\
@@ -535,17 +531,13 @@ elseif((strstr($curdatabase, "-queuesdrop.rrd")) && (file_exists("$rrddbpath$cur
--color SHADEA#eeeeee --color SHADEB#eeeeee \\
--title \"`hostname` - $prettydb - $hperiod - $havg average\" \\
--height 200 --width 620 -x \"$scale\" \\";
- if (!is_array($config['shaper']['queue'])) {
- $config['shaper']['queue'] = array();
- }
- if (count($altq) > 0)
- $a_queue =& $altq->get_queue_list($notused);
+ if ($altq)
+ $a_queues =& $altq->get_queue_list();
else
$a_queues = array();
$i = 0;
$t = 0;
- foreach ($a_queues as $queue) {
- $name = $queue->GetQname();
+ foreach ($a_queues as $name => $q) {
$color = "$colorqueuesdropup[$t]";
if($t > 0) { $stack = ":STACK"; }
$graphcmd .= "DEF:$name=$rrddbpath$curdatabase:$name:AVERAGE \\
OpenPOWER on IntegriCloud