From 20e555eede4e13853d3bd3d092728b3ecf0d3a03 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 11 Dec 2023 17:43:07 -0600 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index 4a275c50..304cbdd6 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -314,9 +314,11 @@ CHECKTEMP_SERVICE(){ echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 3 | read temp_crit_sys fi - + echo 1 if (( $(bc <<< "${temp_f} < ${temp_warn}") )); then + echo 2 if (( $(bc <<< "${last_temp[${SENSOR}]} > 1") )); then + echo 3 SENDNOTICE "${SENSOR} BACK TO NORMAL" "NORMAL TEMP: ${temp_f}${GAUGESH} Previous Temp: ${last_temp[${SENSOR}]}${GAUGESH}" echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Back to NORMAL ${GAUGE} - Previous ${GAUGE}: ${last_temp[${SENSOR}]}${GAUGESH}" >> ${logtemp} @@ -324,6 +326,7 @@ Previous Temp: ${last_temp[${SENSOR}]}${GAUGESH}" # [ "$(compgen -G "${PW_TMPFOLDER}/power.*.off")" != "" ] && rm -f ${PW_TMPFOLDER}/power.*.off elif (( $(bc <<< "${temp_diff} = 0") )); then + echo 4 # SENDNOTICE "${SENSOR} TEMP NORMAL" "Service Startup # NORMAL TEMP: ${temp_f}${GAUGESH}" echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Service Startup - NORMAL ${GAUGE}" >> ${logtemp} @@ -331,13 +334,15 @@ Previous Temp: ${last_temp[${SENSOR}]}${GAUGESH}" # [ "$(compgen -G "${PW_TMPFOLDER}/power.*.off")" != "" ] && rm -f ${PW_TMPFOLDER}/power.*.off elif [ "${relog}" == "1" ]; then + echo 5 echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Normal ${GAUGE}" >> ${logtemp} fi + echo 6 rm -f ${PW_TMPFOLDER}/temp.* rm -f ${PW_TMPFOLDER}/power.${SENSORa}.off last_temp[${SENSOR}]=1 - echo 1 + # iDS-vMS-Offsite Fan Issue Workaround if [ "${PW_HOST_IDRACS[${SENSORa}]}" == "10.2.1.21" ]; then vHOSTFAN=$(snmpwalk -v 1 -c public -t 2 ${PW_HOST_IDRACS[${SENSORa}]} .1.3.6.1.4.1.674.10892.5.4.700.12.1.6.1.3 -O vq) @@ -408,7 +413,7 @@ Previous Temp: ${last_temp[${SENSOR}]}${GAUGESH}" fi fi fi - echo 2 + [ -f ${PW_TMPFOLDER}/${SENSOR}.insert ] && lastinsert=$(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}.insert)) || lastinsert=100000 if [ "$(compgen -G "${PW_TMPFOLDER}/temp.*")" != "" ] || [ "$(compgen -G "${PW_TMPFOLDER}/power.ac.*")" != "" ] || [ "$(compgen -G "${PW_TMPFOLDER}/power.dc.*")" != "" ]; then wait=60 @@ -444,7 +449,7 @@ Previous Temp: ${last_temp[${SENSOR}]}${GAUGESH}" fi fi - echo 3 + done fi