Update temp.inc.sh

This commit is contained in:
2024-11-17 11:09:24 -06:00
parent 7b7e82c631
commit de9efe0255

View File

@@ -699,17 +699,14 @@ CHECKTEMPSENSOR(){
elif [ "${PW_SENSOR_TYPE[${1}]}" == "system" ]; then
if [[ "${1}" = *"CPU"* ]]; then
temp_c=$(vcgencmd measure_temp)
temp_c=${temp_c%\'*}; temp_c=${temp_c#*=}
if ! temp_c=$(ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${PW_REMOTE_SENSORS[${1}]} vcgencmd measure_temp) ; then TIMEOUT=1; fi
if [ "${temp_c}" != "" ]; then
temp_c=${temp_c%\'*}; temp_c=${temp_c#*=}
fi
elif [[ "${1}" = *"FAN"* ]]; then
temp_c=$(cat ${PW_FANINPUT})
fi
elif [ "${PW_SENSOR_TYPE[${1}]}" == "remotesystem" ]; then
if ! temp_c=$(ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${PW_REMOTE_SENSORS[${1}]} vcgencmd measure_temp) ; then TIMEOUT=1; fi
if [ "${temp_c}" != "" ]; then
temp_c=${temp_c%\'*}; temp_c=${temp_c#*=}
if ! temp_c=$(ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${PW_REMOTE_SENSORS[${1}]} cat ${PW_FANINPUT}) ; then TIMEOUT=1; fi
fi
elif [ "${PW_SENSOR_TYPE[${1}]}" == "esxi" ]; then
temp_c=$(snmpwalk -v 1 -c public -t 2 ${PW_HOST_IDRACS[${1}]} .1.3.6.1.4.1.674.10892.5.4.700.20.1.6.1.${t} -O vq | sed -e 's/"//g')
temp_c=`echo "scale=1; ${temp_c}/10" | bc`