mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-15 13:32:59 +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:
@@ -19,22 +19,27 @@ $ENV{PATH}="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
|
||||
|
||||
my %color = ();
|
||||
my %mainsettings = ();
|
||||
my %mbmonsettings = ();
|
||||
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
|
||||
|
||||
&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
|
||||
|
||||
my %mbmon_settings = ();
|
||||
&General::readhash("${General::swroot}/mbmon/settings", \%mbmon_settings);
|
||||
|
||||
my %mbmon_values = ();
|
||||
if ( -e "/var/log/mbmon-values" ){
|
||||
&General::readhash("/var/log/mbmon-values", \%mbmon_values);
|
||||
}
|
||||
|
||||
my $key;
|
||||
my $value;
|
||||
my @args = ();
|
||||
my $count = 0;
|
||||
|
||||
my @mbmongraphs = ();
|
||||
if ( -e "/var/log/rrd/collectd/localhost/mbmon" ){
|
||||
@mbmongraphs = `ls /var/log/rrd/collectd/localhost/mbmon/`;
|
||||
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);
|
||||
use Encode 'from_to';
|
||||
|
||||
my %tr=();
|
||||
@@ -56,7 +61,7 @@ sub updatecpugraph {
|
||||
|
||||
RRDs::graph ("$graphs/cpu-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-z", "-W www.ipfire.org",, "-v $Lang::tr{'percentage'}",
|
||||
"--alt-y-grid", "-w 600", "-h 150", "-l 0", "-u 100", "-r",
|
||||
"--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
|
||||
"--color", "SHADEA".$color{"color19"},
|
||||
"--color", "SHADEB".$color{"color19"},
|
||||
"--color", "BACK".$color{"color21"},
|
||||
@@ -132,7 +137,7 @@ sub updateloadgraph {
|
||||
|
||||
RRDs::graph ("$graphs/load-$period.png",
|
||||
"--start", "-1$period", "-aPNG",
|
||||
"-w 600", "-h 150", "-i", "-z", "-W www.ipfire.org", "-l 0", "-r", "--alt-y-grid",
|
||||
"-w 600", "-h 100", "-i", "-z", "-W www.ipfire.org", "-l 0", "-r", "--alt-y-grid",
|
||||
"-t Load Average $Lang::tr{'graph per'} $Lang::tr{$period}",
|
||||
"--color", "SHADEA".$color{"color19"},
|
||||
"--color", "SHADEB".$color{"color19"},
|
||||
@@ -157,7 +162,7 @@ sub updatememgraph {
|
||||
|
||||
RRDs::graph ("$graphs/memory-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-z", "-W www.ipfire.org", "-v $Lang::tr{'percentage'}",
|
||||
"--alt-y-grid", "-w 600", "-h 150", "-l 0", "-u 100", "-r",
|
||||
"--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
|
||||
"--color", "SHADEA".$color{"color19"},
|
||||
"--color", "SHADEB".$color{"color19"},
|
||||
"--color", "BACK".$color{"color21"},
|
||||
@@ -171,7 +176,7 @@ sub updatememgraph {
|
||||
"CDEF:bufferpct=buffer,total,/,100,*",
|
||||
"CDEF:cachepct=cache,total,/,100,*",
|
||||
"CDEF:freepct=free,total,/,100,*",
|
||||
"COMMENT:$Lang::".sprintf("%-29s",$Lang::tr{'caption'}),
|
||||
"COMMENT:".sprintf("%-29s",$Lang::tr{'caption'}),
|
||||
"COMMENT:$Lang::tr{'maximal'}",
|
||||
"COMMENT:$Lang::tr{'average'}",
|
||||
"COMMENT:$Lang::tr{'minimal'}",
|
||||
@@ -201,7 +206,7 @@ sub updatememgraph {
|
||||
|
||||
RRDs::graph ("$graphs/swap-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-z", "-W www.ipfire.org", "-v $Lang::tr{'percentage'}",
|
||||
"--alt-y-grid", "-w 600", "-h 150", "-l 0", "-u 100", "-r",
|
||||
"--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
|
||||
"--color", "SHADEA".$color{"color19"},
|
||||
"--color", "SHADEB".$color{"color19"},
|
||||
"--color", "BACK".$color{"color21"},
|
||||
@@ -213,7 +218,7 @@ sub updatememgraph {
|
||||
"CDEF:usedpct=100,used,total,/,*",
|
||||
"CDEF:freepct=100,free,total,/,*",
|
||||
"CDEF:cachedpct=100,cached,total,/,*",
|
||||
"COMMENT:$Lang::".sprintf("%-29s",$Lang::tr{'caption'}),
|
||||
"COMMENT:".sprintf("%-29s",$Lang::tr{'caption'}),
|
||||
"COMMENT:$Lang::tr{'maximal'}",
|
||||
"COMMENT:$Lang::tr{'average'}",
|
||||
"COMMENT:$Lang::tr{'minimal'}",
|
||||
@@ -243,7 +248,7 @@ sub updatediskgraph {
|
||||
|
||||
RRDs::graph ("$graphs/disk-$disk-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-W www.ipfire.org", "-v $Lang::tr{'bytes per second'}",
|
||||
"--alt-y-grid", "-w 600", "-h 150", "-r", "-z",
|
||||
"--alt-y-grid", "-w 600", "-h 100", "-r", "-z",
|
||||
"--color", "SHADEA".$color{"color19"},
|
||||
"--color", "SHADEB".$color{"color19"},
|
||||
"--color", "BACK".$color{"color21"},
|
||||
@@ -258,7 +263,7 @@ sub updatediskgraph {
|
||||
"COMMENT:$Lang::tr{'average'}",
|
||||
"COMMENT:$Lang::tr{'minimal'}",
|
||||
"COMMENT:$Lang::tr{'current'}\\j",
|
||||
"AREA:st".$color{"color20"}.":standby\\j",
|
||||
"AREA:st".$color{"color20"}."A0:standby\\j",
|
||||
"AREA:read".$color{"color14"}."A0:".sprintf("%-25s",$Lang::tr{'read bytes'}),
|
||||
"GPRINT:read:MAX:%8.1lf %sBps",
|
||||
"GPRINT:read:AVERAGE:%8.1lf %sBps",
|
||||
@@ -279,7 +284,7 @@ sub updateifgraph {
|
||||
|
||||
RRDs::graph ("$graphs/$interface-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-W www.ipfire.org", "-v $Lang::tr{'bytes per second'}",
|
||||
"--alt-y-grid", "-w 600", "-h 150", "-z", "-r",
|
||||
"--alt-y-grid", "-w 600", "-h 100", "-z", "-r",
|
||||
"--color", "SHADEA".$color{"color19"},
|
||||
"--color", "SHADEB".$color{"color19"},
|
||||
"--color", "BACK".$color{"color21"},
|
||||
@@ -311,7 +316,7 @@ sub updatefwhitsgraph {
|
||||
my $period = $_[0];
|
||||
RRDs::graph ("$graphs/fwhits-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-z", "-W www.ipfire.org",
|
||||
"--alt-y-grid", "-w 600", "-h 150", "-r", "-v $Lang::tr{'bytes per second'}",
|
||||
"--alt-y-grid", "-w 600", "-h 100", "-r", "-v $Lang::tr{'bytes per second'}",
|
||||
"--color", "SHADEA".$color{"color19"},
|
||||
"--color", "SHADEB".$color{"color19"},
|
||||
"--color", "BACK".$color{"color21"},
|
||||
@@ -344,22 +349,23 @@ sub updatelqgraph {
|
||||
my $period = $_[0];
|
||||
RRDs::graph ("$graphs/lq-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-W www.ipfire.org",
|
||||
"--alt-y-grid", "-w 600", "-h 150", "-l 0", "-r", "-v ms",
|
||||
"--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r", "-v ms",
|
||||
"-t $Lang::tr{'linkq'} $Lang::tr{'graph per'} $Lang::tr{$period}",
|
||||
"--color", "SHADEA".$color{"color19"},
|
||||
"--color", "SHADEB".$color{"color19"},
|
||||
"--color", "BACK".$color{"color21"},
|
||||
"DEF:roundtrip=$rrdlog/collectd/localhost/ping/ping-gateway.rrd:ping:AVERAGE",
|
||||
"COMMENT:$Lang::".sprintf("%-20s",$Lang::tr{'caption'})."\\j",
|
||||
"CDEF:r0=roundtrip,30,-",
|
||||
"CDEF:r1=r0,70,-",
|
||||
"CDEF:r2=r1,150,-",
|
||||
"CDEF:r3=r2,300,-",
|
||||
"AREA:r0".$color{"color12"}."A0:<30 ms",
|
||||
"STACK:r1".$color{"color17"}."A0:30-70 ms",
|
||||
"STACK:r2".$color{"color14"}."A0:70-150 ms",
|
||||
"STACK:r3".$color{"color18"}."A0:150-300 ms",
|
||||
"STACK:roundtrip".$color{"color25"}.":>300 ms\\j",
|
||||
"CDEF:roundavg=roundtrip,PREV(roundtrip),+,2,/",
|
||||
"CDEF:r0=roundtrip,30,MIN",
|
||||
"CDEF:r1=roundtrip,70,MIN",
|
||||
"CDEF:r2=roundtrip,150,MIN",
|
||||
"CDEF:r3=roundtrip,300,MIN",
|
||||
"AREA:roundtrip".$color{"color25"}."A0:>300 ms",
|
||||
"AREA:r3".$color{"color18"}."A0:150-300 ms",
|
||||
"AREA:r2".$color{"color14"}."A0:70-150 ms",
|
||||
"AREA:r1".$color{"color17"}."A0:30-70 ms",
|
||||
"AREA:r0".$color{"color12"}."A0:<30 ms\\j",
|
||||
"COMMENT:$Lang::tr{'maximal'}",
|
||||
"COMMENT:$Lang::tr{'average'}",
|
||||
"COMMENT:$Lang::tr{'minimal'}",
|
||||
@@ -380,7 +386,7 @@ sub updatehddgraph {
|
||||
|
||||
RRDs::graph ("$graphs/hddtemp-$disk-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-z", "-W www.ipfire.org",
|
||||
"--alt-y-grid", "-w 600", "-h 150",
|
||||
"--alt-y-grid", "-w 600", "-h 100",
|
||||
"--color", "SHADEA".$color{"color19"},
|
||||
"--color", "SHADEB".$color{"color19"},
|
||||
"--color", "BACK".$color{"color21"},
|
||||
@@ -388,8 +394,8 @@ sub updatehddgraph {
|
||||
"DEF:temperature=$rrdlog/hddtemp-$disk.rrd:temperature:AVERAGE",
|
||||
"DEF:standby=$rrdlog/hddshutdown-$disk.rrd:standby:AVERAGE",
|
||||
"CDEF:st=standby,INF,*",
|
||||
"AREA:st".$color{"color20"}.":standby",
|
||||
"LINE2:temperature".$color{"color11"}.":$Lang::tr{'hdd temperature in'} C\\j",
|
||||
"AREA:st".$color{"color20"}."A0:standby",
|
||||
"LINE3:temperature".$color{"color11"}."A0:$Lang::tr{'hdd temperature in'} C\\j",
|
||||
"COMMENT:$Lang::tr{'maximal'}",
|
||||
"COMMENT:$Lang::tr{'average'}",
|
||||
"COMMENT:$Lang::tr{'minimal'}",
|
||||
@@ -403,132 +409,6 @@ sub updatehddgraph {
|
||||
print "Error in RRD::graph for hdd-$disk: $ERROR\n" if $ERROR;
|
||||
}
|
||||
|
||||
sub updatetempgraph
|
||||
{
|
||||
my $type = "temp";
|
||||
my $period = $_[0];
|
||||
my $count = "11";
|
||||
|
||||
@args = ("$graphs/mbmon-$type-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-z", "-W www.ipfire.org",
|
||||
"--alt-y-grid", "-w 600", "-h 150", "--alt-autoscale",
|
||||
"--color", "SHADEA".$color{"color19"},
|
||||
"--color", "SHADEB".$color{"color19"},
|
||||
"--color", "BACK".$color{"color21"},
|
||||
"-t $Lang::tr{'mbmon temp'} ($Lang::tr{'graph per'} $Lang::tr{$period})",
|
||||
"COMMENT:$Lang::tr{'caption'}\\t\\t",
|
||||
"COMMENT:$Lang::tr{'maximal'}",
|
||||
"COMMENT:$Lang::tr{'average'}",
|
||||
"COMMENT:$Lang::tr{'minimal'}",
|
||||
"COMMENT:$Lang::tr{'current'}\\j",);
|
||||
|
||||
foreach $key ( sort(keys %mbmon_values) )
|
||||
{
|
||||
if ( (index($key, $type) != -1) && ($mbmon_settings{'LINE-'.$key} eq 'on') )
|
||||
{
|
||||
if ( !defined($mbmon_settings{'LABEL-'.$key}) || ($mbmon_settings{'LABEL-'.$key} eq '') )
|
||||
{
|
||||
$mbmon_settings{'LABEL-'.$key} = $key;
|
||||
}
|
||||
push (@args, "DEF:$key=$rrdlog/mbmon.rrd:$key:AVERAGE");
|
||||
push (@args, "LINE2:".$key.$color{"color$count"}.":$mbmon_settings{'LABEL-'.$key} Grad C");
|
||||
push (@args, "GPRINT:$key:MAX:%3.1lf");
|
||||
push (@args, "GPRINT:$key:AVERAGE:%3.1lf");
|
||||
push (@args, "GPRINT:$key:MIN:%3.1lf");
|
||||
push (@args, "GPRINT:$key:LAST:%3.1lf\\j");
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
RRDs::graph ( @args );
|
||||
$ERROR = RRDs::error;
|
||||
print("Error in RRD::graph for temp: $ERROR\n")if $ERROR;
|
||||
}
|
||||
|
||||
sub updatefangraph
|
||||
{
|
||||
my $type = "fan";
|
||||
my $period = $_[0];
|
||||
my $count = "11";
|
||||
|
||||
@args = ("$graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z", "-W www.ipfire.org",
|
||||
"--alt-y-grid", "-w 600", "-h 150", "--alt-autoscale",
|
||||
"--color", "SHADEA".$color{"color19"},
|
||||
"--color", "SHADEB".$color{"color19"},
|
||||
"--color", "BACK".$color{"color21"},
|
||||
"-t $Lang::tr{'mbmon fan'} ($Lang::tr{'graph per'} $Lang::tr{$period})",
|
||||
"COMMENT:$Lang::tr{'caption'}\\t\\t",
|
||||
"COMMENT:$Lang::tr{'maximal'}",
|
||||
"COMMENT:$Lang::tr{'average'}",
|
||||
"COMMENT:$Lang::tr{'minimal'}",
|
||||
"COMMENT:$Lang::tr{'current'}\\j",);
|
||||
|
||||
foreach $key ( sort(keys %mbmon_values) )
|
||||
{
|
||||
if ( (index($key, $type) != -1) && ($mbmon_settings{'LINE-'.$key} eq 'on') )
|
||||
{
|
||||
if ( !defined($mbmon_settings{'LABEL-'.$key}) || ($mbmon_settings{'LABEL-'.$key} eq '') )
|
||||
{
|
||||
$mbmon_settings{'LABEL-'.$key} = $key;
|
||||
}
|
||||
|
||||
push(@args, "DEF:$key=$rrdlog/mbmon.rrd:$key:AVERAGE");
|
||||
push(@args, "LINE2:".$key.$color{"color$count"}.":$mbmon_settings{'LABEL-'.$key} rpm");
|
||||
push(@args, "GPRINT:$key:MAX:%5.0lf");
|
||||
push(@args, "GPRINT:$key:AVERAGE:%5.0lf");
|
||||
push(@args, "GPRINT:$key:MIN:%5.0lf");
|
||||
push(@args, "GPRINT:$key:LAST:%5.0lf\\j");
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
RRDs::graph ( @args );
|
||||
$ERROR = RRDs::error;
|
||||
print("Error in RRD::graph for temp: $ERROR\n")if $ERROR;
|
||||
}
|
||||
|
||||
sub updatevoltgraph
|
||||
{
|
||||
my $type = "volt";
|
||||
my $period = $_[0];
|
||||
my $count = "11";
|
||||
|
||||
@args = ("$graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z", "-W www.ipfire.org",
|
||||
"--alt-y-grid", "-w 600", "-h 150", "--alt-autoscale",
|
||||
"--color", "SHADEA".$color{"color19"},
|
||||
"--color", "SHADEB".$color{"color19"},
|
||||
"--color", "BACK".$color{"color21"},
|
||||
"-t $Lang::tr{'mbmon volt'} ($Lang::tr{'graph per'} $Lang::tr{$period})",
|
||||
"COMMENT:$Lang::tr{'caption'}\\t",
|
||||
"COMMENT:$Lang::tr{'maximal'}",
|
||||
"COMMENT:$Lang::tr{'average'}",
|
||||
"COMMENT:$Lang::tr{'minimal'}",
|
||||
"COMMENT:$Lang::tr{'current'}\\j",);
|
||||
|
||||
foreach $key ( sort(keys %mbmon_values) )
|
||||
{
|
||||
my $v = substr($key,0,1);
|
||||
if ( ($v eq 'v') && ($mbmon_settings{'LINE-'.$key} eq 'on') )
|
||||
{
|
||||
if ( !defined($mbmon_settings{'LABEL-'.$key}) || ($mbmon_settings{'LABEL-'.$key} eq '') )
|
||||
{
|
||||
$mbmon_settings{'LABEL-'.$key} = $key;
|
||||
}
|
||||
|
||||
push(@args, "DEF:$key=$rrdlog/mbmon.rrd:$key:AVERAGE");
|
||||
push(@args, "LINE2:".$key.$color{"color$count"}.":$mbmon_settings{'LABEL-'.$key} Volt");
|
||||
push(@args, "GPRINT:$key:MAX:%3.2lf");
|
||||
push(@args, "GPRINT:$key:AVERAGE:%3.2lf");
|
||||
push(@args, "GPRINT:$key:MIN:%3.2lf");
|
||||
push(@args, "GPRINT:$key:LAST:%3.2lf\\j");
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
RRDs::graph ( @args );
|
||||
$ERROR = RRDs::error;
|
||||
print("Error in RRD::graph for temp: $ERROR\n")if $ERROR;
|
||||
}
|
||||
|
||||
sub overviewgraph {
|
||||
|
||||
my $period = $_[0];
|
||||
@@ -556,7 +436,7 @@ sub overviewgraph {
|
||||
my $color="#000000";
|
||||
my @command=("/srv/web/ipfire/html/graphs/qos-graph-$qossettings{'DEV'}-$period.png",
|
||||
"--start", $periodstring, "-aPNG", "-i", "-z", "-W www.ipfire.org",
|
||||
"--alt-y-grid", "-w 600", "-h 150", "-r",
|
||||
"--alt-y-grid", "-w 600", "-h 100", "-r",
|
||||
"--color", "SHADEA".$color{"color19"},
|
||||
"--color", "SHADEB".$color{"color19"},
|
||||
"--color", "BACK".$color{"color21"},
|
||||
@@ -604,3 +484,85 @@ sub random_hex_color {
|
||||
push @color, @hex[rand(@hex)] for 1 .. $size;
|
||||
return join('', '#', @color);
|
||||
}
|
||||
|
||||
sub updatehwtempgraph {
|
||||
|
||||
my $period = $_[0];
|
||||
|
||||
my @command = ("$graphs/mbmon-hwtemp-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-W www.ipfire.org",
|
||||
"--alt-y-grid", "-w 600", "-h 100",
|
||||
"--color", "SHADEA".$color{"color19"},"--color",
|
||||
"SHADEB".$color{"color19"},"--color",
|
||||
"BACK".$color{"color21"},
|
||||
"-t $Lang::tr{'mbmon temp'} $Lang::tr{'graph per'} $Lang::tr{$period}");
|
||||
|
||||
foreach(@mbmongraphs){
|
||||
chomp($_);
|
||||
if ( $_ =~ /temperature/ ) {my @name=split(/\./,$_);if ( $mbmonsettings{'LINE-'.$name[0]} eq "off" ){next;}push(@command,"DEF:".$mbmonsettings{'LABEL-'.$name[0]}."=$rrdlog/collectd/localhost/mbmon/".$_.":value:AVERAGE");
|
||||
}
|
||||
}
|
||||
push(@command,"COMMENT:".sprintf("%-29s",$Lang::tr{'caption'}),"COMMENT:$Lang::tr{'maximal'}","COMMENT:$Lang::tr{'average'}","COMMENT:$Lang::tr{'minimal'}","COMMENT:$Lang::tr{'current'}\\j");
|
||||
foreach(@mbmongraphs){
|
||||
chomp($_);
|
||||
if ( $_ =~ /temperature/ ) {my @name=split(/\./,$_);if ( $mbmonsettings{'LINE-'.$name[0]} eq "off" ){next;}push(@command,"LINE3:".$mbmonsettings{'LABEL-'.$name[0]}.random_hex_color(6)."A0:".sprintf("%-25s",$mbmonsettings{'LABEL-'.$name[0]}),
|
||||
"GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":MAX:%3.2lf C","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":AVERAGE:%3.2lf C","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":MIN:%3.2lf C","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":LAST:%3.2lf C\\j",);}
|
||||
}
|
||||
RRDs::graph (@command);
|
||||
$ERROR = RRDs::error;
|
||||
print "$ERROR";
|
||||
}
|
||||
|
||||
sub updatehwvoltgraph {
|
||||
|
||||
my $period = $_[0];
|
||||
|
||||
my @command = ("$graphs/mbmon-hwvolt-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-W www.ipfire.org",
|
||||
"--alt-y-grid", "-w 600", "-h 100",
|
||||
"--color", "SHADEA".$color{"color19"},"--color",
|
||||
"SHADEB".$color{"color19"},"--color",
|
||||
"BACK".$color{"color21"},
|
||||
"-t $Lang::tr{'mbmon volt'} $Lang::tr{'graph per'} $Lang::tr{$period}");
|
||||
|
||||
foreach(@mbmongraphs){
|
||||
chomp($_);
|
||||
if ( $_ =~ /voltage/ ) {my @name=split(/\./,$_);if ( $mbmonsettings{'LINE-'.$name[0]} eq "off" ){next;}push(@command,"DEF:".$mbmonsettings{'LABEL-'.$name[0]}."=$rrdlog/collectd/localhost/mbmon/".$_.":value:AVERAGE");}
|
||||
}
|
||||
push(@command,"COMMENT:".sprintf("%-29s",$Lang::tr{'caption'}),"COMMENT:$Lang::tr{'maximal'}","COMMENT:$Lang::tr{'average'}","COMMENT:$Lang::tr{'minimal'}","COMMENT:$Lang::tr{'current'}\\j");
|
||||
foreach(@mbmongraphs){
|
||||
chomp($_);
|
||||
if ( $_ =~ /voltage/ ) {my @name=split(/\./,$_);if ( $mbmonsettings{'LINE-'.$name[0]} eq "off" ){next;}push(@command,"LINE3:".$mbmonsettings{'LABEL-'.$name[0]}.random_hex_color(6)."A0:".sprintf("%-25s",$mbmonsettings{'LABEL-'.$name[0]}),
|
||||
"GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":MAX:%3.2lf V","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":AVERAGE:%3.2lf V","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":MIN:%3.2lf V","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":LAST:%3.2lf V\\j",);}
|
||||
}
|
||||
RRDs::graph (@command);
|
||||
$ERROR = RRDs::error;
|
||||
print "$ERROR";
|
||||
}
|
||||
|
||||
sub updatehwfangraph {
|
||||
|
||||
my $period = $_[0];
|
||||
|
||||
my @command = ("$graphs/mbmon-hwfan-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-W www.ipfire.org",
|
||||
"--alt-y-grid", "-w 600", "-h 100",
|
||||
"--color", "SHADEA".$color{"color19"},"--color",
|
||||
"SHADEB".$color{"color19"},"--color",
|
||||
"BACK".$color{"color21"},
|
||||
"-t $Lang::tr{'mbmon fan'} $Lang::tr{'graph per'} $Lang::tr{$period}");
|
||||
|
||||
foreach(@mbmongraphs){
|
||||
chomp($_);
|
||||
if ( $_ =~ /fanspeed/ ) {my @name=split(/\./,$_);if ( $mbmonsettings{'LINE-'.$name[0]} eq "off" ){next;}push(@command,"DEF:".$mbmonsettings{'LABEL-'.$name[0]}."=$rrdlog/collectd/localhost/mbmon/".$_.":value:AVERAGE");}
|
||||
}
|
||||
push(@command,"COMMENT:".sprintf("%-29s",$Lang::tr{'caption'}),"COMMENT:$Lang::tr{'maximal'}","COMMENT:$Lang::tr{'average'}","COMMENT:$Lang::tr{'minimal'}","COMMENT:$Lang::tr{'current'}\\j");
|
||||
foreach(@mbmongraphs){
|
||||
chomp($_);
|
||||
if ( $_ =~ /fanspeed/ ) {my @name=split(/\./,$_);if ( $mbmonsettings{'LINE-'.$name[0]} eq "off" ){next;}push(@command,"LINE3:".$mbmonsettings{'LABEL-'.$name[0]}.random_hex_color(6)."A0:".sprintf("%-25s",$mbmonsettings{'LABEL-'.$name[0]}),
|
||||
"GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":MAX:%5.0lf RPM","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":AVERAGE:%5.0lf RPM","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":MIN:%5.0lf RPM","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":LAST:%5.0lf RPM\\j",);}
|
||||
}
|
||||
RRDs::graph (@command);
|
||||
$ERROR = RRDs::error;
|
||||
print "$ERROR";
|
||||
}
|
||||
|
||||
@@ -9,3 +9,7 @@ lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/net/r8168.ko
|
||||
lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/usb/net/mcs7830.ko
|
||||
lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/ieee1394/sbp2.ko
|
||||
/sbin/kudzu
|
||||
var/ipfire/langs
|
||||
srv/web/html/
|
||||
srv/web/ipfire/cgi-bin/outgoingfw.cgi
|
||||
etc/init.d/squid
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
. /opt/pakfire/lib/functions.sh
|
||||
extract_files
|
||||
depmod -a
|
||||
perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
|
||||
|
||||
12
config/rootfiles/core/7/files
Normal file
12
config/rootfiles/core/7/files
Normal file
@@ -0,0 +1,12 @@
|
||||
etc/collectd.conf
|
||||
etc/init.d/collectd
|
||||
srv/web/ipfire/cgi-bin/graphs.cgi
|
||||
srv/web/ipfire/cgi-bin/hardwaregraphs.cgi
|
||||
srv/web/ipfire/cgi-bin/network.cgi
|
||||
usr/lib/collectd
|
||||
usr/local/bin/makegraphs
|
||||
usr/sbin/collectd
|
||||
var/ipfire/graphs.pl
|
||||
var/ipfire/menu.d/20-status.menu
|
||||
|
||||
|
||||
1
config/rootfiles/core/7/meta
Normal file
1
config/rootfiles/core/7/meta
Normal file
@@ -0,0 +1 @@
|
||||
DEPS=""
|
||||
6
config/rootfiles/core/7/update.sh
Normal file
6
config/rootfiles/core/7/update.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
. /opt/pakfire/lib/functions.sh
|
||||
extract_files
|
||||
ln -s /etc/rc.d/rc0.d/K50collectd /etc/init.d/collectd
|
||||
ln -s /etc/rc.d/rc3.d/S20collectd /etc/init.d/collectd
|
||||
ln -s /etc/rc.d/rc6.d/K50collectd /etc/init.d/collectd
|
||||
@@ -158,8 +158,6 @@ WARNING: translation string unused: hostname and domain already in use
|
||||
WARNING: translation string unused: hours2
|
||||
WARNING: translation string unused: ibod for dual isdn only
|
||||
WARNING: translation string unused: id
|
||||
WARNING: translation string unused: idle cpu
|
||||
WARNING: translation string unused: idle cpu usage
|
||||
WARNING: translation string unused: import
|
||||
WARNING: translation string unused: importkey
|
||||
WARNING: translation string unused: in
|
||||
@@ -175,14 +173,12 @@ WARNING: translation string unused: invalid port list
|
||||
WARNING: translation string unused: invalid time entered
|
||||
WARNING: translation string unused: invalid uplink speed
|
||||
WARNING: translation string unused: invalid upstream proxy username or password setting
|
||||
WARNING: translation string unused: iowait
|
||||
WARNING: translation string unused: ip address in use
|
||||
WARNING: translation string unused: ip alias added
|
||||
WARNING: translation string unused: ip alias changed
|
||||
WARNING: translation string unused: ip alias removed
|
||||
WARNING: translation string unused: ipfire side
|
||||
WARNING: translation string unused: iptable rules
|
||||
WARNING: translation string unused: irq cpu usage
|
||||
WARNING: translation string unused: isdn
|
||||
WARNING: translation string unused: isdn settings
|
||||
WARNING: translation string unused: isdn1
|
||||
@@ -217,13 +213,11 @@ WARNING: translation string unused: max outgoing size
|
||||
WARNING: translation string unused: max size
|
||||
WARNING: translation string unused: mbmon fan in
|
||||
WARNING: translation string unused: mbmon graphs
|
||||
WARNING: translation string unused: mbmon settings
|
||||
WARNING: translation string unused: mbmon temp in
|
||||
WARNING: translation string unused: min size
|
||||
WARNING: translation string unused: minutes
|
||||
WARNING: translation string unused: missing dat
|
||||
WARNING: translation string unused: missing gz
|
||||
WARNING: translation string unused: mode
|
||||
WARNING: translation string unused: modem on com1
|
||||
WARNING: translation string unused: modem on com2
|
||||
WARNING: translation string unused: modem on com3
|
||||
@@ -297,7 +291,6 @@ WARNING: translation string unused: proxy no proxy extend
|
||||
WARNING: translation string unused: proxy no proxy local
|
||||
WARNING: translation string unused: proxy port
|
||||
WARNING: translation string unused: psk
|
||||
WARNING: translation string unused: read sectors
|
||||
WARNING: translation string unused: reboot schedule
|
||||
WARNING: translation string unused: rebooting
|
||||
WARNING: translation string unused: refresh update list
|
||||
@@ -312,14 +305,11 @@ WARNING: translation string unused: root user password
|
||||
WARNING: translation string unused: route subnet is invalid
|
||||
WARNING: translation string unused: safe removal of umounted device
|
||||
WARNING: translation string unused: save error
|
||||
WARNING: translation string unused: sectors read from disk per second
|
||||
WARNING: translation string unused: sectors written to disk per second
|
||||
WARNING: translation string unused: select media
|
||||
WARNING: translation string unused: send email notification
|
||||
WARNING: translation string unused: send test mail
|
||||
WARNING: translation string unused: server reserved
|
||||
WARNING: translation string unused: shaping list options
|
||||
WARNING: translation string unused: shared memory
|
||||
WARNING: translation string unused: shutdown control
|
||||
WARNING: translation string unused: shutdown2
|
||||
WARNING: translation string unused: shutting down
|
||||
@@ -337,8 +327,6 @@ WARNING: translation string unused: subject test
|
||||
WARNING: translation string unused: subject warn
|
||||
WARNING: translation string unused: subnet
|
||||
WARNING: translation string unused: successfully refreshed updates list
|
||||
WARNING: translation string unused: system cpu
|
||||
WARNING: translation string unused: system cpu usage
|
||||
WARNING: translation string unused: system log viewer
|
||||
WARNING: translation string unused: system status information
|
||||
WARNING: translation string unused: test
|
||||
@@ -393,7 +381,6 @@ WARNING: translation string unused: urlfilter upload background
|
||||
WARNING: translation string unused: use
|
||||
WARNING: translation string unused: use dov
|
||||
WARNING: translation string unused: use ibod
|
||||
WARNING: translation string unused: user cpu usage
|
||||
WARNING: translation string unused: view log
|
||||
WARNING: translation string unused: vpn on blue
|
||||
WARNING: translation string unused: vpn on green
|
||||
@@ -402,18 +389,5 @@ WARNING: translation string unused: warn when traffic reaches
|
||||
WARNING: translation string unused: web proxy configuration
|
||||
WARNING: translation string unused: week
|
||||
WARNING: translation string unused: weekly firewallhits
|
||||
WARNING: translation string unused: written sectors
|
||||
WARNING: translation string unused: xtaccess bad transfert
|
||||
WARNING: translation string unused: yearly firewallhits
|
||||
WARNING: untranslated string: cached swap
|
||||
WARNING: untranslated string: cpu idle usage
|
||||
WARNING: untranslated string: cpu interrupt usage
|
||||
WARNING: untranslated string: cpu iowait usage
|
||||
WARNING: untranslated string: cpu nice usage
|
||||
WARNING: untranslated string: cpu steal usage
|
||||
WARNING: untranslated string: cpu system usage
|
||||
WARNING: untranslated string: cpu user usage
|
||||
WARNING: untranslated string: network internal
|
||||
WARNING: untranslated string: network traffic graphs others
|
||||
WARNING: untranslated string: read bytes
|
||||
WARNING: untranslated string: written bytes
|
||||
|
||||
@@ -184,8 +184,6 @@ WARNING: translation string unused: hostname and domain already in use
|
||||
WARNING: translation string unused: hours2
|
||||
WARNING: translation string unused: ibod for dual isdn only
|
||||
WARNING: translation string unused: id
|
||||
WARNING: translation string unused: idle cpu
|
||||
WARNING: translation string unused: idle cpu usage
|
||||
WARNING: translation string unused: import
|
||||
WARNING: translation string unused: importkey
|
||||
WARNING: translation string unused: in
|
||||
@@ -202,14 +200,12 @@ WARNING: translation string unused: invalid port list
|
||||
WARNING: translation string unused: invalid time entered
|
||||
WARNING: translation string unused: invalid uplink speed
|
||||
WARNING: translation string unused: invalid upstream proxy username or password setting
|
||||
WARNING: translation string unused: iowait
|
||||
WARNING: translation string unused: ip address in use
|
||||
WARNING: translation string unused: ip alias added
|
||||
WARNING: translation string unused: ip alias changed
|
||||
WARNING: translation string unused: ip alias removed
|
||||
WARNING: translation string unused: ipfire side
|
||||
WARNING: translation string unused: iptable rules
|
||||
WARNING: translation string unused: irq cpu usage
|
||||
WARNING: translation string unused: isdn
|
||||
WARNING: translation string unused: isdn settings
|
||||
WARNING: translation string unused: isdn1
|
||||
@@ -244,13 +240,11 @@ WARNING: translation string unused: max outgoing size
|
||||
WARNING: translation string unused: max size
|
||||
WARNING: translation string unused: mbmon fan in
|
||||
WARNING: translation string unused: mbmon graphs
|
||||
WARNING: translation string unused: mbmon settings
|
||||
WARNING: translation string unused: mbmon temp in
|
||||
WARNING: translation string unused: min size
|
||||
WARNING: translation string unused: minutes
|
||||
WARNING: translation string unused: missing dat
|
||||
WARNING: translation string unused: missing gz
|
||||
WARNING: translation string unused: mode
|
||||
WARNING: translation string unused: modem on com1
|
||||
WARNING: translation string unused: modem on com2
|
||||
WARNING: translation string unused: modem on com3
|
||||
@@ -326,7 +320,6 @@ WARNING: translation string unused: proxy no proxy local
|
||||
WARNING: translation string unused: proxy port
|
||||
WARNING: translation string unused: psk
|
||||
WARNING: translation string unused: quick control
|
||||
WARNING: translation string unused: read sectors
|
||||
WARNING: translation string unused: reboot schedule
|
||||
WARNING: translation string unused: rebooting
|
||||
WARNING: translation string unused: refresh update list
|
||||
@@ -341,15 +334,12 @@ WARNING: translation string unused: root user password
|
||||
WARNING: translation string unused: route subnet is invalid
|
||||
WARNING: translation string unused: safe removal of umounted device
|
||||
WARNING: translation string unused: save error
|
||||
WARNING: translation string unused: sectors read from disk per second
|
||||
WARNING: translation string unused: sectors written to disk per second
|
||||
WARNING: translation string unused: select media
|
||||
WARNING: translation string unused: send email notification
|
||||
WARNING: translation string unused: send test mail
|
||||
WARNING: translation string unused: server reserved
|
||||
WARNING: translation string unused: shaping add options
|
||||
WARNING: translation string unused: shaping list options
|
||||
WARNING: translation string unused: shared memory
|
||||
WARNING: translation string unused: show areas
|
||||
WARNING: translation string unused: show lines
|
||||
WARNING: translation string unused: shutdown control
|
||||
@@ -369,8 +359,6 @@ WARNING: translation string unused: subject test
|
||||
WARNING: translation string unused: subject warn
|
||||
WARNING: translation string unused: subnet
|
||||
WARNING: translation string unused: successfully refreshed updates list
|
||||
WARNING: translation string unused: system cpu
|
||||
WARNING: translation string unused: system cpu usage
|
||||
WARNING: translation string unused: system log viewer
|
||||
WARNING: translation string unused: system status information
|
||||
WARNING: translation string unused: test
|
||||
@@ -426,8 +414,6 @@ WARNING: translation string unused: urlfilter upload background
|
||||
WARNING: translation string unused: use
|
||||
WARNING: translation string unused: use dov
|
||||
WARNING: translation string unused: use ibod
|
||||
WARNING: translation string unused: user cpu
|
||||
WARNING: translation string unused: user cpu usage
|
||||
WARNING: translation string unused: view log
|
||||
WARNING: translation string unused: vpn on blue
|
||||
WARNING: translation string unused: vpn on green
|
||||
@@ -436,18 +422,5 @@ WARNING: translation string unused: warn when traffic reaches
|
||||
WARNING: translation string unused: web proxy configuration
|
||||
WARNING: translation string unused: week
|
||||
WARNING: translation string unused: weekly firewallhits
|
||||
WARNING: translation string unused: written sectors
|
||||
WARNING: translation string unused: xtaccess bad transfert
|
||||
WARNING: translation string unused: yearly firewallhits
|
||||
WARNING: untranslated string: cached swap
|
||||
WARNING: untranslated string: cpu idle usage
|
||||
WARNING: untranslated string: cpu interrupt usage
|
||||
WARNING: untranslated string: cpu iowait usage
|
||||
WARNING: untranslated string: cpu nice usage
|
||||
WARNING: untranslated string: cpu steal usage
|
||||
WARNING: untranslated string: cpu system usage
|
||||
WARNING: untranslated string: cpu user usage
|
||||
WARNING: untranslated string: network internal
|
||||
WARNING: untranslated string: network traffic graphs others
|
||||
WARNING: untranslated string: read bytes
|
||||
WARNING: untranslated string: written bytes
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -389,6 +389,7 @@
|
||||
'cache size' => 'Cache-Größe (MB):',
|
||||
'cached' => 'zwischengespeichert',
|
||||
'cached memory' => 'Cache Speicher ',
|
||||
'cached swap' => 'Gecachter Swap',
|
||||
'calamaris available reports' => 'Verfügbare Berichte',
|
||||
'calamaris byte unit' => 'Byte Einheit',
|
||||
'calamaris create report' => 'Bericht erstellen',
|
||||
@@ -495,8 +496,15 @@
|
||||
'could not open update information file' => 'Datei mit den Update-Information konnte nicht geöffnet werden. Die Update-Datei ist beschädigt.',
|
||||
'could not retrieve common name from certificate' => 'Der Gemeinsame Name (CN) konnte nicht aus dem Zertifikat gelesen werden.',
|
||||
'country' => 'Land',
|
||||
'cpu irq usage' => 'IRQ CPU Nutzung ',
|
||||
'cpu idle usage' => 'Leerlauf CPU Nutzung',
|
||||
'cpu interrupt usage' => 'Interrupt CPU Nutzung',
|
||||
'cpu iowait usage' => 'CPU wartet auf IO',
|
||||
'cpu irq usage' => 'IRQ CPU Nutzung',
|
||||
'cpu nice usage' => 'Nice CPU Nutzung',
|
||||
'cpu steal usage' => 'Steal CPU Nutzung',
|
||||
'cpu system usage' => 'System CPU Nutzung',
|
||||
'cpu usage per' => 'CPU-Nutzung pro',
|
||||
'cpu user usage' => 'Benutzer CPU Nutzung',
|
||||
'create' => 'Erzeuge',
|
||||
'create mask' => 'UNIX Rechte für neue Dateien',
|
||||
'create new backup' => 'Einen neuen Sicherungssatz anlegen',
|
||||
@@ -824,8 +832,6 @@
|
||||
'icmp type' => 'ICMP-Typ',
|
||||
'id' => 'ID',
|
||||
'idle' => 'Leerlauf',
|
||||
'idle cpu' => 'CPU Leerlauf',
|
||||
'idle cpu usage' => 'Leerlauf CPU Nutzung',
|
||||
'idle timeout' => 'Leerlauf-Wartezeit in min (0 zum Deaktivieren):',
|
||||
'idle timeout not set' => 'Leerlauf-Wartezeit nicht angegeben.',
|
||||
'ids log viewer' => 'Ansicht IDS-Log',
|
||||
@@ -927,7 +933,6 @@
|
||||
'invalid vpi vpci' => 'Ungültige VPI/VPCI-Einstellungen',
|
||||
'invalid wins address' => 'Ungültige WINS Server Addresse.',
|
||||
'invert' => 'Invertieren',
|
||||
'iowait' => 'CPU wartet auf IO ',
|
||||
'ip address' => 'IP-Adresse',
|
||||
'ip address in use' => 'IP-Adresse bereits vergeben',
|
||||
'ip address outside subnets' => 'IP-Adresse ausserhalb der(s) lokalen Subnetze(s)',
|
||||
@@ -945,7 +950,6 @@
|
||||
'iptmangles' => 'IPTable Mangles',
|
||||
'iptnats' => 'IPTable Network Address Translation',
|
||||
'ipts' => 'IPTables',
|
||||
'irq cpu usage' => 'IRQ Cpu Nutzung ',
|
||||
'isdn' => 'ISDN',
|
||||
'isdn settings' => 'Zusätzliche ISDN-Einstellungen:',
|
||||
'isdn1' => 'Einfaches ISDN',
|
||||
@@ -1114,8 +1118,9 @@
|
||||
'network' => 'Netzwerk',
|
||||
'network added' => 'Benutzerdefiniertes Netzwerk hinzugefügt',
|
||||
'network configuration' => 'Netzwerk Konfiguration',
|
||||
'network internal' => 'Netzwerk (intern)',
|
||||
'network options' => 'Netzwerk Optionen',
|
||||
'network other' => 'Netzwerk (intern)',
|
||||
'network other' => 'Netzwerk (sonstige)',
|
||||
'network red' => 'Netzwerk (extern)',
|
||||
'network removed' => 'Benutzerdefiniertes Netzwerk entfernt',
|
||||
'network status information' => 'Netzwerk-Statusinformationen',
|
||||
@@ -1124,6 +1129,7 @@
|
||||
'network traffic graphs' => 'Diagramme zur Netzwerkauslastung',
|
||||
'network traffic graphs external' => 'Net-Traffic-Diagramme (extern)',
|
||||
'network traffic graphs internal' => 'Net-Traffic-Diagramme (intern)',
|
||||
'network traffic graphs others' => 'Netzwerk (sonstige)',
|
||||
'network updated' => 'Benutzerdefiniertes Netzwerk aktualisiert',
|
||||
'networks settings' => 'Firewall - Netzwerkeinstellungen',
|
||||
'new optionsfw later' => 'Ihre Modifikation(en) wird (werden) beim nächsten Neustart aktiv werden',
|
||||
@@ -1195,6 +1201,11 @@
|
||||
'outgoing' => 'ausgehend',
|
||||
'outgoing firewall' => 'Ausgehende Firewall',
|
||||
'outgoing traffic in bytes per second' => 'Abgehender Verkehr in Bytes pro Sekunde',
|
||||
'outgoingfw mode0' => 'In diesem Modus ist es allen Rechnern im Netzwerk uneingeschraenkt moeglich Verbindungen ins Internet aufzubauen.',
|
||||
'outgoingfw mode1' => 'In diesem Modus werden nur Verbindungen nach den oben definierten Regeln zugelassen.',
|
||||
'outgoingfw mode2' => 'In diesem Modus werden saemtliche Verbindungen erlaubt, bis auf die oben definierten Block-Regeln.',
|
||||
'outgoingfw p2p description' => 'Klicken Sie auf die Symbole um das entsprechende iptables P2P-Blockmodul zu (de-)aktivieren.',
|
||||
'outgoingfw reset' => 'Alle Regeln loeschen',
|
||||
'override mtu' => 'Überschreibe Standard MTU',
|
||||
'ovpn' => 'OpenVPN',
|
||||
'ovpn con stat' => 'OpenVPN Verbindungs-Statistik',
|
||||
@@ -1269,6 +1280,7 @@
|
||||
'pkcs12 file password' => 'PKCS12 Datei-Passwort',
|
||||
'play' => 'Play',
|
||||
'polfile' => 'Polfile',
|
||||
'policy' => 'Richtlinie',
|
||||
'port' => 'Port',
|
||||
'port forwarding configuration' => 'Konfiguration der Port-Weiterleitung',
|
||||
'ports' => 'Ports',
|
||||
@@ -1314,8 +1326,8 @@
|
||||
'qos graphs' => 'Qos Diagramme',
|
||||
'quick playlist' => 'Quick Playlist',
|
||||
'ram' => 'RAM-Speicher',
|
||||
'read bytes' => 'Gelesene Bytes',
|
||||
'read list' => 'Liste der Leseberechtigten',
|
||||
'read sectors' => 'Sektoren lesen',
|
||||
'real address' => 'Reale Addresse',
|
||||
'reboot' => 'Neustart',
|
||||
'reboot schedule' => 'Zeitsteuerung für IPFire Neustarts',
|
||||
@@ -1387,8 +1399,6 @@
|
||||
'secondary wins server address' => 'Sekundäre WINS-Server Adresse',
|
||||
'seconds' => 'sek.',
|
||||
'section' => 'Abschnitt',
|
||||
'sectors read from disk per second' => 'Von Platte gelesene Sektoren pro Sekunde',
|
||||
'sectors written to disk per second' => 'Auf Platte geschriebene Sektoren pro Sekunde',
|
||||
'secure shell server' => 'Secure Shell Server',
|
||||
'security' => 'Sicherheit',
|
||||
'security options' => 'Sicherheitsoptionen',
|
||||
@@ -1418,7 +1428,6 @@
|
||||
'settings' => 'Konfiguration',
|
||||
'shaping list options' => 'Datenflußkontrolldienste',
|
||||
'shared' => 'shared',
|
||||
'shared memory' => 'Gemeins. Speicher ',
|
||||
'sharename' => 'Freigabename',
|
||||
'shares' => 'Freigaben',
|
||||
'show ajax speedmeter in footer' => 'Ajax Speed Anzeige',
|
||||
@@ -1519,8 +1528,6 @@
|
||||
'swap' => 'Swap',
|
||||
'swap usage per' => 'Nutzung von Auslagerungsspeicher (Swap) pro',
|
||||
'system' => 'System',
|
||||
'system cpu' => 'System CPU',
|
||||
'system cpu usage' => 'System CPU Nutzung ',
|
||||
'system graphs' => 'System-Diagramme',
|
||||
'system log viewer' => 'Betrachter der System-Logdateien',
|
||||
'system logs' => 'System-Logdateien',
|
||||
@@ -1886,7 +1893,6 @@
|
||||
'used memory' => 'Genutzter Speicher',
|
||||
'used swap' => 'Genutzter Swap',
|
||||
'user' => 'Benutzer',
|
||||
'user cpu usage' => 'Benutzer CPU Nutzung',
|
||||
'user log' => 'Benutzer Log',
|
||||
'user proxy logs' => 'Benutzer Proxy Log',
|
||||
'username' => 'Benutzername:',
|
||||
@@ -1950,7 +1956,7 @@
|
||||
'wireless configuration' => 'Wireless-Konfiguration',
|
||||
'wol wakeup' => 'WakeUp',
|
||||
'workgroup' => 'Arbeitsgruppe',
|
||||
'written sectors' => 'Sektoren schr.',
|
||||
'written bytes' => 'Geschriebene Bytes',
|
||||
'xtaccess all error' => 'Sie können einen externen Zugang nicht auf \'ALL\' setzen - dies erfolgt in den Port-Weiterleitungsregeln.',
|
||||
'xtaccess bad transfert' => 'Wenn Sie einen Port Zielbereich angeben, muss der Quellbereich identisch sein!',
|
||||
'year' => 'Jahr',
|
||||
|
||||
@@ -408,6 +408,7 @@
|
||||
'cache size' => 'Cache size (MB):',
|
||||
'cached' => 'cached',
|
||||
'cached memory' => 'Cached Memory ',
|
||||
'cached swap' => 'Cached Swap',
|
||||
'calamaris available reports' => 'Available reports',
|
||||
'calamaris byte unit' => 'Byte unit',
|
||||
'calamaris create report' => 'Create report',
|
||||
@@ -516,8 +517,15 @@
|
||||
'could not open update information file' => 'Could not open update information file. The update file is corrupt.',
|
||||
'could not retrieve common name from certificate' => 'Could not retrieve common name from certificate.',
|
||||
'country' => 'Country',
|
||||
'cpu irq usage' => 'IRQ CPU Usage ',
|
||||
'cpu idle usage' => 'Idle CPU Usage',
|
||||
'cpu interrupt usage' => 'Interrupt CPU Usage',
|
||||
'cpu iowait usage' => 'CPU waiting for IO',
|
||||
'cpu irq usage' => 'IRQ CPU Usage',
|
||||
'cpu nice usage' => 'Nice CPU Usage',
|
||||
'cpu steal usage' => 'Steal CPU Usage',
|
||||
'cpu system usage' => 'System CPU Usage',
|
||||
'cpu usage per' => 'CPU Usage per',
|
||||
'cpu user usage' => 'User CPU Usage',
|
||||
'create' => 'Create',
|
||||
'create mask' => 'UNIX rights for new created files',
|
||||
'create new backup' => 'Create a new backup set',
|
||||
@@ -850,8 +858,6 @@
|
||||
'icmp type' => 'ICMP Type',
|
||||
'id' => 'ID',
|
||||
'idle' => 'Idle',
|
||||
'idle cpu' => 'Idle CPU',
|
||||
'idle cpu usage' => 'Idle CPU Usage ',
|
||||
'idle timeout' => 'Idle timeout (mins; 0 to disable):',
|
||||
'idle timeout not set' => 'Idle timeout not set.',
|
||||
'ids log viewer' => 'IDS log viewer',
|
||||
@@ -873,7 +879,7 @@
|
||||
'inactive' => 'inactive',
|
||||
'include logfiles' => 'include logfiles',
|
||||
'incoming' => 'incoming',
|
||||
'incoming traffic in bytes per second' => 'Incoming Traffic in Bytes per Second',
|
||||
'incoming traffic in bytes per second' => 'Incoming Traffic',
|
||||
'incorrect password' => 'Incorrect password',
|
||||
'info' => 'Info',
|
||||
'init string' => 'Init:',
|
||||
@@ -954,7 +960,6 @@
|
||||
'invalid vpi vpci' => 'Invalid VPI/VPCI settings',
|
||||
'invalid wins address' => 'Invalid WINS Server address.',
|
||||
'invert' => 'Invert',
|
||||
'iowait' => 'CPU waiting for IO',
|
||||
'ip address' => 'IP Address',
|
||||
'ip address in use' => 'IP address already in use',
|
||||
'ip address outside subnets' => 'IP Address outside subnets',
|
||||
@@ -972,7 +977,6 @@
|
||||
'iptmangles' => 'IPTable Mangles',
|
||||
'iptnats' => 'IPTable Network Address Translation',
|
||||
'ipts' => 'IPTables',
|
||||
'irq cpu usage' => 'IRQ Cpu Usage ',
|
||||
'isdn' => 'ISDN',
|
||||
'isdn settings' => 'Additional ISDN settings:',
|
||||
'isdn1' => 'Single ISDN',
|
||||
@@ -1141,8 +1145,9 @@
|
||||
'network' => 'Network',
|
||||
'network added' => 'Custom Network added',
|
||||
'network configuration' => 'Network Configuration',
|
||||
'network internal' => 'Network (internal)',
|
||||
'network options' => 'Network Options',
|
||||
'network other' => 'network (internal)',
|
||||
'network other' => 'network (other)',
|
||||
'network red' => 'network (external)',
|
||||
'network removed' => 'Custom Network removed',
|
||||
'network status information' => 'Network Status Information',
|
||||
@@ -1151,6 +1156,7 @@
|
||||
'network traffic graphs' => 'Network traffic graphs',
|
||||
'network traffic graphs external' => 'Net-Traffic graphs (external)',
|
||||
'network traffic graphs internal' => 'Net-Traffic graphs (internal)',
|
||||
'network traffic graphs others' => 'Network (others)',
|
||||
'network updated' => 'Custom Network updated',
|
||||
'networks settings' => 'Firewall - Network settings',
|
||||
'new optionsfw later' => 'Your modification(s) will be active on next restart',
|
||||
@@ -1222,7 +1228,12 @@
|
||||
'out' => 'Out',
|
||||
'outgoing' => 'outgoing',
|
||||
'outgoing firewall' => 'Outgoing Firewall',
|
||||
'outgoing traffic in bytes per second' => 'Outgoing Traffic in Bytes per Second',
|
||||
'outgoing traffic in bytes per second' => 'Outgoing Traffic',
|
||||
'outgoingfw mode0' => 'Using this mode, all clients are able to access the internet without any restrictions.',
|
||||
'outgoingfw mode1' => 'Using this mode, only connections based on the defined rules are allowed.',
|
||||
'outgoingfw mode2' => 'Using this mode, all connections are allowed despited off the defined ones.',
|
||||
'outgoingfw p2p description' => 'Press the corresponding button to enable/disable the iptables p2p block modul.',
|
||||
'outgoingfw reset' => 'Reset all',
|
||||
'override mtu' => 'Override default MTU',
|
||||
'ovpn' => 'OpenVPN',
|
||||
'ovpn con stat' => 'OpenVPN Connection Statistics',
|
||||
@@ -1297,6 +1308,7 @@
|
||||
'pkcs12 file password' => 'PKCS12 File Password',
|
||||
'play' => 'play',
|
||||
'polfile' => 'Polfile',
|
||||
'policy' => 'Policy',
|
||||
'port' => 'Port',
|
||||
'port forwarding configuration' => 'Port forwarding configuration',
|
||||
'ports' => 'Ports',
|
||||
@@ -1343,8 +1355,8 @@
|
||||
'quick control' => 'Quick Control',
|
||||
'quick playlist' => 'Quick Playlist',
|
||||
'ram' => 'RAM',
|
||||
'read bytes' => 'Read Bytes',
|
||||
'read list' => 'list with readonly hosts',
|
||||
'read sectors' => 'Read Sectors',
|
||||
'real address' => 'Real Address',
|
||||
'reboot' => 'Reboot',
|
||||
'reboot schedule' => 'Schedule IPFire reboots',
|
||||
@@ -1416,8 +1428,6 @@
|
||||
'secondary wins server address' => 'Secondary WINS Server address',
|
||||
'seconds' => 'Secs',
|
||||
'section' => 'Section',
|
||||
'sectors read from disk per second' => 'Sectors read from disk per second',
|
||||
'sectors written to disk per second' => 'Sectors written to disk per second',
|
||||
'secure shell server' => 'Secure shell server',
|
||||
'security' => 'Security',
|
||||
'security options' => 'Security Options',
|
||||
@@ -1448,7 +1458,6 @@
|
||||
'shaping add options' => 'Add service',
|
||||
'shaping list options' => 'Traffic shaping services',
|
||||
'shared' => 'shared',
|
||||
'shared memory' => 'Shared Memory ',
|
||||
'sharename' => 'Sharename',
|
||||
'shares' => 'Shares',
|
||||
'show ajax speedmeter in footer' => 'Show Ajax Speedmeter',
|
||||
@@ -1551,8 +1560,6 @@
|
||||
'swap' => 'Swap',
|
||||
'swap usage per' => 'Swap Usage per',
|
||||
'system' => 'System',
|
||||
'system cpu' => 'System CPU',
|
||||
'system cpu usage' => 'System CPU Usage ',
|
||||
'system graphs' => 'System Graphs',
|
||||
'system log viewer' => 'System Log Viewer',
|
||||
'system logs' => 'System Logs',
|
||||
@@ -1919,8 +1926,6 @@
|
||||
'used memory' => 'Used Memory ',
|
||||
'used swap' => 'Used Swap',
|
||||
'user' => 'User',
|
||||
'user cpu' => 'User CPU',
|
||||
'user cpu usage' => 'User CPU Usage ',
|
||||
'user log' => 'user log',
|
||||
'user proxy logs' => 'user proxy log',
|
||||
'username' => 'User Name:',
|
||||
@@ -1984,7 +1989,7 @@
|
||||
'wireless configuration' => 'Wireless Configuration',
|
||||
'wol wakeup' => 'WakeUp',
|
||||
'workgroup' => 'Workgroup',
|
||||
'written sectors' => 'Written Sectors',
|
||||
'written bytes' => 'Writen Bytes',
|
||||
'xtaccess all error' => 'You cannot set an external access to ALL, that is done in the port forwarding record.',
|
||||
'xtaccess bad transfert' => 'If you specify a port destination range, the source range must be identical !',
|
||||
'year' => 'Year',
|
||||
|
||||
@@ -29,230 +29,107 @@ use RRDs;
|
||||
require "/var/ipfire/general-functions.pl";
|
||||
require "${General::swroot}/lang.pl";
|
||||
|
||||
my (%settings, @ipacsum, $iface, $ERROR);
|
||||
&General::readhash("${General::swroot}/ethernet/settings", \%settings);
|
||||
my %mbmon_settings = ();
|
||||
&General::readhash("${General::swroot}/mbmon/settings", \%mbmon_settings);
|
||||
|
||||
# Added for conversion of utf-8 characters
|
||||
use Encode 'from_to';
|
||||
my %tr=();
|
||||
|
||||
system("chmod 777 /srv/web/ipfire/html/graphs");
|
||||
|
||||
# Force language back to English (ugly hack!)
|
||||
# Modified to only force if we are unable to convert charset
|
||||
# from utf-8
|
||||
if((${Lang::language} eq 'el') ||
|
||||
(${Lang::language} eq 'fa') ||
|
||||
(${Lang::language} eq 'ru') ||
|
||||
(${Lang::language} eq 'th') ||
|
||||
(${Lang::language} eq 'vi') ||
|
||||
(${Lang::language} eq 'zh') ||
|
||||
(${Lang::language} eq 'zt')) {
|
||||
eval `/bin/cat "${General::swroot}/langs/en.pl"`;
|
||||
} else {
|
||||
#use translated version for other languages
|
||||
%tr=%Lang::tr;
|
||||
}
|
||||
|
||||
# Settings
|
||||
my $rrdlog = "/var/log/rrd";
|
||||
my $graphs = "/srv/web/ipfire/html/graphs";
|
||||
$ENV{PATH}="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
|
||||
my $hdd_device = "/dev/harddisk";
|
||||
my $temp = '';
|
||||
my %mbmon_values = ();
|
||||
my $key;
|
||||
my $value;
|
||||
my @args = ();
|
||||
my $count = 0;
|
||||
my $rrdlog = '/var/log/rrd';
|
||||
my $ERROR;
|
||||
my $dbg = 0;
|
||||
my $path_smartctl = "/usr/sbin/smartctl";
|
||||
my $path_hddtemp = "/usr/sbin/hddtemp";
|
||||
|
||||
my %color = ();
|
||||
my %mainsettings = ();
|
||||
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
|
||||
&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
|
||||
|
||||
open(MBMON_OUT, ">/var/log/mbmon-values");
|
||||
open(FD, "/usr/bin/mbmon -rc1|" ) || die "ERROR: Cannot run mbmon\n" ;
|
||||
|
||||
while( $_ = <FD> )
|
||||
{
|
||||
next unless( /^([A-Za-z][^:\s]+)\s*:\s*([+\-]{0,1}[\d\.]+)/ ) ;
|
||||
$key = $1 ;
|
||||
$value = $2 ;
|
||||
$key =~ y/A-Z/a-z/ ;
|
||||
$mbmon_values{$key} = $value;
|
||||
print(MBMON_OUT "$key=$value\n");
|
||||
}
|
||||
close(FD);
|
||||
close(MBMON_OUT);
|
||||
|
||||
sub updatehdddata
|
||||
{
|
||||
my $disk = $_[0];
|
||||
my $standby;
|
||||
my @array = split(/\//,$disk);
|
||||
my $disk = $_[0];
|
||||
my $standby;
|
||||
my @array = split(/\//,$disk);
|
||||
|
||||
if ( ! -e "$rrdlog/hddshutdown-".$array[$#array].".rrd"){
|
||||
# database did not exist -> create
|
||||
RRDs::create ("$rrdlog/hddshutdown-".$array[$#array].".rrd", "--step=300",
|
||||
"DS:standby:GAUGE:600:0:1",
|
||||
"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 hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
}
|
||||
if ( ! -e "$rrdlog/hddshutdown-".$array[$#array].".rrd"){
|
||||
# database did not exist -> create
|
||||
RRDs::create ("$rrdlog/hddshutdown-".$array[$#array].".rrd", "--step=300",
|
||||
"DS:standby:GAUGE:600:0:1",
|
||||
"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 hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
}
|
||||
|
||||
if (-e "/tmp/hddshutdown-".$array[$#array]) {$standby = 1;}
|
||||
else {$standby = 0;}
|
||||
if (-e "/tmp/hddshutdown-".$array[$#array]) {$standby = 1;}
|
||||
else {$standby = 0;}
|
||||
|
||||
RRDs::update ("$rrdlog/hddshutdown-".$array[$#array].".rrd", "-t", "standby", "N:$standby");
|
||||
$ERROR = RRDs::error;
|
||||
print "Error in RRD::update for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
RRDs::update ("$rrdlog/hddshutdown-".$array[$#array].".rrd", "-t", "standby", "N:$standby");
|
||||
$ERROR = RRDs::error;
|
||||
print "Error in RRD::update for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
|
||||
if ( ! -e "$rrdlog/hddtemp-".$array[$#array].".rrd"){
|
||||
# database did not exist -> create
|
||||
RRDs::create ("$rrdlog/hddtemp-".$array[$#array].".rrd", "--step=300",
|
||||
"DS:temperature:GAUGE:600:0:100",
|
||||
"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 hdd-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
}
|
||||
if ( ! -e "$rrdlog/hddtemp-".$array[$#array].".rrd"){
|
||||
# database did not exist -> create
|
||||
RRDs::create ("$rrdlog/hddtemp-".$array[$#array].".rrd", "--step=300",
|
||||
"DS:temperature:GAUGE:600:0:100",
|
||||
"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 hdd-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
}
|
||||
|
||||
# Temperaturlesen w<>rde die Platte aufwecken!!!
|
||||
if (!$standby){
|
||||
$temp = 0;
|
||||
my $hdd_output = '';
|
||||
my $smart_output = '';
|
||||
if ( -e "$path_smartctl" ){system("$path_smartctl -iHA -d ata /dev/$disk > /var/log/smartctl_out_hddtemp-$disk");}
|
||||
if ( -e "/var/log/smartctl_out_hddtemp-".$array[$#array] ){
|
||||
$hdd_output = `cat /var/log/smartctl_out_hddtemp-$array[$#array] | grep Temperature_`;
|
||||
my @t = split(/\s+/,$hdd_output);
|
||||
$temp = $t[9];
|
||||
}else{$temp = 0;}
|
||||
print "Temperature for ".$array[$#array]."->".$temp."<-\n";
|
||||
system("echo \"Temperature for $array[$#array] -> $temp <-\n\" >>/tmp/debug");
|
||||
# Nur ins RDD wenn nicht 0 (sonst klappt die min Anzeige nicht)
|
||||
if ($temp){
|
||||
RRDs::update ("$rrdlog/hddtemp-".$array[$#array].".rrd", "-t", "temperature", "N:$temp");
|
||||
$ERROR = RRDs::error;
|
||||
print "Error in RRD::update for hdd-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub updatembmondata
|
||||
{
|
||||
if ( ! -e "$rrdlog/mbmon.rrd" ){
|
||||
# database did not exist -> create
|
||||
|
||||
@args = ("$rrdlog/mbmon.rrd");
|
||||
push(@args, "--step=300");
|
||||
foreach $key ( sort(keys %mbmon_values) ){push(@args, "DS:$key:GAUGE:600:U:U");}
|
||||
push(@args, "RRA:AVERAGE:0.5:1:576");
|
||||
push(@args, "RRA:AVERAGE:0.5:6:672");
|
||||
push(@args, "RRA:AVERAGE:0.5:24:732");
|
||||
push(@args, "RRA:AVERAGE:0.5:144:1460");
|
||||
|
||||
print("create ". join( ", ", @args)) if ( $dbg );
|
||||
RRDs::create (@args);
|
||||
$ERROR = RRDs::error;
|
||||
print("Error in RRD::create for mbmon: $ERROR\n") if $ERROR;
|
||||
}
|
||||
|
||||
my @ds;
|
||||
my @val;
|
||||
my $template;
|
||||
|
||||
foreach $key ( sort(keys %mbmon_values) ){
|
||||
push(@ds, $key);
|
||||
push(@val, $mbmon_values{$key});
|
||||
}
|
||||
|
||||
$template = join(':', @ds);
|
||||
$value = "N:".join(':', @val);
|
||||
|
||||
print("update template = '$template'\n") if ( $dbg );
|
||||
print("update value = '$value'\n") if ( $dbg );
|
||||
|
||||
RRDs::update("$rrdlog/mbmon.rrd", "-t", $template, $value);
|
||||
$ERROR = RRDs::error;
|
||||
print("Error in RRD::update for mbmon: $ERROR\n") if $ERROR;
|
||||
# Temperaturlesen w<>rde die Platte aufwecken!!!
|
||||
if (!$standby){
|
||||
$temp = 0;
|
||||
my $smart_output = '';
|
||||
system("$path_smartctl -iHA -d ata /dev/$disk > /var/log/smartctl_out_hddtemp-$disk");
|
||||
if ( -e "/var/log/smartctl_out_hddtemp-".$array[$#array] ){
|
||||
my $hdd_output = `cat /var/log/smartctl_out_hddtemp-$array[$#array] | grep Temperature_`;
|
||||
my @t = split(/\s+/,$hdd_output);
|
||||
$temp = $t[9];
|
||||
}else{$temp = 0;}
|
||||
print "Temperature for ".$array[$#array]."->".$temp."<-\n";
|
||||
# Nur ins RDD wenn nicht 0 (sonst klappt die min Anzeige nicht)
|
||||
if ($temp){
|
||||
RRDs::update ("$rrdlog/hddtemp-".$array[$#array].".rrd", "-t", "temperature", "N:$temp");
|
||||
$ERROR = RRDs::error;
|
||||
print "Error in RRD::update for hdd-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
## Update ipac logs
|
||||
system ('/usr/sbin/fetchipac');
|
||||
sleep 8;
|
||||
|
||||
###
|
||||
### Squid Graphs
|
||||
###
|
||||
if ( -e "/var/log/squid/access.log") {system ("/usr/bin/squid-graph -o=/srv/web/ipfire/html/sgraph --tcp-only < /var/log/squid/access.log >/dev/null 2>&1");}
|
||||
|
||||
###
|
||||
### utf8 conversion
|
||||
###
|
||||
if ((${Lang::language} eq 'cs') || (${Lang::language} eq 'hu') || (${Lang::language} eq 'pl') || (${Lang::language} eq 'sk')) {
|
||||
# Czech, Hungarian, Polish and Slovak character set
|
||||
foreach my $key(keys %Lang::tr) {from_to($tr{$key}, "utf-8", "iso-8859-2");}
|
||||
} elsif (${Lang::language} eq 'tr') {
|
||||
# Turkish
|
||||
foreach my $key(keys %Lang::tr) {from_to($tr{$key}, "utf-8", "iso-8859-9");}
|
||||
} else {
|
||||
foreach my $key(keys %Lang::tr) {from_to($tr{$key}, "utf-8", "iso-8859-1");}
|
||||
}
|
||||
|
||||
###
|
||||
### HDD graphs
|
||||
###
|
||||
|
||||
|
||||
my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
|
||||
system("unlink /tmp/hddstatus && touch /tmp/hddstatus");
|
||||
print "\nFound following amount of disks:".@disks."\n";
|
||||
foreach (@disks){
|
||||
my $disk = $_;
|
||||
chomp $disk;
|
||||
print "Working on disk ".$disk.".\n";
|
||||
my $disk = $_;
|
||||
chomp $disk;
|
||||
print "Working on disk ".$disk.".\n";
|
||||
|
||||
my $status = "";
|
||||
my $diskstats = "";
|
||||
my $newdiskstats = "";
|
||||
my @array = split(/\//,$disk);
|
||||
my $status = "";
|
||||
my $diskstats = "";
|
||||
my $newdiskstats = "";
|
||||
my @array = split(/\//,$disk);
|
||||
|
||||
$diskstats = `cat /tmp/hddstats-$array[$#array]`;
|
||||
chomp $diskstats;
|
||||
my $newdiskstats = `/usr/bin/iostat -d -t $disk | tail -2 | head -1 | awk '{ print \$5","\$6}'`;
|
||||
chomp $newdiskstats;
|
||||
my $status = `hdparm -C /dev/$disk | tail -1 | cut -d: -f2`;
|
||||
chomp $status;
|
||||
$diskstats = `cat /tmp/hddstats-$array[$#array]`;
|
||||
chomp $diskstats;
|
||||
my $newdiskstats = `/usr/bin/iostat -d -t $disk | tail -2 | head -1 | awk '{ print \$5","\$6}'`;
|
||||
chomp $newdiskstats;
|
||||
my $status = `hdparm -C /dev/$disk | tail -1 | cut -d: -f2`;
|
||||
chomp $status;
|
||||
|
||||
if ($status !~/standby/ || $diskstats ne $newdiskstats){
|
||||
if (-e "/tmp/hddshutdown-".$array[$#array]){system("unlink /tmp/hddshutdown-".$array[$#array]);}
|
||||
}
|
||||
if ($status !~/standby/ || $diskstats ne $newdiskstats){
|
||||
if (-e "/tmp/hddshutdown-".$array[$#array]){system("unlink /tmp/hddshutdown-".$array[$#array]);}
|
||||
}
|
||||
|
||||
if (-e "/tmp/hddshutdown-".$array[$#array]){$status = " standby\n";}
|
||||
else{$status = " active\n";}
|
||||
if (-e "/tmp/hddshutdown-".$array[$#array]){$status = " standby\n";}
|
||||
else{$status = " active\n";}
|
||||
|
||||
open(DATEI, ">>/tmp/hddstatus") || die "Datei nicht gefunden";
|
||||
print DATEI $disk."-".$status;
|
||||
close(DATEI);
|
||||
|
||||
updatehdddata($disk);
|
||||
open(DATEI, ">>/tmp/hddstatus") || die "Datei nicht gefunden";
|
||||
print DATEI $disk."-".$status;
|
||||
close(DATEI);
|
||||
|
||||
updatehdddata($disk);
|
||||
}
|
||||
|
||||
###
|
||||
### Mbmon Data
|
||||
###
|
||||
updatembmondata();
|
||||
|
||||
Reference in New Issue
Block a user