X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fqos.cgi;h=0dfac7898835b3fd8eac3121f4dcd48baf5b1b4b;hp=56047c8a76f10bdb4b43232133e47976c9f343a7;hb=268292e730717ad07349ea74e3b10ed3a3902102;hpb=d10e55d10447be9e0eaa5fb459f8589afdc375a4 diff --git a/html/cgi-bin/qos.cgi b/html/cgi-bin/qos.cgi index 56047c8a76..0dfac78988 100644 --- a/html/cgi-bin/qos.cgi +++ b/html/cgi-bin/qos.cgi @@ -488,76 +488,6 @@ elsif ($qossettings{'ACTION'} eq 'Statusinformationen') &Header::closepage(); exit } -elsif ($qossettings{'ACTION'} eq 'Grafische Auswertung') -{ - open( FILE, "< $classfile" ) or die "Unable to read $classfile"; - @classes = ; - close FILE; - open( FILE, "< $subclassfile" ) or die "Unable to read $subclassfile"; - @subclasses = ; - close FILE; - &Header::openbox('100%', 'left', 'QoS Graphen'); - print < Diese Seite braucht je nach Geschwindigkeit des Computers laenger zum Laden. - Klasse: -END -; - foreach $classentry (sort @classes) - { - @classline = split( /\;/, $classentry ); - $qossettings{'CLASS'}=$classline[1]; - print < -END -; - } - print < -END -; - &Header::closebox(); - foreach $classentry (sort @classes) - { - @classline = split( /\;/, $classentry ); - $qossettings{'DEV'}=$classline[0]; - $qossettings{'CLASS'}=$classline[1]; - &gengraph($qossettings{'DEV'},$qossettings{'CLASS'}); - print "\n"; - } -print < -END -; - &Header::closebigbox(); - &Header::closepage(); - exit -} elsif ($qossettings{'ACTION'} eq 'Parentklasse hinzufuegen') { &parentclass(); @@ -704,9 +634,8 @@ END
-
- -
+ + END ; @@ -728,20 +657,12 @@ if ( ($qossettings{'DEFCLASS_INC'} eq '') || ($qossettings{'DEFCLASS_OUT'} eq '' } &Header::openbox('100%', 'center', $Lang::tr{'info'}); -&overviewgraph($qossettings{'RED_DEV'}); -&overviewgraph($qossettings{'IMQ_DEV'}); print <  Unterklasse hinzufuegen |  Regel hinzufuegen |  Bearbeiten |  Loeschen   TOS-Bits:  0 - Deaktiviert | 8 - Minimale Verzoegerung | 4 - Maximaler Durchsatz | 2 - Maximale Zuverlaessigkeit | 1 - Minimale Kosten   END ; -if (( -e "/srv/web/ipfire/html/graphs/qos-graph-$qossettings{'RED_DEV'}.png") && ( -e "/srv/web/ipfire/html/graphs/qos-graph-$qossettings{'IMQ_DEV'}.png")) { - print < - -END -;} print "\t"; &Header::closebox(); @@ -1144,7 +1065,6 @@ sub showclasses { @classline = split( /\;/, $classentry ); if ( $classline[0] eq $qossettings{'DEV'} ) { - gengraph($qossettings{'DEV'},$classline[1]); &Header::openbox('100%', 'center', "Klasse: $classline[1]"); print < @@ -1348,10 +1268,6 @@ END } } } - - if ( -e "/srv/web/ipfire/html/graphs/class_$qossettings{'CLASSPRFX'}-$qossettings{'CLASS'}_$qossettings{'DEV'}-packets.png") { - print < END ; } @@ -1400,7 +1316,6 @@ END } } } -} sub expert { @@ -1500,86 +1415,3 @@ sub validsubclass { } } } - -sub gengraph { - $qossettings{'DEV'} = shift; - $qossettings{'CLASS'} = shift; - my $ERROR=""; - if ( $qossettings{'DEV'} eq $qossettings{'RED_DEV'} ) { - $qossettings{'CLASSPRFX'} = '1'; - } else { - $qossettings{'CLASSPRFX'} = '2'; - } - my $color=random_hex_color(6); - - RRDs::graph ("/srv/web/ipfire/html/graphs/class_$qossettings{'CLASSPRFX'}-$qossettings{'CLASS'}_$qossettings{'DEV'}-packets.png", - "--start", "-3240", "-aPNG", "-i", "-z", - "--alt-y-grid", "-w 600", "-h 150", "-r", - "--color", "SHADEA#EAE9EE", - "--color", "SHADEB#EAE9EE", - "--color", "BACK#FFFFFF", - "-t $qossettings{'CLASS'} ($qossettings{'DEV'})", - "DEF:pkts=/var/log/rrd/class_$qossettings{'CLASSPRFX'}-$qossettings{'CLASS'}_$qossettings{'DEV'}.rrd:pkts:AVERAGE", - "DEF:dropped=/var/log/rrd/class_$qossettings{'CLASSPRFX'}-$qossettings{'CLASS'}_$qossettings{'DEV'}.rrd:dropped:AVERAGE", - "DEF:overlimits=/var/log/rrd/class_$qossettings{'CLASSPRFX'}-$qossettings{'CLASS'}_$qossettings{'DEV'}.rrd:overlimits:AVERAGE", - "AREA:pkts$color:packets", - "GPRINT:pkts:LAST:total packets\\:%8.3lf %s packets\\j", - "LINE3:dropped#FF0000:dropped", - "GPRINT:dropped:LAST:dropped packets\\:%8.3lf %s packets\\j", - "LINE3:overlimits#0000FF:overlimits", - "GPRINT:overlimits:LAST:overlimits\\:%8.3lf %s packets\\j", - ); - $ERROR = RRDs::error; - #print "$ERROR"; -} - -sub overviewgraph { - $qossettings{'DEV'} = shift; - if ( $qossettings{'DEV'} eq $qossettings{'RED_DEV'} ) { - $qossettings{'CLASSPRFX'} = '1'; - } else { - $qossettings{'CLASSPRFX'} = '2'; - } - my $ERROR=""; - my $count="1"; - my $color="#000000"; - my @command=("/srv/web/ipfire/html/graphs/qos-graph-$qossettings{'DEV'}.png", - "--start", "-3240", "-aPNG", "-i", "-z", - "--alt-y-grid", "-w 600", "-h 150", "-r", - "--color", "SHADEA#EAE9EE", - "--color", "SHADEB#EAE9EE", - "--color", "BACK#FFFFFF", - "-t Auslastung auf ($qossettings{'DEV'})" - ); - open( FILE, "< $classfile" ) or die "Unable to read $classfile"; - @classes = ; - close FILE; - foreach $classentry (sort @classes) - { - @classline = split( /\;/, $classentry ); - if ( $classline[0] eq $qossettings{'DEV'} ) - { - $color=random_hex_color(6); - push(@command, "DEF:$classline[1]=/var/log/rrd/class_$qossettings{'CLASSPRFX'}-$classline[1]_$qossettings{'DEV'}.rrd:bits:AVERAGE"); - - if ($count eq "1") { - push(@command, "AREA:$classline[1]$color:Klasse $classline[1] - $classline[8]\\j"); - } else { - push(@command, "STACK:$classline[1]$color:Klasse $classline[1] - $classline[8]\\j"); - } - $count++; - } - } - RRDs::graph (@command); - $ERROR = RRDs::error; - #print "$ERROR"; -} - -sub random_hex_color { - my $size = shift; - $size = 6 if $size !~ /^3|6$/; - my @hex = ( 0 .. 9, 'a' .. 'f' ); - my @color; - push @color, @hex[rand(@hex)] for 1 .. $size; - return join('', '#', @color); -}