temperature check fix

This commit is contained in:
olli 2023-06-26 16:09:31 +02:00
parent a1449c9b4b
commit 664e69df32

View File

@ -113,11 +113,11 @@
then then
g_echo_error "SMART of $disk unhealthy: smartctl -H $OPT $disk $(cat ${g_tmp}/smartctl)" g_echo_error "SMART of $disk unhealthy: smartctl -H $OPT $disk $(cat ${g_tmp}/smartctl)"
fi fi
fi
# temperature check # temperature check
temperature=$(smartctl -x $OPT $disk | egrep "^Current Temperature" | perl -pe 's/ +/ /g' | cut -d" " -f3) temperature=$(smartctl -x $OPT $disk | perl -pe 's/ +/ /g; s/^ //' | egrep "^194 Temperature_Celsius " | cut -d" " -f 8)
[ -z "$temperature" ] && continue [ -z "$temperature" ] && continue
[ $temperature -gt 65 ] && g_echo_error "SMART temperature of disk $disk high ($temperature Celsius)" [ $temperature -gt 65 ] && g_echo_error "SMART temperature of disk $disk high ($temperature Celsius)"
fi
done done
validate: /bin/bash -n %s validate: /bin/bash -n %s
backup: yes backup: yes