mirror of
https://github.com/Spearfoot/FreeNAS-scripts
synced 2025-12-06 01:23:19 +00:00
Refined temperature detection to use "190 Airflow_Temperature" if "194 Temperature" is absent
This commit is contained in:
@@ -63,7 +63,10 @@ echo "=== DRIVES ==="
|
||||
|
||||
for drive in $drives; do
|
||||
serial=$(/usr/local/sbin/smartctl -i /dev/"${drive}" | grep "Serial Number" | awk '{print $3}')
|
||||
temp=$(/usr/local/sbin/smartctl -A /dev/"${drive}" | grep "194 Temperature_Celsius" | awk '{print $10}')
|
||||
temp=$(/usr/local/sbin/smartctl -A /dev/"${drive}" | grep "194 Temperature" | awk '{print $10}')
|
||||
if [ -z "$temp" ]; then
|
||||
temp=$(/usr/local/sbin/smartctl -A /dev/"${drive}" | grep "190 Airflow_Temperature" | awk '{print $10}')
|
||||
fi
|
||||
brand=$(/usr/local/sbin/smartctl -i /dev/"${drive}" | grep "Model Family" | awk '{print $3, $4, $5}')
|
||||
if [ -z "$brand" ]; then
|
||||
brand=$(/usr/local/sbin/smartctl -i /dev/"${drive}" | grep "Device Model" | awk '{print $3, $4, $5}')
|
||||
|
||||
@@ -76,7 +76,8 @@ for drive in $drives; do
|
||||
awk -v device="${drive}" -v tempWarn=${tempWarn} -v tempCrit=${tempCrit} -v sectorsCrit=${sectorsCrit} \
|
||||
-v warnSymbol="${warnSymbol}" -v critSymbol=${critSymbol} '
|
||||
/Serial Number:/{serial=$3}
|
||||
/194 Temperature_Celsius/{temp=$10}
|
||||
/190 Airflow_Temperature/{temp=$10}
|
||||
/194 Temperature/{temp=$10}
|
||||
/Power_On_Hours/{split($10,a,"+");sub(/h/,"",a[1]);onHours=a[1];}
|
||||
/Start_Stop_Count/{startStop=$10}
|
||||
/Spin_Retry_Count/{spinRetry=$10}
|
||||
|
||||
Reference in New Issue
Block a user