Add S.M.A.R.T. fail warning to index.cgi.

This commit is contained in:
Arne Fitzenreiter
2009-10-15 00:14:34 +02:00
parent 61fcdf15f0
commit c1712013f4
3 changed files with 15 additions and 0 deletions

11
html/cgi-bin/index.cgi Executable file → Normal file
View File

@@ -417,6 +417,17 @@ foreach my $line (@df) {
}
}
# S.M.A.R.T. health warning
my @files = `/bin/ls /var/run/smartctl_out_hddtemp-*`;
foreach my $file (@files) {
chomp ($file);
my $disk=`echo $file | cut -d"-" -f2`;
chomp ($disk);
if (`/bin/grep "SAVE ALL DATA" $file`) {
$warnmessage .= "$Lang::tr{'smartwarn1'} $disk $Lang::tr{'smartwarn2'}<br>\n";
}
}
if ($warnmessage) {
print "<tr><td align='center' bgcolor=$Header::colourred colspan='3'><font color='white'>$warnmessage</font></table>";
}