Update powerwall.sh

This commit is contained in:
2023-12-11 17:43:07 -06:00
parent 5a84dbcc14
commit 20e555eede

View File

@@ -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