Hinzugefügt:

* Link Quality Graphs
Geändert:
  * index.cgi nochmals bearbeitet.
  * Benedikt is jetzt ganz aus den Credits raus... Bekommt dann wohl ne Extra-Sonderseite mit Bild und so^^
  * OpenVPN in ISO gepackt.


git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@157 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2006-06-04 22:29:23 +00:00
parent ff7df9d4b8
commit 072cd9978e
8 changed files with 161 additions and 68 deletions

View File

@@ -38,10 +38,6 @@ Projektmitglied & Sponsor - Detlef Lampart
(<a href='mailto:info\@delaco.de'>info\@delaco.de</a>)<br />
Projektmitglied &amp; Supporter - Silvio Rechenbach
(<a href='mailto:sr\@tne.de'>sr\@tne.de</a>)<br />
<!--
Webinterfacedesign &amp; Inspiration - Benedikt Correll
(<a href='mailto:benedikt_correll\@hotmail.com'>benedikt_correll\@hotmail.com</a>)<br />
-->
Sponsor - Karsten Rechenbach
(<a href='mailto:email\@fehlt.com'>email\@fehlt.com</a>)<br />
Betatester - Sebastian Winter

View File

@@ -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 "<div align='center'><table width='80%'><tr><td align='center'>";
if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED)/) {
if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED|lq)/) {
print "<a href='/cgi-bin/graphs.cgi?graph=network'>";
} else {
print "<a href='/cgi-bin/graphs.cgi'>";
@@ -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'}");

View File

@@ -141,39 +141,58 @@ END
print "$Lang::tr{'profile has errors'}\n </b></font>\n";
}
print <<END;
<!-- Green -->
<tr><td bgcolor='$Header::colourgreen' width='25%'>
<font size='2' color='white'><b>$Lang::tr{'lan'}:</b></font>
<td width='30%'>$netsettings{'GREEN_ADDRESS'}
<td width='45%'>
if ( $netsettings{'GREEN_DEV'} ) { print <<END;
<tr><td bgcolor='$Header::colourgreen' width='25%'><font size='2' color='white'><b>$Lang::tr{'lan'}:</b></font>
<td width='30%'>$netsettings{'GREEN_ADDRESS'}
<td width='45%'>
END
if (`ifconfig | grep $netsettings{'GREEN_DEV'}`) { print "<font color=$Header::colourgreen>Online</font>"; } else { print "<font color=$Header::colourred>Offline</font>"; }
print <<END;
<!-- BLUE -->
<tr><td bgcolor='$Header::colourblue' width='25%'><font size='2' color='white'><b>$Lang::tr{'wireless'}:</b></font><br>
<td width='30%'>$netsettings{'BLUE_ADDRESS'}
<td width='45%'>
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 <<END;
<tr><td bgcolor='$Header::colourblue' width='25%'><font size='2' color='white'><b>$Lang::tr{'wireless'}:</b></font><br>
<td width='30%'>$netsettings{'BLUE_ADDRESS'}
<td width='45%'>
END
if (`ifconfig | grep $netsettings{'BLUE_DEV'}`) { print "<font color=$Header::colourgreen>Online</font>"; } else { print "<font color=$Header::colourred>Offline</font>"; }
print <<END;
<tr><td bgcolor='$Header::colourorange' width='25%'><font size='2' color='white'><b>$Lang::tr{'dmz'}:</b></font><br>
<td width='30%'>$netsettings{'ORANGE_ADDRESS'}
<td width='45%'>
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 <<END;
<tr><td bgcolor='$Header::colourorange' width='25%'><font size='2' color='white'><b>$Lang::tr{'dmz'}:</b></font><br>
<td width='30%'>$netsettings{'ORANGE_ADDRESS'}
<td width='45%'><font color=$Header::colourgreen>Online</font>
END
if (`ifconfig | grep $netsettings{'ORANGE_DEV'}`) { print "<font color=$Header::colourgreen>Online</font>"; } else { print "<font color=$Header::colourred>Offline</font>"; }
print <<END;
<tr><td bgcolor='$Header::colourvpn' width='25%'><font size='2' color='white'><b>$Lang::tr{'vpn'}:</b></font><br>
<td width='30%'>N/A
<td width='45%'>
}
if ( `cat /var/ipfire/vpn/settings | grep ^ENABLED=on` ) {
my $ipsecip = `cat /var/ipfire/vpn/settings | grep ^VPN_IP= | cut -c 8-`;
print <<END;
<tr><td bgcolor='$Header::colourvpn' width='25%'><font size='2' color='white'><b>$Lang::tr{'vpn'}:</b></font><br>
<td width='30%'>$ipsecip
<td width='45%'><font color=$Header::colourgreen>Online</font>
END
if (`ifconfig | grep ipsec0`) { print "<font color=$Header::colourgreen>Online</font>"; } else { print "<font color=$Header::colourred>Offline</font>"; }
print <<END;
<tr><td bgcolor='$Header::colourovpn' width='25%'><font size='2' color='white'><b>OpenVPN:</b></font><br>
<td width='30%'>N/A
<td width='45%'>
}
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 <<END;
<tr><td bgcolor='$Header::colourovpn' width='25%'><font size='2' color='white'><b>OpenVPN:</b></font><br>
<td width='30%'>$ovpnip
<td width='45%'><font color=$Header::colourgreen>Online</font>
END
if (`ifconfig | grep tun0`) { print "<font color=$Header::colourgreen>Online</font>"; } else { print "<font color=$Header::colourred>Offline</font>"; }
}
if ( $netsettings{'DNS1'} ) { print <<END;
<tr><td>DNS-Server: <td>$netsettings{'DNS1'}
END
}
if ( $netsettings{'DNS2'} ) { print <<END;
<td>$netsettings{'DNS2'}
END
}
print <<END;
</table>
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 = <AV>;
close(AV);
open(PF, "<${General::swroot}/patches/installed") or die "Could not open installed patches file. ($!)<br />";
while(<PF>)
{
next if $_ =~ m/^#/;
@temp = split(/\|/,$_);
@av = grep(!/^$temp[0]/, @av);
}
close(PF);
if ($#av != -1)
{
$warnmessage .= "<li> $Lang::tr{'there are updates'}</li>";
}
my $age = &General::age("/${General::swroot}/patches/available");
if ($age =~ m/(\d{1,3})d/) {
if ($1 >= 7) {
$warnmessage .= "<li>$Lang::tr{'updates is old1'} $age $Lang::tr{'updates is old2'}</li>\n";
}
}
if ($warnmessage) {
print "<ol>$warnmessage</ol>";
print "<table border='0'><tr><td align='center' bgcolor=$Header::colourred>$warnmessage</table>";
}
print "<p>";
system('/usr/bin/uptime');
print "</p>\n";
&Header::closebox();
&Header::closebigbox();

View File

@@ -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 <a href="http://www.advproxy.net" target="_blank">http://www.advproxy.net</a> für weitere Informationen.',
'linkq' => 'Verbindungsqualit<69>t',
);

View File

@@ -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 <a href="http://www.advproxy.net" target="_blank">http://www.advproxy.net</a> for more information.',
'linkq' => 'Link Quality',
);

View File

@@ -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
#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

View File

@@ -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);
}
}

View File

@@ -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
###