From 072cd9978e0276d584e0c36384b6721eeaf3a993 Mon Sep 17 00:00:00 2001 From: ms Date: Sun, 4 Jun 2006 22:29:23 +0000 Subject: [PATCH] =?utf8?q?Hinzugef=C3=BCgt:=20=20=20*=20Link=20Quality=20G?= =?utf8?q?raphs=20Ge=C3=A4ndert:=20=20=20*=20index.cgi=20nochmals=20bearbe?= =?utf8?q?itet.=20=20=20*=20Benedikt=20is=20jetzt=20ganz=20aus=20den=20Cre?= =?utf8?q?dits=20raus...=20Bekommt=20dann=20wohl=20ne=20Extra-Sonderseite?= =?utf8?q?=20mit=20Bild=20und=20so^^=20=20=20*=20OpenVPN=20in=20ISO=20gepa?= =?utf8?q?ckt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@157 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- html/cgi-bin/credits.cgi | 4 -- html/cgi-bin/graphs.cgi | 7 ++- html/cgi-bin/index.cgi | 105 ++++++++++++++++------------------- langs/de/cgi-bin/de.pl | 1 + langs/en/cgi-bin/en.pl | 1 + src/ROOTFILES.i386 | 28 +++++++++- src/misc-progs/openvpnctrl.c | 2 +- src/scripts/makegraphs | 81 ++++++++++++++++++++++++++- 8 files changed, 161 insertions(+), 68 deletions(-) diff --git a/html/cgi-bin/credits.cgi b/html/cgi-bin/credits.cgi index ac0d1436a1..895a870d20 100644 --- a/html/cgi-bin/credits.cgi +++ b/html/cgi-bin/credits.cgi @@ -38,10 +38,6 @@ Projektmitglied & Sponsor - Detlef Lampart (info\@delaco.de)
Projektmitglied & Supporter - Silvio Rechenbach (sr\@tne.de)
- Sponsor - Karsten Rechenbach (email\@fehlt.com)
Betatester - Sebastian Winter diff --git a/html/cgi-bin/graphs.cgi b/html/cgi-bin/graphs.cgi index 59ba89195f..f19e5a618e 100644 --- a/html/cgi-bin/graphs.cgi +++ b/html/cgi-bin/graphs.cgi @@ -35,14 +35,14 @@ $ENV{'QUERY_STRING'} =~ s/&//g; @cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'}); $cgigraphs[1] = '' unless defined $cgigraphs[1]; -if ($cgigraphs[1] =~ /(network|GREEN|BLUE|ORANGE|RED)/) { +if ($cgigraphs[1] =~ /(network|GREEN|BLUE|ORANGE|RED|lq)/) { &Header::openpage($Lang::tr{'network traffic graphs'}, 1, ''); } else { &Header::openpage($Lang::tr{'system graphs'}, 1, ''); } &Header::openbigbox('100%', 'left'); -if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED|cpu|memory|swap|disk)/) { +if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED|lq|cpu|memory|swap|disk)/) { my $graph = $cgigraphs[1]; my $graphname = ucfirst(lc($cgigraphs[1])); &Header::openbox('100%', 'center', "$graphname $Lang::tr{'graph'}"); @@ -60,7 +60,7 @@ if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED|cpu|memory|swap|disk)/) { } &Header::closebox(); print "
"; - if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED)/) { + if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED|lq)/) { print ""; } else { print ""; @@ -74,6 +74,7 @@ if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED|cpu|memory|swap|disk)/) { if ($netsettings{'ORANGE_DEV'}) { push (@graphs, ('ORANGE')); } push (@graphs, ("RED")); + push (@graphs, ('lq')); foreach my $graphname (@graphs) { &Header::openbox('100%', 'center', "$graphname $Lang::tr{'graph'}"); diff --git a/html/cgi-bin/index.cgi b/html/cgi-bin/index.cgi index 5f6ac8bb4c..7bcf445224 100644 --- a/html/cgi-bin/index.cgi +++ b/html/cgi-bin/index.cgi @@ -141,39 +141,58 @@ END print "$Lang::tr{'profile has errors'}\n \n"; } -print < -
- $Lang::tr{'lan'}: - $netsettings{'GREEN_ADDRESS'} - + if ( $netsettings{'GREEN_DEV'} ) { print <$Lang::tr{'lan'}: + $netsettings{'GREEN_ADDRESS'} + END - if (`ifconfig | grep $netsettings{'GREEN_DEV'}`) { print "Online"; } else { print "Offline"; } -print < -
$Lang::tr{'wireless'}:
-
$netsettings{'BLUE_ADDRESS'} - + if ( `cat /var/ipfire/proxy/advanced/settings | grep ^ENABLE=on` ) { + print "Proxy an"; + if ( `cat /var/ipfire/proxy/advanced/settings | grep ^TRANSPARENT=on` ) { print " (transparent)"; } + } else { print "Proxy aus"; } + } + if ( $netsettings{'BLUE_DEV'} ) { print <$Lang::tr{'wireless'}:
+
$netsettings{'BLUE_ADDRESS'} + END - if (`ifconfig | grep $netsettings{'BLUE_DEV'}`) { print "Online"; } else { print "Offline"; } -print <$Lang::tr{'dmz'}:
-
$netsettings{'ORANGE_ADDRESS'} - + if ( `cat /var/ipfire/proxy/advanced/settings | grep ^ENABLE_BLUE=on` ) { + print "Proxy an"; + if ( `cat /var/ipfire/proxy/advanced/settings | grep ^TRANSPARENT_BLUE=on` ) { print " (transparent)"; } + } else { print "Proxy aus"; } + } + if (`ifconfig | grep $netsettings{'ORANGE_DEV'}`) { print <$Lang::tr{'dmz'}:
+
$netsettings{'ORANGE_ADDRESS'} + Online END - if (`ifconfig | grep $netsettings{'ORANGE_DEV'}`) { print "Online"; } else { print "Offline"; } -print <$Lang::tr{'vpn'}:
-
N/A - + } + if ( `cat /var/ipfire/vpn/settings | grep ^ENABLED=on` ) { + my $ipsecip = `cat /var/ipfire/vpn/settings | grep ^VPN_IP= | cut -c 8-`; + print <$Lang::tr{'vpn'}:
+
$ipsecip + Online END - if (`ifconfig | grep ipsec0`) { print "Online"; } else { print "Offline"; } -print <OpenVPN:
-
N/A - + } + if ( `cat /var/ipfire/ovpn/settings | grep ^ENABLED=on` || + `cat /var/ipfire/ovpn/settings | grep ^ENABLED_BLUE=on` || + `cat /var/ipfire/ovpn/settings | grep ^ENABLED_ORANGE=on`) { + my $ovpnip = `cat /var/ipfire/ovpn/settings | grep ^DOVPN_SUBNET= | cut -c 14- | sed -e 's\/\\/255.255.255.0\/\/'`; + print <OpenVPN:
+
$ovpnip + Online +END + } + if ( $netsettings{'DNS1'} ) { print <DNS-Server: $netsettings{'DNS1'} END - if (`ifconfig | grep tun0`) { print "Online"; } else { print "Offline"; } + } + if ( $netsettings{'DNS2'} ) { print <$netsettings{'DNS2'} +END + } print < END @@ -215,38 +234,10 @@ foreach my $line (@df) { } } -# Patches warning -open(AV, "<${General::swroot}/patches/available") or die "Could not open available patches database ($!)"; -my @av = ; -close(AV); -open(PF, "<${General::swroot}/patches/installed") or die "Could not open installed patches file. ($!)
"; -while() -{ - next if $_ =~ m/^#/; - @temp = split(/\|/,$_); - @av = grep(!/^$temp[0]/, @av); -} -close(PF); - -if ($#av != -1) -{ - $warnmessage .= "
  • $Lang::tr{'there are updates'}
  • "; -} -my $age = &General::age("/${General::swroot}/patches/available"); -if ($age =~ m/(\d{1,3})d/) { - if ($1 >= 7) { - $warnmessage .= "
  • $Lang::tr{'updates is old1'} $age $Lang::tr{'updates is old2'}
  • \n"; - } -} - if ($warnmessage) { - print "
      $warnmessage
    "; + print "
    $warnmessage
    "; } -print "

    "; -system('/usr/bin/uptime'); -print "

    \n"; - &Header::closebox(); &Header::closebigbox(); diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 07df2d9e8f..c0738a7489 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1265,6 +1265,7 @@ 'advproxy chgwebpwd ERROR' => 'F E H L E R :', 'advproxy update notification' => 'Update-Benachrichtigung!', 'advproxy update information' => 'Eine aktualisierte Version steht zum Download bereit. Besuchen Sie http://www.advproxy.net für weitere Informationen.', +'linkq' => 'Verbindungsqualität', ); diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index bc8befa317..14f654008a 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1298,5 +1298,6 @@ 'advproxy chgwebpwd ERROR' => 'E R R O R :', 'advproxy update notification' => 'Update notification!', 'advproxy update information' => 'There is an updated version available for download. Visit http://www.advproxy.net for more information.', +'linkq' => 'Link Quality', ); diff --git a/src/ROOTFILES.i386 b/src/ROOTFILES.i386 index 7dceacf883..1ddae00ff1 100644 --- a/src/ROOTFILES.i386 +++ b/src/ROOTFILES.i386 @@ -26959,4 +26959,30 @@ etc/l7-protocols/protocols/zmaap.pat #etc/l7-protocols/testing/regexp/regsub.c #etc/l7-protocols/testing/test_match.sh #etc/l7-protocols/testing/test_speed.c -#etc/l7-protocols/testing/timeit.sh \ No newline at end of file +#etc/l7-protocols/testing/timeit.sh +## +## openvpn-2.0.7 +## +usr/sbin/openvpn +## +## lzo-2.02 +## +usr/include/lzo +usr/include/lzo/lzo1.h +usr/include/lzo/lzo1a.h +usr/include/lzo/lzo1b.h +usr/include/lzo/lzo1c.h +usr/include/lzo/lzo1f.h +usr/include/lzo/lzo1x.h +usr/include/lzo/lzo1y.h +usr/include/lzo/lzo1z.h +usr/include/lzo/lzo2a.h +usr/include/lzo/lzo_asm.h +usr/include/lzo/lzoconf.h +usr/include/lzo/lzodefs.h +usr/include/lzo/lzoutil.h +usr/lib/liblzo2.a +usr/lib/liblzo2.la +usr/lib/liblzo2.so +usr/lib/liblzo2.so.2 +usr/lib/liblzo2.so.2.0.0 \ No newline at end of file diff --git a/src/misc-progs/openvpnctrl.c b/src/misc-progs/openvpnctrl.c index ab3242c413..96bc8d7802 100644 --- a/src/misc-progs/openvpnctrl.c +++ b/src/misc-progs/openvpnctrl.c @@ -372,7 +372,7 @@ void startDaemon(void) { fprintf(stderr, "OpenVPN is not enabled on any interface\n"); exit(1); } else { - snprintf(command, STRING_SIZE-1, "/usr/bin/openvpn --config /var/ipfire/ovpn/server.conf"); + snprintf(command, STRING_SIZE-1, "/usr/sbin/openvpn --config /var/ipfire/ovpn/server.conf"); executeCommand(command); } } diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs index 0639f2ebad..42773338a8 100644 --- a/src/scripts/makegraphs +++ b/src/scripts/makegraphs @@ -395,7 +395,7 @@ sub updatefwhitsgraph { RRDs::graph ("$graphs/firewallhits-$interval-area.png", "--start", "-1$interval", "-aPNG", "-i", "-z", - "--alt-y-grid", "-w 500", "-h 200", + "--alt-y-grid", "-w 600", "-h 200", "--color", "SHADEA#EAE9EE", "--color", "SHADEB#EAE9EE", "--color", "BACK#EAE9EE", @@ -415,7 +415,7 @@ sub updatefwhitsgraph { RRDs::graph ("$graphs/firewallhits-$interval-line.png", "--start", "-1$interval", "-aPNG", "-i", "-z", - "--alt-y-grid", "-w 500", "-h 200", + "--alt-y-grid", "-w 600", "-h 200", "--color", "SHADEA#EAE9EE", "--color", "SHADEB#EAE9EE", "--color", "BACK#EAE9EE", @@ -506,6 +506,73 @@ sub updatefwhitsdata { print "Error in RRD::update for Firewallhits: $ERROR\n" if $ERROR; } +# Creates and updates a link quality database +# ------------------------------------------- +sub updatelq { + if ( ! -e "$rrdlog/lq.rrd") { + RRDs::create ("$rrdlog/lq.rrd", "--step=300", + "DS:loss:GAUGE:600:0:100", + "DS:roundtrip:GAUGE:600:0:10000", + "RRA:AVERAGE:0.5:1:576", + "RRA:AVERAGE:0.5:6:672", + "RRA:AVERAGE:0.5:24:732", + "RRA:AVERAGE:0.5:144:1460"); + $ERROR = RRDs::error; + print "Error in RRD::create for link: $ERROR\n" if $ERROR; + } + my $packetloss=0; + my $roundtrip=0; + my $test=0; +# LQ_GATEWAY is the ip of your isp's public ip facing you + my $LQ_GATEWAY=`netstat -r | grep ^default | awk '{print \$2}'`; + my $NUMPINGS=10; + my $pingoutput = `ping -c $NUMPINGS -q $LQ_GATEWAY`; + chomp; + my @temp = split (/\/|\%|\s/, $pingoutput); + $packetloss = $temp[17]; + $roundtrip = $temp[28]; + RRDs::update ("$rrdlog/lq.rrd", "N:$packetloss:$roundtrip"); + $ERROR = RRDs::error; + print "Error in RRD::update for line quality: $ERROR\n" if $ERROR; +} + +sub updatelqgraph { + my $period = $_[0]; + RRDs::graph ("$graphs/lq-$period.png", + "--start", "-1$period", "-aPNG", "-i", "-z", + "--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r", + "-t $tr{'linkq'} ($tr{'graph per'} $tr{$period})", + "--lazy", + "--color", "SHADEA#EAE9EE", + "--color", "SHADEB#EAE9EE", + "--color", "BACK#EAE9EE", + "-v ms / pkts (% x10)", + "DEF:roundtrip=$rrdlog/lq.rrd:roundtrip:AVERAGE", + "DEF:loss=$rrdlog/lq.rrd:loss:AVERAGE", + "CDEF:roundavg=roundtrip,PREV(roundtrip),+,2,/", + "CDEF:loss10=loss,10,*", + "CDEF:r0=roundtrip,30,MIN", + "CDEF:r1=roundtrip,70,MIN", + "CDEF:r2=roundtrip,150,MIN", + "CDEF:r3=roundtrip,300,MIN", + "AREA:roundtrip#EE7000:>300 ms", + "AREA:r3#D88E1B:150-300 ms", + "AREA:r2#B9B63F:70-150 ms", + "AREA:r1#99E064:30-70 ms", + "AREA:r0#80FF80:<30 ms", + "AREA:loss10#800000:Packet loss (x10)", + "LINE1:roundtrip#707070:", + "GPRINT:roundtrip:MAX:$tr{'maximal'} $tr{'linkq'}\\:%3.2lf ms", + "GPRINT:roundtrip:AVERAGE:$tr{'average'} $tr{'linkq'}\\:%3.2lf ms", + "GPRINT:roundtrip:LAST:$tr{'current'} $tr{'linkq'}\\:%3.2lf ms\\j", + "GPRINT:loss:MAX:$tr{'maximal'} Loss\\:%3.2lf%%", + "GPRINT:loss:AVERAGE:$tr{'average'} Loss\\:%3.2lf%%", + "GPRINT:loss:LAST:$tr{'current'} Loss\\:%3.2lf%%\\j" + ); + $ERROR = RRDs::error; + print "Error in RRD::graph for Link Quality: $ERROR\n" if $ERROR; +} + ## Update ipac logs system ('/usr/sbin/fetchipac'); sleep 8; @@ -569,6 +636,16 @@ updatefwhitsgraph ("week"); updatefwhitsgraph ("month"); updatefwhitsgraph ("year"); +### +### Link Quality +### +updatelq(); +sleep 2; +updatelqgraph("day"); +updatelqgraph("week"); +updatelqgraph("month"); +updatelqgraph("year"); + ### ### Network Graphs ### -- 2.39.2