From de9efe02551e991c1df8aab53792ff428faf149b Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 17 Nov 2024 11:09:24 -0600 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 2499612e..1ef18634 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -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`