1
0
mirror of https://github.com/Spearfoot/FreeNAS-scripts synced 2025-12-06 01:23:19 +00:00

inte 545s fixes (#15)

add checks for additional smart attibutes
This commit is contained in:
marunjar
2020-12-10 18:39:56 +01:00
committed by GitHub
parent befa2c5fe4
commit 8e22ba9709
2 changed files with 5 additions and 0 deletions

View File

@@ -113,6 +113,9 @@ for drive in $drives; do
serial=$("$smartctl" -i "$drive" | grep -i "serial number" | awk '{print $NF}') serial=$("$smartctl" -i "$drive" | grep -i "serial number" | awk '{print $NF}')
capacity=$("$smartctl" -i "$drive" | grep "User Capacity" | awk '{print $5 $6}') capacity=$("$smartctl" -i "$drive" | grep "User Capacity" | awk '{print $5 $6}')
temp=$("$smartctl" -A "$drive" | grep "194 Temperature" | awk '{print $10}') temp=$("$smartctl" -A "$drive" | grep "194 Temperature" | awk '{print $10}')
if [ -z "$temp" ]; then
temp=$("$smartctl" -A "$drive" | grep "190 Temperature_Case" | awk '{print $10}')
fi
if [ -z "$temp" ]; then if [ -z "$temp" ]; then
temp=$("$smartctl" -A "$drive" | grep "190 Airflow_Temperature" | awk '{print $10}') temp=$("$smartctl" -A "$drive" | grep "190 Airflow_Temperature" | awk '{print $10}')
fi fi

View File

@@ -115,8 +115,10 @@ if [ $SATA_count -gt 0 ]; then
-v lastTestHours="$lastTestHours" ' -v lastTestHours="$lastTestHours" '
/Serial Number:/{serial=$3} /Serial Number:/{serial=$3}
/190 Airflow_Temperature/{temp=$10} /190 Airflow_Temperature/{temp=$10}
/190 Temperature_Case/{temp=$10}
/194 Temperature/{temp=$10} /194 Temperature/{temp=$10}
/Power_On_Hours/{split($10,a,"+");sub(/h/,"",a[1]);onHours=a[1];} /Power_On_Hours/{split($10,a,"+");sub(/h/,"",a[1]);onHours=a[1];}
/Power_Cycle_Count/{startStop=$10}
/Start_Stop_Count/{startStop=$10} /Start_Stop_Count/{startStop=$10}
/Spin_Retry_Count/{spinRetry=$10} /Spin_Retry_Count/{spinRetry=$10}
/Reallocated_Sector/{reAlloc=$10} /Reallocated_Sector/{reAlloc=$10}