mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-26 10:52:57 +02:00
Corrected and translated outgoing fw
Added recent changes to core6 Further integrated collectd Started building core 7 for collected git-svn-id: http://svn.ipfire.org/svn/ipfire/branches/2.1/trunk@1163 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
@@ -118,10 +118,10 @@ if ($cgigraphs[1] =~ /(green|blue|orange|red|ipsec|lq|cpu|memory|swap|disk|load|
|
||||
print "<div align='center'><table width='80%'><tr><td align='center'>";
|
||||
if ( $cgigraphs[1] eq "cpu" || $cgigraphs[1] eq "load" ) { print "<a href='/cgi-bin/system.cgi'>"; }
|
||||
elsif ( $cgigraphs[1] eq "memory" || $cgigraphs[1] eq "swap" ) { print "<a href='/cgi-bin/memory.cgi'>"; }
|
||||
elsif ( $cgigraphs[1] eq "memory" || $cgigraphs[1] eq "swap" ) { print "<a href='/cgi-bin/memory.cgi'>"; }
|
||||
elsif ( $cgigraphs[1] =~ /disk/ ) { print "<a href='/cgi-bin/media.cgi'>"; }
|
||||
elsif ( $cgigraphs[1] eq "RED" || $cgigraphs[1] eq "lq" ) { print "<a href='/cgi-bin/network.cgi?network=red'>"; }
|
||||
elsif ( $cgigraphs[1] eq "GREEN" || $cgigraphs[1] eq "BLUE" || $cgigraphs[1] eq "ORANGE" ) { print "<a href='/cgi-bin/network.cgi?network=other'>"; }
|
||||
elsif ( $cgigraphs[1] =~ /red/ || $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";
|
||||
|
||||
&Header::closebigbox();
|
||||
|
||||
@@ -22,19 +22,15 @@
|
||||
use strict;
|
||||
|
||||
# enable only the following on debugging purpose
|
||||
# use warnings;
|
||||
# use CGI::Carp 'fatalsToBrowser';
|
||||
#use warnings;
|
||||
#use CGI::Carp 'fatalsToBrowser';
|
||||
|
||||
require '/var/ipfire/general-functions.pl';
|
||||
require "${General::swroot}/lang.pl";
|
||||
require "${General::swroot}/header.pl";
|
||||
require "${General::swroot}/graphs.pl";
|
||||
|
||||
my %color = ();
|
||||
my %mainsettings = ();
|
||||
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
|
||||
&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
|
||||
|
||||
my %mbmonsettings = ();
|
||||
my %cgiparams=();
|
||||
my @cgigraphs=();
|
||||
|
||||
@@ -42,269 +38,78 @@ my @cgigraphs=();
|
||||
|
||||
my $graphdir = "/srv/web/ipfire/html/graphs";
|
||||
|
||||
my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
|
||||
foreach (@disks){
|
||||
my $disk = $_;
|
||||
chomp $disk;
|
||||
my @array = split(/\//,$disk);
|
||||
&Graphs::updatehddgraph ($array[$#array],"day");&Graphs::updatehddgraph ($array[$#array],"week");&Graphs::updatehddgraph ($array[$#array],"month");&Graphs::updatehddgraph ($array[$#array],"year");
|
||||
}
|
||||
|
||||
&Graphs::updatetempgraph ("day");
|
||||
&Graphs::updatefangraph ("day");
|
||||
&Graphs::updatevoltgraph ("day");
|
||||
|
||||
my @graphs=();
|
||||
|
||||
&Header::getcgihash(\%cgiparams);
|
||||
|
||||
$ENV{'QUERY_STRING'} =~ s/&//g;
|
||||
@cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'});
|
||||
$cgigraphs[1] = '' unless defined $cgigraphs[1];
|
||||
|
||||
my %mbmon_settings = ();
|
||||
my %mbmon_values = ();
|
||||
&General::readhash("/var/log/mbmon-values", \%mbmon_values);
|
||||
my $key;
|
||||
my @mbmongraphs = ();
|
||||
if ( -e "/var/log/rrd/collectd/localhost/mbmon" ){@mbmongraphs = `ls /var/log/rrd/collectd/localhost/mbmon/`;}
|
||||
|
||||
if ( $cgiparams{'ACTION'} eq $Lang::tr{'save'} )
|
||||
{
|
||||
$mbmon_settings{'GRAPH_TEMP'} = ($cgiparams{'TEMP'} eq 'on');
|
||||
$mbmon_settings{'GRAPH_FAN'} = ($cgiparams{'FAN'} eq 'on');
|
||||
$mbmon_settings{'GRAPH_VOLT'} = ($cgiparams{'VOLT'} eq 'on');
|
||||
$mbmon_settings{'GRAPH_HDD'} = ($cgiparams{'HDD'} eq 'on');
|
||||
&Header::getcgihash(\%mbmonsettings);
|
||||
|
||||
foreach my $line (sort keys %cgiparams)
|
||||
{
|
||||
if ( index($line, "LINE-") != -1 )
|
||||
{
|
||||
$mbmon_settings{$line} = 'on';
|
||||
}
|
||||
if ( $mbmonsettings{'ACTION'} eq $Lang::tr{'save'} ) {
|
||||
foreach (@mbmongraphs){
|
||||
chomp($_);
|
||||
my @name=split(/\./,$_);
|
||||
if ( $mbmonsettings{'LINE-'.$name[0]} ne "on" ){$mbmonsettings{'LINE-'.$name[0]} = 'off';}
|
||||
elsif ( $mbmonsettings{'LINE-'.$name[0]} eq "on" ){$mbmonsettings{'LINE-'.$name[0]} = 'checked';}
|
||||
}
|
||||
&General::writehash("${General::swroot}/mbmon/settings", \%mbmonsettings);
|
||||
}
|
||||
|
||||
if ( index($line, "LABEL-") != -1 )
|
||||
{
|
||||
$mbmon_settings{$line} = $cgiparams{$line};
|
||||
}
|
||||
}
|
||||
my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
|
||||
|
||||
&General::writehash("${General::swroot}/mbmon/settings", \%mbmon_settings);
|
||||
&Header::openpage($Lang::tr{'harddisk temperature graphs'}, 1, '');
|
||||
&Header::openbigbox('100%', 'left');
|
||||
|
||||
if ($cgigraphs[1] =~ /hwtemp/) {&Graphs::updatehwtempgraph ("hour");&Graphs::updatehwtempgraph ("week");&Graphs::updatehwtempgraph ("month");&Graphs::updatehwtempgraph ("year");graphbox("hwtemp");}
|
||||
elsif ($cgigraphs[1] =~ /hwfan/) {&Graphs::updatehwfangraph ("hour");&Graphs::updatehwfangraph ("week");&Graphs::updatehwfangraph ("month");&Graphs::updatehwfangraph ("year");graphbox("hwfan");}
|
||||
elsif ($cgigraphs[1] =~ /hwvolt/) {&Graphs::updatehwvoltgraph ("hour");&Graphs::updatehwvoltgraph ("week");&Graphs::updatehwvoltgraph ("month");&Graphs::updatehwvoltgraph ("year");graphbox("hwvolt");}
|
||||
elsif ($cgigraphs[1] =~ /hddtemp/) {
|
||||
foreach (@disks){
|
||||
my $disk = $_;
|
||||
chomp $disk;
|
||||
my @array = split(/\//,$disk);
|
||||
&Graphs::updatehddgraph ($array[$#array],"week");&Graphs::updatehddgraph ($array[$#array],"month");&Graphs::updatehddgraph ($array[$#array],"year");
|
||||
hddtempbox($array[$#array]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
&General::readhash("${General::swroot}/mbmon/settings", \%mbmon_settings);
|
||||
}
|
||||
&Graphs::updatehwtempgraph ("day");&Graphs::updatehwfangraph ("day");&Graphs::updatehwvoltgraph ("day");
|
||||
foreach (@disks){
|
||||
my $disk = $_;
|
||||
chomp $disk;
|
||||
my @array = split(/\//,$disk);
|
||||
&Graphs::updatehddgraph ($array[$#array],"day");
|
||||
if (-e "$graphdir/hddtemp-$disk-day.png") {
|
||||
|
||||
my $selected_temp = '';
|
||||
my $selected_fan = '';
|
||||
my $selected_volt = '';
|
||||
my $selected_hdd = '';
|
||||
|
||||
$selected_temp = "checked='checked'" if ( $mbmon_settings{'GRAPH_TEMP'} == 1 );
|
||||
$selected_fan = "checked='checked'" if ( $mbmon_settings{'GRAPH_FAN'} == 1 );
|
||||
$selected_volt = "checked='checked'" if ( $mbmon_settings{'GRAPH_VOLT'} == 1 );
|
||||
$selected_hdd = "checked='checked'" if ( $mbmon_settings{'GRAPH_HDD'} == 1 );
|
||||
|
||||
my %mbmon_graphs = ();
|
||||
foreach $key ( sort(keys %mbmon_values) )
|
||||
{
|
||||
$mbmon_graphs{$key} = "checked='checked'" if ( $mbmon_settings{'LINE-'.$key} eq 'on' );
|
||||
if ( !defined($mbmon_settings{'LABEL-'.$key}) )
|
||||
{
|
||||
$mbmon_settings{'LABEL-'.$key} = $key;
|
||||
}
|
||||
}
|
||||
|
||||
&Header::openpage($Lang::tr{'harddisk temperature graphs'}, 1, '');
|
||||
|
||||
&Header::openbigbox('100%', 'left');
|
||||
|
||||
###############
|
||||
# DEBUG DEBUG
|
||||
#&Header::openbox('100%', 'left', 'DEBUG');
|
||||
#my $debugCount = 0;
|
||||
#foreach my $line (sort keys %cgiparams) {
|
||||
# print "$line = $cgiparams{$line}<br />\n";
|
||||
# $debugCount++;
|
||||
#}
|
||||
#print " Count: $debugCount<br />\n";
|
||||
#print " CGIParams: $cgigraphs[1]\n";
|
||||
#&Header::closebox();
|
||||
# DEBUG DEBUG
|
||||
###############
|
||||
|
||||
if ($cgigraphs[1] =~ /hddtemp/)
|
||||
{
|
||||
my $graph = $cgigraphs[1];
|
||||
my $graphname = $Lang::tr{"harddisk temperature"};
|
||||
&Header::openbox('100%', 'center', "$graphname $Lang::tr{'graph'}");
|
||||
|
||||
if (-e "$graphdir/${graph}-day.png")
|
||||
{
|
||||
my $ftime = localtime((stat("$graphdir/${graph}-day.png"))[9]);
|
||||
print "<center>";
|
||||
print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br /><hr />\n";
|
||||
print "<img src='/graphs/${graph}-day.png' border='0' /><hr />";
|
||||
print "<img src='/graphs/${graph}-week.png' border='0' /><hr />";
|
||||
print "<img src='/graphs/${graph}-month.png' border='0' /><hr />";
|
||||
print "<img src='/graphs/${graph}-year.png' border='0' />";
|
||||
if ( -e "/var/log/smartctl_out_${graph}" )
|
||||
{
|
||||
my $output = `/bin/cat /var/log/smartctl_out_${graph}`;
|
||||
$output = &Header::cleanhtml($output);
|
||||
print "<hr><table border=0><tr><td align=left><pre>$output</pre></table>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $Lang::tr{'no information available'};
|
||||
}
|
||||
&Header::closebox();
|
||||
print "<div align='center'><table width='80%'><tr><td align='center'>";
|
||||
print "<a href='/cgi-bin/hardwaregraphs.cgi'>";
|
||||
print "$Lang::tr{'back'}</a></td></tr></table></div>\n";
|
||||
}
|
||||
elsif ($cgigraphs[1] =~ /(temp|fan|volt)/)
|
||||
{
|
||||
if ($cgigraphs[1] =~ /temp/) {&Graphs::updatetempgraph ("week");&Graphs::updatetempgraph ("month");&Graphs::updatetempgraph ("year");}
|
||||
if ($cgigraphs[1] =~ /fan/) {&Graphs::updatefangraph ("week");&Graphs::updatefangraph ("month");&Graphs::updatefangraph ("year");}
|
||||
if ($cgigraphs[1] =~ /volt/) {&Graphs::updatevoltgraph ("week");&Graphs::updatevoltgraph ("month");&Graphs::updatevoltgraph ("year");}
|
||||
|
||||
my $graph = $cgigraphs[1];
|
||||
my $graphname = $Lang::tr{"mbmon $cgigraphs[1]"};
|
||||
&Header::openbox('100%', 'center', "$graphname $Lang::tr{'graph'}");
|
||||
|
||||
if (-e "$graphdir/mbmon-${graph}-day.png")
|
||||
{
|
||||
my $ftime = localtime((stat("$graphdir/mbmon-${graph}-day.png"))[9]);
|
||||
print "<center>";
|
||||
print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br /><hr />\n";
|
||||
print "<img src='/graphs/mbmon-${graph}-day.png' border='0' /><hr />";
|
||||
print "<img src='/graphs/mbmon-${graph}-week.png' border='0' /><hr />";
|
||||
print "<img src='/graphs/mbmon-${graph}-month.png' border='0' /><hr />";
|
||||
print "<img src='/graphs/mbmon-${graph}-year.png' border='0' />";
|
||||
}
|
||||
else
|
||||
{
|
||||
print $Lang::tr{'no information available'};
|
||||
}
|
||||
&Header::closebox();
|
||||
print "<div align='center'><table width='80%'><tr><td align='center'>";
|
||||
print "<a href='/cgi-bin/hardwaregraphs.cgi'>";
|
||||
print "$Lang::tr{'back'}</a></td></tr></table></div>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $mbmon_settings{'GRAPH_TEMP'} == 1 )
|
||||
{
|
||||
&Header::openbox('100%', 'center', "$Lang::tr{'mbmon temp'} $Lang::tr{'graph'}");
|
||||
if (-e "$graphdir/mbmon-temp-day.png")
|
||||
{
|
||||
my $ftime = localtime((stat("$graphdir/mbmon-temp-day.png"))[9]);
|
||||
print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<a href='/cgi-bin/hardwaregraphs.cgi?graph=temp'>";
|
||||
print "<img src='/graphs/mbmon-temp-day.png' border='0' />";
|
||||
print "</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print $Lang::tr{'no information available'};
|
||||
}
|
||||
print "<br />\n";
|
||||
&Header::closebox();
|
||||
&Header::openbox('100%', 'center', "Disk $disk $Lang::tr{'graph'}");
|
||||
my $ftime = localtime((stat("$graphdir/hddtemp-$disk-day.png"))[9]);
|
||||
print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<a href='/cgi-bin/hardwaregraphs.cgi?graph=hddtemp'>";
|
||||
print "<img src='/graphs/hddtemp-$disk-day.png' border='0' />";
|
||||
print "</a>";
|
||||
print "<br />\n";
|
||||
&Header::closebox();
|
||||
}
|
||||
}
|
||||
|
||||
if ( $mbmon_settings{'GRAPH_FAN'} == 1 )
|
||||
{
|
||||
&Header::openbox('100%', 'center', "$Lang::tr{'mbmon fan'} $Lang::tr{'graph'}");
|
||||
if (-e "$graphdir/mbmon-fan-day.png")
|
||||
{
|
||||
my $ftime = localtime((stat("$graphdir/mbmon-fan-day.png"))[9]);
|
||||
print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<a href='/cgi-bin/hardwaregraphs.cgi?graph=fan'>";
|
||||
print "<img src='/graphs/mbmon-fan-day.png' border='0' />";
|
||||
print "</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print $Lang::tr{'no information available'};
|
||||
}
|
||||
print "<br />\n";
|
||||
&Header::closebox();
|
||||
}
|
||||
|
||||
if ( $mbmon_settings{'GRAPH_VOLT'} == 1 )
|
||||
{
|
||||
&Header::openbox('100%', 'center', "$Lang::tr{'mbmon volt'} $Lang::tr{'graph'}");
|
||||
if (-e "$graphdir/mbmon-volt-day.png")
|
||||
{
|
||||
my $ftime = localtime((stat("$graphdir/mbmon-volt-day.png"))[9]);
|
||||
print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<a href='/cgi-bin/hardwaregraphs.cgi?graph=volt'>";
|
||||
print "<img src='/graphs/mbmon-volt-day.png' border='0' />";
|
||||
print "</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print $Lang::tr{'no information available'};
|
||||
}
|
||||
print "<br />\n";
|
||||
&Header::closebox();
|
||||
}
|
||||
|
||||
if ( $mbmon_settings{'GRAPH_HDD'} == 1 )
|
||||
{
|
||||
my @devices = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
|
||||
foreach (@devices) {
|
||||
my $device = $_;
|
||||
chomp($device);
|
||||
my @array = split(/\//,$device);
|
||||
hddtempbox($array[$#array]);}
|
||||
}
|
||||
|
||||
&Header::openbox('100%', 'center', $Lang::tr{'settings'});
|
||||
print <<END
|
||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<table width='100%'>
|
||||
<tr><td colspan='2' align='left'><input type='checkbox' name='TEMP' $selected_temp /> $Lang::tr{'mbmon temp'} $Lang::tr{'graph'}</td></tr>
|
||||
<tr><td colspan='2' align='left'><input type='checkbox' name='FAN' $selected_fan /> $Lang::tr{'mbmon fan'} $Lang::tr{'graph'}</td></tr>
|
||||
<tr><td colspan='2' align='left'><input type='checkbox' name='VOLT' $selected_volt /> $Lang::tr{'mbmon volt'} $Lang::tr{'graph'}</td></tr>
|
||||
<tr><td colspan='2' align='left'><input type='checkbox' name='HDD' $selected_hdd /> $Lang::tr{'harddisk temperature'}-$Lang::tr{'graph'}</td></tr>
|
||||
</table>
|
||||
<hr />
|
||||
<table width='100%' border='0' cellspacing='1' cellpadding='0'>
|
||||
<tr><td align='center' width='10%'><b>$Lang::tr{'mbmon display'}</b></td><td align='center' width='15%'> </td><td align='center' width='15%'><b>$Lang::tr{'mbmon value'}</b></td><td align='left'><b>$Lang::tr{'mbmon label'}</b></td></tr>
|
||||
END
|
||||
;
|
||||
|
||||
my $i = 0;
|
||||
foreach $key ( sort(keys %mbmon_values) )
|
||||
{
|
||||
if ( $i % 2 )
|
||||
{
|
||||
print("<tr bgcolor='$color{'color22'}'>");
|
||||
}
|
||||
else
|
||||
{
|
||||
print("<tr bgcolor='$color{'color20'}'>");
|
||||
}
|
||||
$mbmon_settings{'LABEL-'.$key} = &Header::cleanhtml($mbmon_settings{'LABEL-'.$key});
|
||||
print("<td align='center'><input type='checkbox' name='LINE-$key' $mbmon_graphs{$key}/></td>");
|
||||
print("<td>$key</td><td align='center'>$mbmon_values{$key}</td>\n");
|
||||
print("<td> <input type='text' name='LABEL-$key' value='$mbmon_settings{'LABEL-'.$key}' size='25' /></td></tr>\n");
|
||||
$i++;
|
||||
}
|
||||
|
||||
print <<END
|
||||
</table>
|
||||
|
||||
<table width='100%'>
|
||||
<tr><td class='base' valign='top'> </td><td width='40%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td></tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
END
|
||||
;
|
||||
&Header::closebox();
|
||||
my @graphs = ("hwtemp","hwfan","hwvolt");
|
||||
foreach (@graphs){
|
||||
&Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}");
|
||||
if (-e "$graphdir/mbmon-$_-day.png"){
|
||||
my $ftime = localtime((stat("$graphdir/mbmon-$_-day.png"))[9]);
|
||||
print "<center>";
|
||||
print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<a href='/cgi-bin/hardwaregraphs.cgi?graph=$_'>";
|
||||
print "<img src='/graphs/mbmon-$_-day.png' border='0' />";
|
||||
print "</a><hr />";
|
||||
}
|
||||
else{print $Lang::tr{'no information available'};}
|
||||
&Header::closebox();
|
||||
}
|
||||
if ( -e "/var/log/rrd/collectd/localhost/mbmon" ){mbmonbox();}
|
||||
}
|
||||
|
||||
&Header::closebigbox();
|
||||
@@ -312,15 +117,98 @@ END
|
||||
|
||||
sub hddtempbox {
|
||||
my $disk = $_[0];
|
||||
if (-e "$graphdir/hddtemp-$disk-day.png") {
|
||||
|
||||
if (-e "$graphdir/hddtemp-$disk-week.png") {
|
||||
|
||||
&Header::openbox('100%', 'center', "Disk $disk $Lang::tr{'graph'}");
|
||||
my $ftime = localtime((stat("$graphdir/hddtemp-$disk-day.png"))[9]);
|
||||
my $ftime = localtime((stat("$graphdir/hddtemp-$disk-week.png"))[9]);
|
||||
print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<a href='/cgi-bin/hardwaregraphs.cgi?graph=hddtemp-$disk'>";
|
||||
print "<img src='/graphs/hddtemp-$disk-day.png' border='0' />";
|
||||
print "</a>";
|
||||
print "<br />\n";
|
||||
&Header::closebox();
|
||||
}
|
||||
if (-e "$graphdir/hddtemp-$disk-month.png") {
|
||||
|
||||
&Header::openbox('100%', 'center', "Disk $disk $Lang::tr{'graph'}");
|
||||
my $ftime = localtime((stat("$graphdir/hddtemp-$disk-month.png"))[9]);
|
||||
print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<img src='/graphs/hddtemp-$disk-day.png' border='0' />";
|
||||
print "<br />\n";
|
||||
&Header::closebox();
|
||||
}
|
||||
if (-e "$graphdir/hddtemp-$disk-year.png") {
|
||||
|
||||
&Header::openbox('100%', 'center', "Disk $disk $Lang::tr{'graph'}");
|
||||
my $ftime = localtime((stat("$graphdir/hddtemp-$disk-year.png"))[9]);
|
||||
print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<img src='/graphs/hddtemp-$disk-year.png' border='0' />";
|
||||
print "<br />\n";
|
||||
&Header::closebox();
|
||||
}
|
||||
}
|
||||
|
||||
sub graphbox {
|
||||
my $graph = $_[0];
|
||||
|
||||
&Header::openbox('100%', 'center', "$graph $Lang::tr{'graph'}");
|
||||
if (-e "$graphdir/mbmon-$graph-week.png"){
|
||||
my $ftime = localtime((stat("$graphdir/mbmon-$graph-day.png"))[9]);
|
||||
print "<center>";
|
||||
print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<img src='/graphs/mbmon-$graph-day.png' border='0' /><hr />";
|
||||
}
|
||||
else{print $Lang::tr{'no information available'};}
|
||||
&Header::closebox();
|
||||
&Header::openbox('100%', 'center', "$graph $Lang::tr{'graph'}");
|
||||
if (-e "$graphdir/mbmon-$graph-month.png"){
|
||||
my $ftime = localtime((stat("$graphdir/mbmon-$graph-month.png"))[9]);
|
||||
print "<center>";
|
||||
print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<img src='/graphs/mbmon-$graph-month.png' border='0' /><hr />";
|
||||
}
|
||||
else{print $Lang::tr{'no information available'};}
|
||||
&Header::closebox();
|
||||
&Header::openbox('100%', 'center', "$graph $Lang::tr{'graph'}");
|
||||
if (-e "$graphdir/mbmon-$graph-year.png"){
|
||||
my $ftime = localtime((stat("$graphdir/mbmon-$graph-year.png"))[9]);
|
||||
print "<center>";
|
||||
print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<img src='/graphs/mbmon-$graph-year.png' border='0' /><hr />";
|
||||
}
|
||||
else{print $Lang::tr{'no information available'};}
|
||||
&Header::closebox();
|
||||
}
|
||||
|
||||
sub mbmonbox{
|
||||
|
||||
foreach (@mbmongraphs){
|
||||
chomp($_);
|
||||
my @name=split(/\./,$_);my $label = $name[0]; $label=~ s/-//;
|
||||
$mbmonsettings{'LABEL-'.$name[0]}="$label";
|
||||
$mbmonsettings{'LINE-'.$name[0]}="checked";
|
||||
}
|
||||
&General::readhash("${General::swroot}/mbmon/settings", \%mbmonsettings);
|
||||
|
||||
&Header::openbox('100%', 'center', "$Lang::tr{'mbmon settings'}");
|
||||
if ( $cgiparams{'ACTION'} eq $Lang::tr{'save'} ){print "Test";}
|
||||
|
||||
print <<END
|
||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<table width='100%' border='0' cellspacing='5' cellpadding='0' align='center'>
|
||||
<tr><td align='right' width='40%'><b>$Lang::tr{'mbmon display'}</b></td>
|
||||
<td align='left'><b>$Lang::tr{'mbmon label'}</b></td>
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
foreach (@mbmongraphs){
|
||||
chomp($_);my @name=split(/\./,$_);
|
||||
print("<tr><td align='right'><input type='checkbox' name='LINE-$name[0]' $mbmonsettings{'LINE-'.$name[0]} /></td>");
|
||||
print("<td><input type='text' name='LABEL-$name[0]' value='$mbmonsettings{'LABEL-'.$name[0]}' size='25' /></td></tr>\n");
|
||||
}
|
||||
print <<END
|
||||
<tr><td align='center' colspan='2' ><input type='submit' name='ACTION' value=$Lang::tr{'save'} /></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
END
|
||||
;
|
||||
&Header::closebox();
|
||||
}
|
||||
|
||||
@@ -253,13 +253,13 @@ END
|
||||
<hr />
|
||||
<table border='0' width='100%' cellspacing='0'>
|
||||
<tr bgcolor='$color{'color22'}'>
|
||||
<td width='14%' align='center'><b>Protokoll</b>
|
||||
<td width='14%' align='center'><b>Netzwerk</b>
|
||||
<td width='14%' align='center'><b>Ziel</b>
|
||||
<td width='14%' align='center'><b>Anmerkung</b>
|
||||
<td width='14%' align='center'><b>Politik</b>
|
||||
<td width='16%' align='center'><b>Logging</b>
|
||||
<td width='14%' align='center'><b>Aktionen</b>
|
||||
<td width='14%' align='center'><b>$Lang::tr{'protocol'}</b></td>
|
||||
<td width='14%' align='center'><b>$Lang::tr{'network'}</b></td>
|
||||
<td width='14%' align='center'><b>$Lang::tr{'destination'}</b></td>
|
||||
<td width='14%' align='center'><b>$Lang::tr{'description'}</b></td>
|
||||
<td width='14%' align='center'><b>$Lang::tr{'policy'}</b></td>
|
||||
<td width='16%' align='center'><b>$Lang::tr{'logging'}</b></td>
|
||||
<td width='14%' align='center'><b>$Lang::tr{'action'}</b></td>
|
||||
END
|
||||
;
|
||||
foreach $configentry (sort @configs)
|
||||
@@ -324,10 +324,8 @@ END
|
||||
unless ($outfwsettings{'SIP'}) { $outfwsettings{'DISPLAY_SIP'} = 'ALL'; } else { $outfwsettings{'DISPLAY_SIP'} = $outfwsettings{'SIP'}; }
|
||||
unless ($outfwsettings{'SMAC'}) { $outfwsettings{'DISPLAY_SMAC'} = 'ALL'; } else { $outfwsettings{'DISPLAY_SMAC'} = $outfwsettings{'SMAC'}; }
|
||||
print <<END
|
||||
<tr><td width='14%' align='right'>Quell-IP-Adresse:
|
||||
<tr><td width='14%' align='right'>$Lang::tr{'source ip'}:
|
||||
<td width='14%' align='left'>$outfwsettings{'DISPLAY_SIP'}
|
||||
<td width='14%' align='right'>Quell-MAC-Adresse:
|
||||
<td width='14%' align='left'>$outfwsettings{'DISPLAY_SMAC'}
|
||||
<td width='44%' colspan='2' align='center'>
|
||||
END
|
||||
;
|
||||
@@ -370,8 +368,8 @@ if ($outfwsettings{'POLICY'} ne 'MODE0'){
|
||||
&Header::openbox('100%', 'center', 'P2P-Block');
|
||||
print <<END
|
||||
<table width='40%'>
|
||||
<tr bgcolor='$color{'color22'}'><td width='66%' align=center><b>Protokoll</b>
|
||||
<td width='33%' align=center><b>Status</b>
|
||||
<tr bgcolor='$color{'color22'}'><td width='66%' align=center><b>$Lang::tr{'protocol'}</b>
|
||||
<td width='33%' align=center><b>$Lang::tr{'status'}</b>
|
||||
END
|
||||
;
|
||||
my $id = 1;
|
||||
@@ -408,7 +406,7 @@ END
|
||||
}
|
||||
print <<END
|
||||
</table>
|
||||
<br />Klicken Sie auf die Symbole um das entsprechende iptables P2P-Blockmodul zu (de-)aktivieren.
|
||||
<br />$Lang::tr{'outgoingfw p2p description'}
|
||||
END
|
||||
;
|
||||
&Header::closebox();
|
||||
@@ -418,18 +416,18 @@ END
|
||||
print <<END
|
||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<table width='100%'>
|
||||
<tr><td width='10%' align='left'><b>Modus 0:</b><td width='90%' align='left' colspan='2'>In diesem Modus ist es allen Rechnern im Netzwerk uneingeschraenkt moeglich Verbindungen ins Internet aufzubauen.</td></tr>
|
||||
<tr><td width='10%' align='left'><b>Modus 1:</b><td width='90%' align='left' colspan='2'>In diesem Modus werden nur Verbindungen nach den oben definierten Regeln zugelassen.</td></tr>
|
||||
<tr><td width='10%' align='left'><b>Modus 2:</b><td width='90%' align='left' colspan='2'>In diesem Modus werden saemtliche Verbindungen erlaubt, bis auf die oben definierten Block-Regeln.</td></tr>
|
||||
<tr><td width='10%' align='left'><b>$Lang::tr{'mode'} 0:</b><td width='90%' align='left' colspan='2'>$Lang::tr{'outgoingfw mode0'}</td></tr>
|
||||
<tr><td width='10%' align='left'><b>$Lang::tr{'mode'} 1:</b><td width='90%' align='left' colspan='2'>$Lang::tr{'outgoingfw mode1'}</td></tr>
|
||||
<tr><td width='10%' align='left'><b>$Lang::tr{'mode'} 2:</b><td width='90%' align='left' colspan='2'>$Lang::tr{'outgoingfw mode2'}</td></tr>
|
||||
<tr><td colspan='3'><hr /></td></tr>
|
||||
<tr><td width='10%' align='left'> <select name='POLICY' style="width: 85px"><option value='MODE0' $selected{'POLICY'}{'MODE0'}>Modus 0</option><option value='MODE1' $selected{'POLICY'}{'MODE1'}>Modus 1</option><option value='MODE2' $selected{'POLICY'}{'MODE2'}>Modus 2</option></select>
|
||||
<tr><td width='10%' align='left'> <select name='POLICY' style="width: 85px"><option value='MODE0' $selected{'POLICY'}{'MODE0'}>$Lang::tr{'mode'} 0</option><option value='MODE1' $selected{'POLICY'}{'MODE1'}>$Lang::tr{'mode'} 1</option><option value='MODE2' $selected{'POLICY'}{'MODE2'}>$Lang::tr{'mode'} 2</option></select>
|
||||
<td width='45%' align='left'><input type='submit' name='ACTION' value=$Lang::tr{'save'} />
|
||||
<td width='45%' align='left'>
|
||||
END
|
||||
;
|
||||
if ($outfwsettings{'POLICY'} ne 'MODE0') {
|
||||
print <<END
|
||||
Alle Regeln loeschen: <input type='submit' name='ACTION' value=$Lang::tr{'reset'} />
|
||||
$Lang::tr{'outgoingfw reset'}: <input type='submit' name='ACTION' value=$Lang::tr{'reset'} />
|
||||
END
|
||||
;
|
||||
}
|
||||
@@ -453,13 +451,13 @@ sub addrule
|
||||
print <<END
|
||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<table width='80%'>
|
||||
<tr><td width='20%' align='right'>Anmerkung: <img src='/blob.gif' />
|
||||
<tr><td width='20%' align='right'>$Lang::tr{'description'}: <img src='/blob.gif' />
|
||||
<td width='30%' align='left'><input type='text' name='NAME' maxlength='30' value='$outfwsettings{'NAME'}' />
|
||||
<td width='20%' align='right'>Aktiviert:
|
||||
<td width='20%' align='right'>$Lang::tr{'active'}:
|
||||
<td width='30%' align='left'><input type='checkbox' name='ENABLED' $selected{'ENABLED'} />
|
||||
<tr><td width='20%' align='right'>Protokoll:
|
||||
<tr><td width='20%' align='right'>$Lang::tr{'protocol'}:
|
||||
<td width='30%' align='left'><select name='PROT'><option value='tcp' $selected{'PROT'}{'tcp'}>TCP</option><option value='tcp&udp' $selected{'PROT'}{'tcp&udp'}>TCP & UDP</option><option value='udp' $selected{'PROT'}{'udp'}>UDP</option></select>
|
||||
<td width='20%' align='right'>Sicherheitspolitik:
|
||||
<td width='20%' align='right'>$Lang::tr{'policy'}:
|
||||
<td width='30%' align='left'>
|
||||
END
|
||||
;
|
||||
@@ -469,10 +467,10 @@ END
|
||||
print "\t\t\tDENY<input type='hidden' name='STATE' value='DENY' />\n";
|
||||
}
|
||||
print <<END
|
||||
<tr><td width='20%' align='right'>Quellnetz:
|
||||
<tr><td width='20%' align='right'>$Lang::tr{'source net'}:
|
||||
<td width='30%' align='left'><select name='SNET'>
|
||||
<option value='all' $selected{'SNET'}{'ALL'}>alle</option>
|
||||
<option value='ip' $selected{'SNET'}{'ip'}>Quell-IP/MAC benutzen</option>
|
||||
<option value='all' $selected{'SNET'}{'ALL'}>$Lang::tr{'all'}</option>
|
||||
<option value='ip' $selected{'SNET'}{'ip'}>$Lang::tr{'source ip'}</option>
|
||||
<option value='green' $selected{'SNET'}{'green'}>$Lang::tr{'green'}</option>
|
||||
END
|
||||
;
|
||||
@@ -484,15 +482,15 @@ END
|
||||
}
|
||||
print <<END
|
||||
</select>
|
||||
<td width='20%' align='right'>Quell-IP-Adresse: <img src='/blob.gif' />
|
||||
<td width='20%' align='right'>$Lang::tr{'source ip'}: <img src='/blob.gif' />
|
||||
<td width='30%' align='left'><input type='text' name='SIP' maxlength='15' value='$outfwsettings{'SIP'}' />
|
||||
<tr><td width='20%' align='right'>Logging:
|
||||
<tr><td width='20%' align='right'>$Lang::tr{'logging'}:
|
||||
<td width='30%' align='left'><select name='LOG'><option value='$Lang::tr{'active'}' $selected{'LOG'}{$Lang::tr{'active'}}>$Lang::tr{'active'}</option><option value='$Lang::tr{'inactive'}' $selected{'LOG'}{$Lang::tr{'inactive'}}>$Lang::tr{'inactive'}</option></select></td>
|
||||
<td width='20%' align='right'>Quell-MAC-Adresse: <img src='/blob.gif' />
|
||||
<td width='30%' align='left'><input type='text' name='SMAC' maxlength='23' value='$outfwsettings{'SMAC'}' />
|
||||
<tr><td width='20%' align='right'>Ziel-IP-Adresse: <img src='/blob.gif' />
|
||||
<td width='20%' align='right' />
|
||||
<td width='30%' align='left' />
|
||||
<tr><td width='20%' align='right'>$Lang::tr{'destination ip'}: <img src='/blob.gif' />
|
||||
<td width='30%' align='left'><input type='text' name='DIP' maxlength='15' value='$outfwsettings{'DIP'}' />
|
||||
<td width='20%' align='right'>Ziel-Port: <img src='/blob.gif' />
|
||||
<td width='20%' align='right'>$Lang::tr{'destination port'}: <img src='/blob.gif' />
|
||||
<td width='30%' align='left'><input type='text' name='DPORT' maxlength='11' value='$outfwsettings{'DPORT'}' />
|
||||
<tr><td colspan='4'>
|
||||
<tr><td width='40%' align='right' colspan='2'><img src='/blob.gif' />$Lang::tr{'this field may be blank'}
|
||||
@@ -510,7 +508,7 @@ if ($outfwsettings{'POLICY'} eq 'MODE1' || $outfwsettings{'POLICY'} eq 'MODE2')
|
||||
my @defservices = <FILE>;
|
||||
close FILE;
|
||||
|
||||
print "<table width='100%'><tr bgcolor='$color{'color20'}'><td><b>$Lang::tr{'service'}</b></td><td><b>$Lang::tr{'description'}</b></td><td><b>$Lang::tr{'port'}</b></td><td><b>$Lang::tr{'protocol'}</b></td><td><b>$Lang::tr{'source net'}</b></td><td><b>$Lang::tr{'logging'}</b></td><td></td></tr>";
|
||||
print "<table width='100%'><tr bgcolor='$color{'color20'}'><td><b>$Lang::tr{'service'}</b></td><td><b>$Lang::tr{'description'}</b></td><td><b>$Lang::tr{'port'}</b></td><td><b>$Lang::tr{'protocol'}</b></td><td><b>$Lang::tr{'source net'}</b></td><td><b>$Lang::tr{'logging'}</b></td><td><b>$Lang::tr{'action'}</b></td></tr>";
|
||||
foreach my $serviceline(@defservices)
|
||||
{
|
||||
my @service = split(/,/,$serviceline);
|
||||
|
||||
Reference in New Issue
Block a user