FreeNAS-Report icon indicating copy to clipboard operation
FreeNAS-Report copied to clipboard

Temperature not read for all drives

Open dak180 opened this issue 6 years ago • 6 comments

It should pull from Temperature_Case or Temperature_Internal (or an average of the two):

########## SMART status report for ada0 drive (Intel 730 and: {serial}) ##########
smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-STABLE amd64] (local build)

SMART overall-health self-assessment test result: PASSED

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0032   100   100   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       2189
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       43
170 Available_Reservd_Space 0x0033   100   100   010    Pre-fail  Always       -       0
171 Program_Fail_Count      0x0032   100   100   000    Old_age   Always       -       0
172 Erase_Fail_Count        0x0032   100   100   000    Old_age   Always       -       0
174 Unsafe_Shutdown_Count   0x0032   100   100   000    Old_age   Always       -       39
175 Power_Loss_Cap_Test     0x0033   100   100   010    Pre-fail  Always       -       629 (12 9058)
183 SATA_Downshift_Count    0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0033   100   100   090    Pre-fail  Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
190 Temperature_Case        0x0022   080   072   000    Old_age   Always       -       20 (Min/Max 18/28)
192 Unsafe_Shutdown_Count   0x0032   100   100   000    Old_age   Always       -       39
194 Temperature_Internal    0x0022   100   100   000    Old_age   Always       -       27
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       0
199 CRC_Error_Count         0x003e   100   100   000    Old_age   Always       -       0
225 Host_Writes_32MiB       0x0032   100   100   000    Old_age   Always       -       2685
226 Workld_Media_Wear_Indic 0x0032   100   100   000    Old_age   Always       -       0
227 Workld_Host_Reads_Perc  0x0032   100   100   000    Old_age   Always       -       81
228 Workload_Minutes        0x0032   100   100   000    Old_age   Always       -       131164
232 Available_Reservd_Space 0x0033   100   100   010    Pre-fail  Always       -       0
233 Media_Wearout_Indicator 0x0032   100   100   000    Old_age   Always       -       0
234 Thermal_Throttle        0x0032   100   100   000    Old_age   Always       -       0/0
241 Host_Writes_32MiB       0x0032   100   100   000    Old_age   Always       -       2685
242 Host_Reads_32MiB        0x0032   100   100   000    Old_age   Always       -       15674

dak180 avatar May 28 '18 22:05 dak180

That looks like it's an SSD. The script's support for SSDs is currently minimal. I've been planning to improve SSD support, but they don't really need the same level of monitoring that platter drives do, so my motivation for it has been low.

If anyone wants to take a stab at it, go for it (and good luck; SMART attributes on SSDs are far from standardized).

edgarsuit avatar May 28 '18 22:05 edgarsuit

The other option is that instead of looking for the name look for the number instead, (194) that does seem to be fairly standard across drives even if the name is not.

dak180 avatar May 29 '18 12:05 dak180

That would be doable, but you would need some additional logic to make sure the number was in the first column of the table and not, say, in the RAW_VALUE column., Like I said, I'll probably get around to it eventually, but my motivation is low.

edgarsuit avatar May 29 '18 15:05 edgarsuit

smartctl -a "/dev/${hdNum}" | grep "^194" | sed -E 's:[[:space:]]+: :g' | cut -d ' ' -f 10

will give you the right value where ${hdNum} is the drive specifier.

dak180 avatar Jun 05 '18 14:06 dak180

First off, Thank you so much for this!!!! And I'm not sure if this is the right place to do this but I just wanted to add my voice in saying, I'd love for your amazing script to read SSD's as well. Right now I have a separate script that sends me my status on my Toshiba SAS SSD.

Thanks again for sharing your work!

itr6 avatar Oct 11 '18 18:10 itr6

That would be doable, but you would need some additional logic to make sure the number was in the first column of the table and not, say, in the RAW_VALUE column., Like I said, I'll probably get around to it eventually, but my motivation is low.

$1 ~ /^194/{temp=($10 + 0)} \ Should do it; $1 selects the first column ~ tells awk to use regex and ^ matches from the beginning. Testing with WD Reds, intel ssds and crucial ssds all worked.

dak180 avatar May 28 '19 00:05 dak180