Fwd: smartd scsi disk temperature patch
"Kirk Bauer" <[email protected]>
| Newsgroups | gmane.comp.log.logwatch.devel |
|---|---|
| Message-ID | <[email protected]> |
---------- Forwarded message ---------- From: Tom Shield <[email protected]> Date: Wed, 19 Dec 2007 18:26:48 -0600 (CST) Subject: smartd scsi disk temperature patch To: [email protected] Hello, Attached is a patch to the smartd script that adds reporting of scsi disk temperatures in the same manner as IDE disk temperatures. It takes the raw value of the temperature (in celsius) for the report. It comes before the standard attribute parsing that reports the scaled values instead of the raw values. I've tested this with smartmontools-5.37-3.3.fc7 and a 3ware raid controller. I read my logwatch reports every day and find them very useful. Regards, Tom -- Tom Shield [email protected] "The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts." --Bertrand Russell -- Kirk Bauer <[email protected]> http://linux.kaybee.org | www.logwatch.org Author, Automating UNIX & Linux Administration _______________________________________________ Logwatch-Devel mailing list [email protected] http://www2.list.logwatch.org:81/mailman/listinfo/logwatch-devel
smartd.v1.21-scsi-temp-patch
(text/plain, 1.6 KB)
--- smartd.v1.21 2007-12-16 15:03:31.094735185 -0600
+++ smartd.v1.21-mod 2007-12-16 20:15:54.824314448 -0600
@@ -1,6 +1,6 @@
##########################################################################
-# $Id: smartd,v 1.21 2007/04/09 14:46:46 kirk Exp $
+# $Id: smartd,v 1.21a 2007/12/16 14:46:46 kirk Exp $
##########################################################################
use strict;
@@ -89,9 +89,11 @@
# $ParamChanges{$Device}{$Msg}++;
} elsif ( ($Device) = ($ThisLine =~ /^Device: ([^,]+), not found in smartd database./ )) {
$NotInDatabase{$Device}++;
+ } elsif ( my ($Device,$AttribType,$Code,$Name,undef,undef,undef,$RawVal) = ($ThisLine =~ /^Device: ([^,]+), SMART ([A-Za-z]+) Attribute: ([0-9]+) (Temperature_Celsius) changed from ([0-9]+) (\[Raw [0-9]+\]) to ([0-9]+) \[Raw ([0-9]+)\]/)) {
+ push @{$TempChanges{$Device}}, $RawVal;
+ # smartd reports temperature changes this way only for SCSI disks
} elsif ( my ($Device,$AttribType,$Code,$Name,undef,undef,$NewVal) = ($ThisLine =~ /^Device: ([^,]+), SMART ([A-Za-z]+) Attribute: ([0-9]+) ([A-Za-z_]+) changed from ([0-9]+) (\[Raw [0-9]+\] )?to ([0-9]+)/)) {
push (@{$ParamChanges{$Device}{"$AttribType: $Name ($Code)"}}, $NewVal);
- # smartd reports temperature changes this way only for SCSI disks
} elsif ( my ($Device,$NewVal) = ($ThisLine =~ /^Device: ([^,]+), initial Temperature is (\d+) Celsius/)) {
push @{$TempChanges{$Device}},$NewVal;
} elsif ( my ($Device,$NewVal) = ($ThisLine =~ /^Device: ([^,]+), Temperature changed -?\d+ Celsius to (\d+) Celsius/)) {