diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php
index 948eb0317a..33db376c86 100755
--- a/usr/local/www/status_rrd_graph.php
+++ b/usr/local/www/status_rrd_graph.php
@@ -91,19 +91,25 @@ foreach ($graphs as $graph => $graphd) {
$interval) {
/* generate the graphs when we request the page. */
@@ -221,13 +237,10 @@ elseif(($curgraph == "queues") && (file_exists("$rrddbpath$curif$queues"))) {
$i = 0;
$t = 0;
$colors = array('000000','7B0000','990000','BB0000','CC0000','D90000','EE0000','FF0000','CC0000');
- /* compare bytes/sec counters */
- $downstream = (22000000/8);
- $upstream = (2000000/8);
foreach ($a_queues as $queue) {
$name = $queue['name'];
- if((stristr($name, "wan")) || (stristr($name, "up"))) {
- $color = $colors[$t];
+ if((stristr($name, "$upif")) || (stristr($name, "up"))) {
+ $color = "$colors[$t]";
if($t > 0) { $stack = ":STACK"; }
$graphcmd .= "DEF:$name=$rrddbpath$curif$queues:$name:AVERAGE \\
\"CDEF:$name-bytes_out=$name,0,$upstream,LIMIT,UN,0,$name,IF\" \\
@@ -235,6 +248,7 @@ elseif(($curgraph == "queues") && (file_exists("$rrddbpath$curif$queues"))) {
\"CDEF:$name-bits_out_neg=$name-bits_out,-1,*\" \\
AREA:$name-bits_out_neg#${color}:$name$stack \\";
$t++;
+ if($t > 7) { $t = 0; }
}
}
$graphcmd .= "COMMENT:\"\\n\" \\";
@@ -242,14 +256,15 @@ elseif(($curgraph == "queues") && (file_exists("$rrddbpath$curif$queues"))) {
$stack = "";
foreach ($a_queues as $queue) {
$name = $queue['name'];
- if((stristr($name, "lan")) || (stristr($name, "down"))) {
- $color = $colors[$i];
+ if((stristr($name, "$downif")) || (stristr($name, "down"))) {
+ $color = "$colors[$i]";
if($i > 0) { $stack = ":STACK"; }
$graphcmd .= "DEF:$name=$rrddbpath$curif$queues:$name:AVERAGE \\
\"CDEF:$name-bytes_in=$name,0,$downstream,LIMIT,UN,0,$name,IF\" \\
\"CDEF:$name-bits_in=$name-bytes_in,8,*\" \\
AREA:$name-bits_in#${color}:$name$stack \\";
$i++;
+ if($i > 7) { $i = 0; }
}
}
$graphcmd .= "COMMENT:\"\\n\" \\";