]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Fix external network graphs if traffic not goes over red0
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 22 May 2008 20:13:36 +0000 (22:13 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 22 May 2008 20:13:36 +0000 (22:13 +0200)
config/collectd/collectd.conf
html/cgi-bin/graphs.cgi
html/cgi-bin/network.cgi

index 8a9242f6dec465811377424edea751921aea67c4..01b8a11ecbb79ba9f5fddb7d7558a60ecbb7a707 100644 (file)
@@ -27,7 +27,6 @@ LoadPlugin swap
 LoadPlugin syslog
 
 <Plugin interface>
-       Interface "ppp0"
        Interface "lo"
        Interface "ipsec1"
        Interface "ipsec2"
index 1ecc9c62c1c5afabcf0ebc753b93247c1034f5d7..f5af967304c549541bef798e20432e95e487e07a 100644 (file)
@@ -61,9 +61,9 @@ if ($cgigraphs[1] =~ /disk/){
                  &Graphs::updatediskgraph ("year",$device);}}
 if ($cgigraphs[1] =~ /lq/) {&Graphs::updatelqgraph("hour");&Graphs::updatelqgraph("week");&Graphs::updatelqgraph("month");&Graphs::updatelqgraph("year");}
 if ($cgigraphs[1] =~ /fwhits/) {&Graphs::updatefwhitsgraph("hour");&Graphs::updatefwhitsgraph("week");&Graphs::updatefwhitsgraph("month");&Graphs::updatefwhitsgraph("year");}
-if ($cgigraphs[1] =~ /green/ || $cgigraphs[1] =~ /blue/ || $cgigraphs[1] =~ /ipsec/ || $cgigraphs[1] =~ /orange/ || $cgigraphs[1] =~ /red/ ) {&Graphs::updateifgraph($cgigraphs[1], "hour");&Graphs::updateifgraph($cgigraphs[1], "week");&Graphs::updateifgraph($cgigraphs[1], "month");&Graphs::updateifgraph($cgigraphs[1], "year");}
+if ($cgigraphs[1] =~ /green/ || $cgigraphs[1] =~ /blue/ || $cgigraphs[1] =~ /ipsec/ || $cgigraphs[1] =~ /orange/ || $cgigraphs[1] =~ /ppp/ || $cgigraphs[1] =~ /red/ ) {&Graphs::updateifgraph($cgigraphs[1], "hour");&Graphs::updateifgraph($cgigraphs[1], "week");&Graphs::updateifgraph($cgigraphs[1], "month");&Graphs::updateifgraph($cgigraphs[1], "year");}
 
-if ($cgigraphs[1] =~ /(network|green|blue|orange|red|ipsec|lq)/) {
+if ($cgigraphs[1] =~ /(network|green|blue|orange|red|ppp|ipsec|lq)/) {
        &Header::openpage($Lang::tr{'network traffic graphs'}, 1, '');
 } else {
        &Header::openpage($Lang::tr{'system graphs'}, 1, '');
@@ -71,7 +71,7 @@ if ($cgigraphs[1] =~ /(network|green|blue|orange|red|ipsec|lq)/) {
 
 &Header::openbigbox('100%', 'left');
 
-if ($cgigraphs[1] =~ /(green|blue|orange|red|ipsec|lq|cpu|memory|swap|disk|load|fwhits|processes)/) {
+if ($cgigraphs[1] =~ /(green|blue|orange|red|ppp|ipsec|lq|cpu|memory|swap|disk|load|fwhits|processes)/) {
        my $graph = $cgigraphs[1];
        my $graphname = ucfirst(lc($cgigraphs[1]));
        &Header::openbox('100%', 'center', "$graphname $Lang::tr{'graph'}");
@@ -120,7 +120,7 @@ if ( $cgigraphs[1] eq "cpu" || $cgigraphs[1] eq "load" ) { print "<a href='/cgi-
 elsif ( $cgigraphs[1] eq "memory" || $cgigraphs[1] eq "swap" ) { print "<a href='/cgi-bin/memory.cgi'>"; }
 elsif ( $cgigraphs[1] eq "processes" ) { print "<a href='/cgi-bin/services.cgi'>"; }
 elsif ( $cgigraphs[1] =~ /disk/ ) { print "<a href='/cgi-bin/media.cgi'>"; }
-elsif ( $cgigraphs[1] =~ /red/ || $cgigraphs[1] =~ /ipsec/ ) { print "<a href='/cgi-bin/network.cgi?network=red'>"; }
+elsif ( $cgigraphs[1] =~ /red/ || $cgigraphs[1] =~ /ppp/ || $cgigraphs[1] =~ /ipsec/ ) { print "<a href='/cgi-bin/network.cgi?network=red'>"; }
 elsif ( $cgigraphs[1] =~ /green/ || $cgigraphs[1] =~ /blue/ || $cgigraphs[1] =~ /orange/ ) { print "<a href='/cgi-bin/network.cgi?network=internal'>"; }
 elsif ( $cgigraphs[1] eq "fwhits" || $cgigraphs[1] eq "lq" ) { print "<a href='/cgi-bin/network.cgi?network=other'>"; }
 print "$Lang::tr{'back'}</a></td></tr></table></div>\n";
index 50f70a64f02f82d388ac47215b3813e0b7064ff8..a6145fa20de70fc7c229fc710fcb7669706e5e11 100644 (file)
@@ -50,7 +50,13 @@ $cgiparams[1] = '' unless defined $cgiparams[1];
 
 if ($cgiparams[1] =~ /red/) {
        &Header::openpage($Lang::tr{'network traffic graphs external'}, 1, '');
-       push (@graphs, ($netsettings{'RED_DEV'}));
+       if ($netsettings{'RED_TYPE'} ne 'PPPOE') {
+           if ($netsettings{'RED_DEV'} ne $netsettings{'GREEN_DEV'}) {
+               push (@graphs, ($netsettings{'RED_DEV'}));
+           }
+       } else {
+           push (@graphs, "ppp0");
+       }
        if (-e "/var/log/rrd/collectd/localhost/interface/if_octets-ipsec0.rrd") {push (@graphs, ("ipsec0"));}
 }elsif ($cgiparams[1] =~ /other/) {
        &Header::openpage($Lang::tr{'network traffic graphs others'}, 1, '');