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
This commit is contained in:
ms
2007-01-07 13:58:16 +00:00
parent 05207d6927
commit 9217f23647
10 changed files with 212 additions and 73 deletions

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,2 @@
etc/fcdsl/fcdslusb.conf
usr/lib/isdn/fdsubase.frm

View File

@@ -1,4 +1,4 @@
sbin/debugreiserfs
#sbin/debugreiserfs
sbin/fsck.reiserfs
sbin/mkfs.reiserfs
sbin/mkreiserfs

View File

@@ -95,12 +95,44 @@ foreach $key ( sort(keys %mbmon_values) )
# print "$line = $cgiparams{$line}<br />\n";
# $debugCount++;
#}
#print "&nbsp;Count: $debugCount\n";
#print "&nbsp;Count: $debugCount<br />\n";
#print "&nbsp;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 "<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)/)
{
my $graph = $cgigraphs[1];
my $graphname = $Lang::tr{"mbmon $cgigraphs[1]"};
@@ -125,37 +157,6 @@ if ($cgigraphs[1] =~ /(temp|fan|volt)/)
print "<a href='/cgi-bin/mbmongraph.cgi'>";
print "$Lang::tr{'back'}</a></td></tr></table></div>\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 "<center>";
print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br /><hr />\n";
print "<img src='/graphs/hddtemp-day.png' border='0' /><hr />";
print "<img src='/graphs/hddtemp-week.png' border='0' /><hr />";
print "<img src='/graphs/hddtemp-month.png' border='0' /><hr />";
print "<img src='/graphs/hddtemp-year.png' border='0' />";
if ( -e "/var/log/hddgraph_smartctl_out" )
{
my $output = `/bin/cat /var/log/hddgraph_smartctl_out`;
$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/mbmongraph.cgi'>";
print "$Lang::tr{'back'}</a></td></tr></table></div>\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 "<center>";
print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br /><hr />\n";
print "<a href='/cgi-bin/hardwaregraphs.cgi?graph=hdd'>";
print "<img src='/graphs/hddtemp-day.png' border='0' /><hr />";
print "</a>";
}
else
{
print $Lang::tr{'no information available'};
}
print "<br />\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 <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='100%'>
<tr><td colspan='2'><input type='checkbox' name='TEMP' $selected_temp />&nbsp;$Lang::tr{'mbmon temp'} $Lang::tr{'graph'}</td></tr>
<tr><td colspan='2'><input type='checkbox' name='FAN' $selected_fan />&nbsp;$Lang::tr{'mbmon fan'} $Lang::tr{'graph'}</td></tr>
<tr><td colspan='2'><input type='checkbox' name='VOLT' $selected_volt />&nbsp;$Lang::tr{'mbmon volt'} $Lang::tr{'graph'}</td></tr>
<tr><td colspan='2'><input type='checkbox' name='HDD' $selected_hdd />&nbsp;$Lang::tr{'harddisk temperature'}-$Lang::tr{'graph'}</td></tr>
<tr><td colspan='2' align='left'><input type='checkbox' name='TEMP' $selected_temp />&nbsp;$Lang::tr{'mbmon temp'} $Lang::tr{'graph'}</td></tr>
<tr><td colspan='2' align='left'><input type='checkbox' name='FAN' $selected_fan />&nbsp;$Lang::tr{'mbmon fan'} $Lang::tr{'graph'}</td></tr>
<tr><td colspan='2' align='left'><input type='checkbox' name='VOLT' $selected_volt />&nbsp;$Lang::tr{'mbmon volt'} $Lang::tr{'graph'}</td></tr>
<tr><td colspan='2' align='left'><input type='checkbox' name='HDD' $selected_hdd />&nbsp;$Lang::tr{'harddisk temperature'}-$Lang::tr{'graph'}</td></tr>
</table>
<hr />
<table width='100%' border='0' cellspacing='1' cellpadding='0'>
@@ -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 "<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();
}
}

View File

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

View File

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

View File

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

View File

@@ -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'} <20>C",
"GPRINT:temperature:MAX:$tr{'maximal'}\\:%3.0lf <20>C",
"GPRINT:temperature:AVERAGE:$tr{'average'}\\:%3.0lf <20>C",
"GPRINT:temperature:LAST:$tr{'current'}\\:%3.0lf <20>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();