From e1e3dbe5a88eb6bdc0f2b13579bc7c3157eb2a84 Mon Sep 17 00:00:00 2001 From: maniacikarus Date: Sun, 27 Jan 2008 10:55:55 +0000 Subject: [PATCH] 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 --- config/cfgroot/graphs.pl | 280 +++++++++------------ config/rootfiles/core/6/files | 4 + config/rootfiles/core/6/update.sh | 1 + config/rootfiles/core/7/files | 12 + config/rootfiles/core/7/meta | 1 + config/rootfiles/core/7/update.sh | 6 + doc/language_issues.de | 26 -- doc/language_issues.en | 27 -- html/cgi-bin/graphs.cgi | 6 +- html/cgi-bin/hardwaregraphs.cgi | 404 +++++++++++------------------- html/cgi-bin/outgoingfw.cgi | 62 +++-- langs/de/cgi-bin/de.pl | 34 +-- langs/en/cgi-bin/en.pl | 39 +-- src/scripts/makegraphs | 287 ++++++--------------- 14 files changed, 448 insertions(+), 741 deletions(-) create mode 100644 config/rootfiles/core/7/files create mode 100644 config/rootfiles/core/7/meta create mode 100644 config/rootfiles/core/7/update.sh diff --git a/config/cfgroot/graphs.pl b/config/cfgroot/graphs.pl index 8523f61170..a01b4cc840 100644 --- a/config/cfgroot/graphs.pl +++ b/config/cfgroot/graphs.pl @@ -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); -} +&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color); 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"; +} diff --git a/config/rootfiles/core/6/files b/config/rootfiles/core/6/files index 31e0858f79..a7956cce1c 100644 --- a/config/rootfiles/core/6/files +++ b/config/rootfiles/core/6/files @@ -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 diff --git a/config/rootfiles/core/6/update.sh b/config/rootfiles/core/6/update.sh index 996249fa7a..621a4cdd05 100644 --- a/config/rootfiles/core/6/update.sh +++ b/config/rootfiles/core/6/update.sh @@ -2,3 +2,4 @@ . /opt/pakfire/lib/functions.sh extract_files depmod -a +perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang" diff --git a/config/rootfiles/core/7/files b/config/rootfiles/core/7/files new file mode 100644 index 0000000000..0a18ba3911 --- /dev/null +++ b/config/rootfiles/core/7/files @@ -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 + + diff --git a/config/rootfiles/core/7/meta b/config/rootfiles/core/7/meta new file mode 100644 index 0000000000..d547fa86fa --- /dev/null +++ b/config/rootfiles/core/7/meta @@ -0,0 +1 @@ +DEPS="" diff --git a/config/rootfiles/core/7/update.sh b/config/rootfiles/core/7/update.sh new file mode 100644 index 0000000000..85c6d53dfc --- /dev/null +++ b/config/rootfiles/core/7/update.sh @@ -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 diff --git a/doc/language_issues.de b/doc/language_issues.de index f3cc6c9291..30f00820d1 100644 --- a/doc/language_issues.de +++ b/doc/language_issues.de @@ -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 diff --git a/doc/language_issues.en b/doc/language_issues.en index 6fed88b97e..8ba981b483 100644 --- a/doc/language_issues.en +++ b/doc/language_issues.en @@ -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 diff --git a/html/cgi-bin/graphs.cgi b/html/cgi-bin/graphs.cgi index 47b043b266..282cb56594 100644 --- a/html/cgi-bin/graphs.cgi +++ b/html/cgi-bin/graphs.cgi @@ -118,10 +118,10 @@ if ($cgigraphs[1] =~ /(green|blue|orange|red|ipsec|lq|cpu|memory|swap|disk|load| print "
"; if ( $cgigraphs[1] eq "cpu" || $cgigraphs[1] eq "load" ) { print ""; } elsif ( $cgigraphs[1] eq "memory" || $cgigraphs[1] eq "swap" ) { print ""; } -elsif ( $cgigraphs[1] eq "memory" || $cgigraphs[1] eq "swap" ) { print ""; } elsif ( $cgigraphs[1] =~ /disk/ ) { print ""; } -elsif ( $cgigraphs[1] eq "RED" || $cgigraphs[1] eq "lq" ) { print ""; } -elsif ( $cgigraphs[1] eq "GREEN" || $cgigraphs[1] eq "BLUE" || $cgigraphs[1] eq "ORANGE" ) { print ""; } +elsif ( $cgigraphs[1] =~ /red/ || $cgigraphs[1] =~ /ipsec/ ) { print ""; } +elsif ( $cgigraphs[1] =~ /green/ || $cgigraphs[1] =~ /blue/ || $cgigraphs[1] =~ /orange/ ) { print ""; } +elsif ( $cgigraphs[1] eq "fwhits" || $cgigraphs[1] eq "lq" ) { print ""; } print "$Lang::tr{'back'}
\n"; &Header::closebigbox(); diff --git a/html/cgi-bin/hardwaregraphs.cgi b/html/cgi-bin/hardwaregraphs.cgi index b2c9408d84..0c88818772 100644 --- a/html/cgi-bin/hardwaregraphs.cgi +++ b/html/cgi-bin/hardwaregraphs.cgi @@ -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; - -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'); - - foreach my $line (sort keys %cgiparams) - { - if ( index($line, "LINE-") != -1 ) - { - $mbmon_settings{$line} = 'on'; - } +my @mbmongraphs = (); +if ( -e "/var/log/rrd/collectd/localhost/mbmon" ){@mbmongraphs = `ls /var/log/rrd/collectd/localhost/mbmon/`;} - if ( index($line, "LABEL-") != -1 ) - { - $mbmon_settings{$line} = $cgiparams{$line}; - } - } +&Header::getcgihash(\%mbmonsettings); - &General::writehash("${General::swroot}/mbmon/settings", \%mbmon_settings); -} -else -{ - &General::readhash("${General::swroot}/mbmon/settings", \%mbmon_settings); +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); } -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; - } -} +my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`; &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}
\n"; -# $debugCount++; -#} -#print " Count: $debugCount
\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 "
"; - print "$Lang::tr{'the statistics were last updated at'}: $ftime


\n"; - print "
"; - print "
"; - print "
"; - print ""; - if ( -e "/var/log/smartctl_out_${graph}" ) - { - my $output = `/bin/cat /var/log/smartctl_out_${graph}`; - $output = &Header::cleanhtml($output); - print "
$output
\n"; - } - } - else - { - print $Lang::tr{'no information available'}; - } - &Header::closebox(); - print "
"; - print ""; - print "$Lang::tr{'back'}
\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 "
"; - print "$Lang::tr{'the statistics were last updated at'}: $ftime


\n"; - print "
"; - print "
"; - print "
"; - print ""; - } - else - { - print $Lang::tr{'no information available'}; - } - &Header::closebox(); - print "
"; - print ""; - print "$Lang::tr{'back'}
\n"; +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 +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 "
$Lang::tr{'the statistics were last updated at'}: $ftime

\n"; - print ""; - print ""; - print ""; - } - else - { - print $Lang::tr{'no information available'}; - } - print "
\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 "
$Lang::tr{'the statistics were last updated at'}: $ftime

\n"; - print ""; - print ""; - print ""; - } - else - { - print $Lang::tr{'no information available'}; - } - print "
\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 "
$Lang::tr{'the statistics were last updated at'}: $ftime

\n"; - print ""; - print ""; - print ""; - } - else - { - print $Lang::tr{'no information available'}; - } - print "
\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 < - - - - - -
 $Lang::tr{'mbmon temp'} $Lang::tr{'graph'}
 $Lang::tr{'mbmon fan'} $Lang::tr{'graph'}
 $Lang::tr{'mbmon volt'} $Lang::tr{'graph'}
 $Lang::tr{'harddisk temperature'}-$Lang::tr{'graph'}
-
- - -END -; + &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 $i = 0; -foreach $key ( sort(keys %mbmon_values) ) -{ - if ( $i % 2 ) - { - print(""); - } - else - { - print(""); + &Header::openbox('100%', 'center', "Disk $disk $Lang::tr{'graph'}"); + my $ftime = localtime((stat("$graphdir/hddtemp-$disk-day.png"))[9]); + print "
$Lang::tr{'the statistics were last updated at'}: $ftime

\n"; + print ""; + print ""; + print ""; + print "
\n"; + &Header::closebox(); + } } - $mbmon_settings{'LABEL-'.$key} = &Header::cleanhtml($mbmon_settings{'LABEL-'.$key}); - print(""); - print("\n"); - print("\n"); - $i++; -} - -print < - -
$Lang::tr{'mbmon display'} $Lang::tr{'mbmon value'}$Lang::tr{'mbmon label'}
$key$mbmon_values{$key} 
- -
 
- -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 "
"; + print "$Lang::tr{'the statistics were last updated at'}: $ftime

\n"; + print ""; + print ""; + print "
"; + } + 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 "
$Lang::tr{'the statistics were last updated at'}: $ftime

\n"; - print ""; print ""; - print ""; print "
\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 "
$Lang::tr{'the statistics were last updated at'}: $ftime

\n"; + print ""; + print "
\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 "
$Lang::tr{'the statistics were last updated at'}: $ftime

\n"; + print ""; + print "
\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 "
"; + print "$Lang::tr{'the statistics were last updated at'}: $ftime

\n"; + print "
"; + } + 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 "
"; + print "$Lang::tr{'the statistics were last updated at'}: $ftime

\n"; + print "
"; + } + 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 "
"; + print "$Lang::tr{'the statistics were last updated at'}: $ftime

\n"; + print "
"; + } + 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 +; + foreach (@mbmongraphs){ + chomp($_);my @name=split(/\./,$_); + print(""); + print("\n"); + } + print < +
$Lang::tr{'mbmon display'}$Lang::tr{'mbmon label'}
+ +END +; + &Header::closebox(); } diff --git a/html/cgi-bin/outgoingfw.cgi b/html/cgi-bin/outgoingfw.cgi index dcb96b9372..61cae77137 100644 --- a/html/cgi-bin/outgoingfw.cgi +++ b/html/cgi-bin/outgoingfw.cgi @@ -253,13 +253,13 @@ END
- + + + + + + 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 <
Protokoll - Netzwerk - Ziel - Anmerkung - Politik - Logging - Aktionen + $Lang::tr{'protocol'}$Lang::tr{'network'}$Lang::tr{'destination'}$Lang::tr{'description'}$Lang::tr{'policy'}$Lang::tr{'logging'}$Lang::tr{'action'}Quell-IP-Adresse: +
$Lang::tr{'source ip'}: $outfwsettings{'DISPLAY_SIP'} - Quell-MAC-Adresse: - $outfwsettings{'DISPLAY_SMAC'} END ; @@ -370,8 +368,8 @@ if ($outfwsettings{'POLICY'} ne 'MODE0'){ &Header::openbox('100%', 'center', 'P2P-Block'); print < -
Protokoll - Status +
$Lang::tr{'protocol'} + $Lang::tr{'status'} END ; my $id = 1; @@ -408,7 +406,7 @@ END } print < -
Klicken Sie auf die Symbole um das entsprechende iptables P2P-Blockmodul zu (de-)aktivieren. +
$Lang::tr{'outgoingfw p2p description'} END ; &Header::closebox(); @@ -418,18 +416,18 @@ END print < - - - + + + -
Modus 0:In diesem Modus ist es allen Rechnern im Netzwerk uneingeschraenkt moeglich Verbindungen ins Internet aufzubauen.
Modus 1:In diesem Modus werden nur Verbindungen nach den oben definierten Regeln zugelassen.
Modus 2:In diesem Modus werden saemtliche Verbindungen erlaubt, bis auf die oben definierten Block-Regeln.
$Lang::tr{'mode'} 0:$Lang::tr{'outgoingfw mode0'}
$Lang::tr{'mode'} 1:$Lang::tr{'outgoingfw mode1'}
$Lang::tr{'mode'} 2:$Lang::tr{'outgoingfw mode2'}

+
END ; if ($outfwsettings{'POLICY'} ne 'MODE0') { print < + $Lang::tr{'outgoingfw reset'}: END ; } @@ -453,13 +451,13 @@ sub addrule print < - -
Anmerkung: +
$Lang::tr{'description'}: - Aktiviert: + $Lang::tr{'active'}: -
Protokoll: +
$Lang::tr{'protocol'}: - Sicherheitspolitik: + $Lang::tr{'policy'}: END ; @@ -469,10 +467,10 @@ END print "\t\t\tDENY\n"; } print <Quellnetz: +
$Lang::tr{'source net'}: Quell-IP-Adresse: + $Lang::tr{'source ip'}: -
Logging: +
$Lang::tr{'logging'}: Quell-MAC-Adresse: - -
Ziel-IP-Adresse: + + +
$Lang::tr{'destination ip'}: - Ziel-Port: + $Lang::tr{'destination port'}:
$Lang::tr{'this field may be blank'} @@ -510,7 +508,7 @@ if ($outfwsettings{'POLICY'} eq 'MODE1' || $outfwsettings{'POLICY'} eq 'MODE2') my @defservices = ; close FILE; -print ""; +print "
$Lang::tr{'service'}$Lang::tr{'description'}$Lang::tr{'port'}$Lang::tr{'protocol'}$Lang::tr{'source net'}$Lang::tr{'logging'}
"; foreach my $serviceline(@defservices) { my @service = split(/,/,$serviceline); diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 191f6cc950..656d5af7ce 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -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', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 92b1a02d31..67e307b0e0 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -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', diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs index 4e628b87a8..e2df127044 100644 --- a/src/scripts/makegraphs +++ b/src/scripts/makegraphs @@ -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( $_ = ) -{ - 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); - - 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;} - - 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; - } - - # 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; + 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 "/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; + + 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 $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 $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; - - 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";} - - open(DATEI, ">>/tmp/hddstatus") || die "Datei nicht gefunden"; - print DATEI $disk."-".$status; - close(DATEI); - - updatehdddata($disk); - + my $disk = $_; + chomp $disk; + print "Working on disk ".$disk.".\n"; + + 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; + + 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";} + + open(DATEI, ">>/tmp/hddstatus") || die "Datei nicht gefunden"; + print DATEI $disk."-".$status; + close(DATEI); + + updatehdddata($disk); } - -### -### Mbmon Data -### -updatembmondata(); -- 2.39.2
$Lang::tr{'service'}$Lang::tr{'description'}$Lang::tr{'port'}$Lang::tr{'protocol'}$Lang::tr{'source net'}$Lang::tr{'logging'}$Lang::tr{'action'}