I have a problem where my SSD reports two temperatures, one incorrect (100C !!), and thus trips a warning. Any thoughts on how to limit the script to looking at just "194 Temperature_Celsius" and skipping "231 Temperature_Celsius"?
FIXED: On a hunch, I edited the script so that:
smartctl -A -i -v 7,hex48 /dev/"$drive" | \
Code:
smartctl -A -i -v 7,hex48 /dev/"$drive" | \
awk -v device="$drive" -v tempWarn="$tempWarn" -v tempCrit="$tempCrit" -v sectorsCrit="$sectorsCrit" \
-v testAgeWarn="$testAgeWarn" -v warnSymbol="$warnSymbol" -v critSymbol="$critSymbol" \
-v lastTestHours="$(smartctl -l selftest /dev/"$drive" | grep "# 1" | awk '{print $9}')" '\
/Serial Number:/{serial=$3} \
/Temperature_Celsius/{temp=$10} \
became:
Code:
/194 Temperature_Celsius/{temp=$10} \
and it worked.
====
########## SMART status report summary for all drives ##########
+------+---------------+----+-----+-----+-----+-------+-------+--------+------+------+------+-------+----+
|Device|Serial |Temp|Power|Start|Spin |ReAlloc|Current|Offline |UDMA |Seek |High |Command|Last|
| | | |On |Stop |Retry|Sectors|Pending|Uncorrec|CRC |Errors|Fly |Timeout|Test|
| | | |Hours|Count|Count| |Sectors|Sectors |Errors| |Writes|Count |Age |
+------+---------------+----+-----+-----+-----+-------+-------+--------+------+------+------+-------+----+
|ada3 !|FEB407710E08067424xx| 100 | 179| | | | | | | N/A| N/A| N/A| 6|
+------+---------------+----+-----+-----+-----+-------+-------+--------+------+------+------+-------+----+
Here's the full SMART data:
########## SMART status report for ada3 drive :) FEB407710E08067424xx) ##########
smartctl 6.5 2016-05-07 r4318 [FreeBSD 10.3-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
1 Raw_Read_Error_Rate 0x000b 100 100 050 Pre-fail Always - 0
9 Power_On_Hours 0x0012 100 100 000 Old_age Always - 179
12 Power_Cycle_Count 0x0012 100 100 000 Old_age Always - 12
168 Unknown_Attribute 0x0012 100 100 000 Old_age Always - 0
170 Unknown_Attribute 0x0003 088 088 010 Pre-fail Always - 147
173 Unknown_Attribute 0x0012 100 100 000 Old_age Always - 2
192 Power-Off_Retract_Count 0x0012 100 100 000 Old_age Always - 6
194 Temperature_Celsius 0x0023 067 067 000 Pre-fail Always - 33 (Min/Max 33/33)
218 Unknown_Attribute 0x000b 100 100 050 Pre-fail Always - 0
231 Temperature_Celsius 0x0013 100 100 000 Pre-fail Always - 100
241 Total_LBAs_Written 0x0012 100 100 000 Old_age Always - 7
No Errors Logged
Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
Extended offline Completed without error 00% 44 -