From 9217f23647243b640713e1cac421db6597d60e12 Mon Sep 17 00:00:00 2001 From: ms Date: Sun, 7 Jan 2007 13:58:16 +0000 Subject: [PATCH] HDDTemp nun fuer jede Platte und nicht nur die erste :D git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@384 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- config/rootfiles/common/fcdsl | 7 ++ config/rootfiles/common/fcdsl2 | 6 ++ config/rootfiles/common/fcdslsl | 4 + config/rootfiles/common/fcdslusb | 2 + config/rootfiles/common/reiserfsprogs | 2 +- html/cgi-bin/hardwaregraphs.cgi | 114 +++++++++++---------- lfs/fcdslslusb | 4 + lfs/fcdslusb | 4 + lfs/fcpci | 4 + src/scripts/makegraphs | 138 ++++++++++++++++++++++---- 10 files changed, 212 insertions(+), 73 deletions(-) create mode 100644 config/rootfiles/common/fcdsl create mode 100644 config/rootfiles/common/fcdsl2 create mode 100644 config/rootfiles/common/fcdslsl create mode 100644 config/rootfiles/common/fcdslusb diff --git a/config/rootfiles/common/fcdsl b/config/rootfiles/common/fcdsl new file mode 100644 index 0000000000..9797453ac0 --- /dev/null +++ b/config/rootfiles/common/fcdsl @@ -0,0 +1,7 @@ +#etc/fcdsl +etc/fcdsl/fcdsl.conf +#lib/modules/2.6.16/extra +lib/modules/2.6.16/extra/fcdsl.ko +lib/modules/2.6.16-smp/extra/fcdsl.ko +#usr/lib/isdn +usr/lib/isdn/fdslbase.bin diff --git a/config/rootfiles/common/fcdsl2 b/config/rootfiles/common/fcdsl2 new file mode 100644 index 0000000000..83b36e0ef6 --- /dev/null +++ b/config/rootfiles/common/fcdsl2 @@ -0,0 +1,6 @@ +#etc/drdsl/drdsl +etc/drdsl/drdsl.ini +etc/fcdsl/fcdsl2.conf +lib/modules/2.6.16/extra/fcdsl2.ko +lib/modules/2.6.16-smp/extra/fcdsl2.ko +usr/lib/isdn/fds2base.bin diff --git a/config/rootfiles/common/fcdslsl b/config/rootfiles/common/fcdslsl new file mode 100644 index 0000000000..dbfe014d94 --- /dev/null +++ b/config/rootfiles/common/fcdslsl @@ -0,0 +1,4 @@ +etc/fcdsl/fcdslsl.conf +lib/modules/2.6.16/extra/fcdslsl.ko +lib/modules/2.6.16-smp/extra/fcdslsl.ko +usr/lib/isdn/fdssbase.bin diff --git a/config/rootfiles/common/fcdslusb b/config/rootfiles/common/fcdslusb new file mode 100644 index 0000000000..c3dffc2038 --- /dev/null +++ b/config/rootfiles/common/fcdslusb @@ -0,0 +1,2 @@ +etc/fcdsl/fcdslusb.conf +usr/lib/isdn/fdsubase.frm diff --git a/config/rootfiles/common/reiserfsprogs b/config/rootfiles/common/reiserfsprogs index 726acf20c1..266c423f42 100644 --- a/config/rootfiles/common/reiserfsprogs +++ b/config/rootfiles/common/reiserfsprogs @@ -1,4 +1,4 @@ -sbin/debugreiserfs +#sbin/debugreiserfs sbin/fsck.reiserfs sbin/mkfs.reiserfs sbin/mkreiserfs diff --git a/html/cgi-bin/hardwaregraphs.cgi b/html/cgi-bin/hardwaregraphs.cgi index ad3ff59dc1..0a1cf1d968 100644 --- a/html/cgi-bin/hardwaregraphs.cgi +++ b/html/cgi-bin/hardwaregraphs.cgi @@ -95,12 +95,44 @@ foreach $key ( sort(keys %mbmon_values) ) # print "$line = $cgiparams{$line}
\n"; # $debugCount++; #} -#print " Count: $debugCount\n"; +#print " Count: $debugCount
\n"; +#print " CGIParams: $cgigraphs[1]\n"; #&Header::closebox(); # DEBUG DEBUG ############### -if ($cgigraphs[1] =~ /(temp|fan|volt)/) +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)/) { my $graph = $cgigraphs[1]; my $graphname = $Lang::tr{"mbmon $cgigraphs[1]"}; @@ -125,37 +157,6 @@ if ($cgigraphs[1] =~ /(temp|fan|volt)/) print ""; print "$Lang::tr{'back'}\n"; } -elsif ($cgigraphs[1] =~ /(hdd)/) -{ - my $graph = $cgigraphs[1]; - my $graphname = $Lang::tr{"harddisk temperature"}; - &Header::openbox('100%', 'center', "$graphname $Lang::tr{'graph'}"); - - if (-e "$graphdir/hddtemp-day.png") - { - my $ftime = localtime((stat("$graphdir/hddtemp-day.png"))[9]); - print "
"; - print "$Lang::tr{'the statistics were last updated at'}: $ftime


\n"; - print "
"; - print "
"; - print "
"; - print ""; - if ( -e "/var/log/hddgraph_smartctl_out" ) - { - my $output = `/bin/cat /var/log/hddgraph_smartctl_out`; - $output = &Header::cleanhtml($output); - print "
$output
\n"; - } - } - else - { - print $Lang::tr{'no information available'}; - } - &Header::closebox(); - print "
"; - print ""; - print "$Lang::tr{'back'}
\n"; -} else { if ( $mbmon_settings{'GRAPH_TEMP'} == 1 ) @@ -217,32 +218,24 @@ else if ( $mbmon_settings{'GRAPH_HDD'} == 1 ) { - &Header::openbox('100%', 'center', $Lang::tr{'harddisk temperature'}); - if (-e "$graphdir/hddtemp-day.png") - { - my $ftime = localtime((stat("$graphdir/hddtemp-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'}; - } - print "
\n"; - &Header::closebox(); + hddtempbox("hda"); + hddtempbox("hdb"); + hddtempbox("hdc"); + hddtempbox("hdd"); + hddtempbox("hde"); + hddtempbox("hdf"); + hddtempbox("hdg"); + hddtempbox("hdh"); } &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'}
 $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'}

@@ -285,3 +278,18 @@ END &Header::closebigbox(); &Header::closepage(); + +sub hddtempbox { + my $disk = $_[0]; + if (-e "$graphdir/hddtemp-$disk-day.png") { + + &Header::openbox('100%', 'center', "Disk /dev/$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(); + } +} diff --git a/lfs/fcdslslusb b/lfs/fcdslslusb index 7bf78e2a08..d1c3073c0a 100644 --- a/lfs/fcdslslusb +++ b/lfs/fcdslslusb @@ -92,6 +92,8 @@ ifeq "$(SMP)" "" -include \$$(KRNLINCL)/linux/modversions.h' \ -e '/^DEFINES/a\ \ -DMODVERSIONS \\' src/Makefile + cd $(DIR_APP) && sed -i \ + -e 's/$$(shell uname -r)/$(KVER)/' Makefile else cd $(DIR_APP) && sed -i \ -e 's/$$(shell uname -m)/$(MACHINE)/' \ @@ -102,6 +104,8 @@ else -include \$$(KRNLINCL)/linux/modversions.h' \ -e '/^DEFINES/a\ \ -DMODVERSIONS \\' src/Makefile + cd $(DIR_APP) && sed -i \ + -e 's/$$(shell uname -r)/$(KVER)-smp/' Makefile endif cd $(DIR_APP) && CC="$(KGCC)" make cd $(DIR_APP) && CC="$(KGCC)" make install diff --git a/lfs/fcdslusb b/lfs/fcdslusb index b5040ddc76..539a27ce65 100644 --- a/lfs/fcdslusb +++ b/lfs/fcdslusb @@ -90,6 +90,8 @@ ifeq "$(SMP)" "" -include \$$(KRNLINCL)/linux/modversions.h' \ -e '/^DEFINES/a\ \ -DMODVERSIONS \\' src/Makefile + cd $(DIR_APP) && sed -i \ + -e 's/$$(shell uname -r)/$(KVER)/' Makefile else cd $(DIR_APP) && sed -i \ -e 's/$$(shell uname -m)/$(MACHINE)/' \ @@ -100,6 +102,8 @@ else -include \$$(KRNLINCL)/linux/modversions.h' \ -e '/^DEFINES/a\ \ -DMODVERSIONS \\' src/Makefile + cd $(DIR_APP) && sed -i \ + -e 's/$$(shell uname -r)/$(KVER)-smp/' Makefile endif cd $(DIR_APP) && CC="$(KGCC)" make cd $(DIR_APP) && CC="$(KGCC)" make install diff --git a/lfs/fcpci b/lfs/fcpci index 1adaabd27c..cfc769b835 100644 --- a/lfs/fcpci +++ b/lfs/fcpci @@ -87,6 +87,8 @@ ifeq "$(SMP)" "" -include \$$(KRNLINCL)/linux/modversions.h' \ -e '/^DEFINES/a\ \ -DMODVERSIONS \\' src/Makefile + cd $(DIR_APP) && sed -i \ + -e 's/$$(shell uname -r)/$(KVER)/' Makefile else cd $(DIR_APP) && sed -i \ -e 's/$$(shell uname -m)/$(MACHINE)/' \ @@ -97,6 +99,8 @@ else -include \$$(KRNLINCL)/linux/modversions.h' \ -e '/^DEFINES/a\ \ -DMODVERSIONS \\' src/Makefile + cd $(DIR_APP) && sed -i \ + -e 's/$$(shell uname -r)/$(KVER)-smp/' Makefile endif cd $(DIR_APP) && CC="$(KGCC)" make cd $(DIR_APP) && CC="$(KGCC)" make install diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs index 7d4ee24793..8a7011379a 100644 --- a/src/scripts/makegraphs +++ b/src/scripts/makegraphs @@ -753,17 +753,18 @@ sub updatelqgraph { sub updatehdddata { - if ( ! -e "$rrdlog/hddtemp.rrd") + my $disk = $_[0]; + if ( ! -e "$rrdlog/hddtemp-$disk.rrd") { # database did not exist -> create - RRDs::create ("$rrdlog/hddtemp.rrd", "--step=300", + RRDs::create ("$rrdlog/hddtemp-$disk.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: $ERROR\n" if $ERROR; + print "Error in RRD::create for hdd-$disk: $ERROR\n" if $ERROR; } $temp = 0; @@ -772,12 +773,12 @@ sub updatehdddata if ( -e "$path_smartctl" ) { - system("$path_smartctl -iHA $hdd_device > /var/log/hddgraph_smartctl_out"); + system("$path_smartctl -iHA /dev/$disk > /var/log/smartctl_out_hddtemp-$disk"); } if ( -e "$path_hddtemp" ) { - $hdd_output = `$path_hddtemp -qn $hdd_device`; + $hdd_output = `$path_hddtemp -qn /dev/$disk`; # I know 4 response possible responses: # @@ -794,7 +795,7 @@ sub updatehdddata { $temp = 1; } - elsif ( index($hdd_output, "$hdd_device") != -1 ) + elsif ( index($hdd_output, "$disk") != -1 ) { $hdd_output =~ /.*:.*:\s*(\d+).*\s/; $temp = $1; @@ -805,9 +806,9 @@ sub updatehdddata $temp = $1; } } - elsif ( -e "/var/log/hddgraph_smartctl_out" ) + elsif ( -e "/var/log/smartctl_out_hddtemp-$disk" ) { - $hdd_output = `cat /var/log/hddgraph_smartctl_out | grep Temperature_`; + $hdd_output = `cat /var/log/smartctl_out_hddtemp-$disk | grep Temperature_`; my @t = split(/\s+/,$hdd_output); $temp = $t[9]; } @@ -819,30 +820,31 @@ sub updatehdddata # print "hdd $hdd_output \n"; # print "temp $temp \n"; - RRDs::update ("$rrdlog/hddtemp.rrd", "-t", "temperature", "N:$temp"); + RRDs::update ("$rrdlog/hddtemp-$disk.rrd", "-t", "temperature", "N:$temp"); $ERROR = RRDs::error; - print "Error in RRD::update for hdd: $ERROR\n" if $ERROR; + print "Error in RRD::update for hdd-$disk: $ERROR\n" if $ERROR; } sub updatehddgraph { - my $period = $_[0]; + my $disk = $_[0]; + my $period = $_[1]; - RRDs::graph ("$graphs/hddtemp-$period.png", + RRDs::graph ("$graphs/hddtemp-$disk-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z", "--alt-y-grid", "-w 600", "-h 100", "--color", "SHADEA#EAE9EE", "--color", "SHADEB#EAE9EE", "--color", "BACK#FFFFFF", "-t $tr{'harddisk temperature'} ($tr{'graph per'} $tr{$period})", - "DEF:temperature=$rrdlog/hddtemp.rrd:temperature:AVERAGE", + "DEF:temperature=$rrdlog/hddtemp-$disk.rrd:temperature:AVERAGE", "LINE2:temperature#0000FF:$tr{'hdd temperature in'} °C", "GPRINT:temperature:MAX:$tr{'maximal'}\\:%3.0lf °C", "GPRINT:temperature:AVERAGE:$tr{'average'}\\:%3.0lf °C", "GPRINT:temperature:LAST:$tr{'current'}\\:%3.0lf °C", ); $ERROR = RRDs::error; - print "Error in RRD::graph for cpu: $ERROR\n" if $ERROR; + print "Error in RRD::graph for hdd-$disk: $ERROR\n" if $ERROR; } sub updatembmondata @@ -1198,11 +1200,109 @@ updatelqgraph("year"); ### ### HDDTEMP-Graphs for /dev/harddisk ### -updatehdddata(); -updatehddgraph ("day"); -updatehddgraph ("week"); -updatehddgraph ("month"); -updatehddgraph ("year"); +if (open STAT,"/dev/hda") { + close STAT; + updatehdddata ("hda"); + updatehddgraph ("hda","day"); + updatehddgraph ("hda","week"); + updatehddgraph ("hda","month"); + updatehddgraph ("hda","year"); +} else { + if (-e "$graphs/hddtemp-hda-day.png") { + system("rm $graphs/hddtemp-hda-day.png"); + } +} + +if (open STAT,"/dev/hdb") { + close STAT; + updatehdddata ("hdb"); + updatehddgraph ("hdb","day"); + updatehddgraph ("hdb","week"); + updatehddgraph ("hdb","month"); + updatehddgraph ("hdb","year"); +} else { + if (-e "$graphs/hddtemp-hdb-day.png") { + system("rm $graphs/hddtemp-hdb-day.png"); + } +} + +if (open STAT,"/dev/hdc") { + close STAT; + updatehdddata ("hdc"); + updatehddgraph ("hdc","day"); + updatehddgraph ("hdc","week"); + updatehddgraph ("hdc","month"); + updatehddgraph ("hdc","year"); +} else { + if (-e "$graphs/hddtemp-hdc-day.png") { + system("rm $graphs/hddtemp-hdc-day.png"); + } +} + +if (open STAT,"/dev/hdd") { + close STAT; + updatehdddata ("hdd"); + updatehddgraph ("hdd","day"); + updatehddgraph ("hdd","week"); + updatehddgraph ("hdd","month"); + updatehddgraph ("hdd","year"); +} else { + if (-e "$graphs/hddtemp-hdd-day.png") { + system("rm $graphs/hddtemp-hdd-day.png"); + } +} + +if (open STAT,"/dev/hde") { + close STAT; + updatehdddata ("hde"); + updatehddgraph ("hde","day"); + updatehddgraph ("hde","week"); + updatehddgraph ("hde","month"); + updatehddgraph ("hde","year"); +} else { + if (-e "$graphs/hddtemp-hde-day.png") { + system("rm $graphs/hddtemp-hde-day.png"); + } +} + +if (open STAT,"/dev/hdf") { + close STAT; + updatehdddata ("hdf"); + updatehddgraph ("hdf","day"); + updatehddgraph ("hdf","week"); + updatehddgraph ("hdf","month"); + updatehddgraph ("hdf","year"); +} else { + if (-e "$graphs/hddtemp-hdf-day.png") { + system("rm $graphs/hddtemp-hdf-day.png"); + } +} + +if (open STAT,"/dev/hdg") { + close STAT; + updatehdddata ("hdg"); + updatehddgraph ("hdg","day"); + updatehddgraph ("hdg","week"); + updatehddgraph ("hdg","month"); + updatehddgraph ("hdg","year"); +} else { + if (-e "$graphs/hddtemp-hdg-day.png") { + system("rm $graphs/hddtemp-hdg-day.png"); + } +} + +if (open STAT,"/dev/hdh") { + close STAT; + updatehdddata ("hdh"); + updatehddgraph ("hdh","day"); + updatehddgraph ("hdh","week"); + updatehddgraph ("hdh","month"); + updatehddgraph ("hdh","year"); +} else { + if (-e "$graphs/hddtemp-hdh-day.png") { + system("rm $graphs/hddtemp-hdh-day.png"); + } +} updatembmondata(); -- 2.39.2