Update temp.inc.sh

This commit is contained in:
2024-08-27 22:11:34 -05:00
parent b2235b6d22
commit 8961867b70

View File

@@ -1347,7 +1347,7 @@ Previous Temp: ${last_temp}${GAUGESH}"
if [ ! -f ${NM_TMPFOLDER}/${SENSOR}.disable ] && ([ "${PW_ESXI_HOST_NAME[${SENSORa}]}" == "" ] || ([[ "${PW_ESXI_HOST_NAME[${SENSORa}]}" != *"10.2."* ]] || ([[ "${PW_ESXI_HOST_NAME[${SENSORa}]}" = *"10.2."* ]] && [ ! -f ${PW_TMPFOLDER}/OFF-vMS-Host1.down ]))); then
[ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ] && touch ${PW_TMPFOLDER}/${SENSOR}.down
if [ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.reading ]; then
#touch ${PW_TMPFOLDER}/${SENSOR}-error.reading
touch ${PW_TMPFOLDER}/${SENSOR}-error.reading
elif [ ! -f ${PW_TMPFOLDER}/${SENSOR}.disable ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}-error.reading)) -ge 60 ]; then
if [ "${SENSOR}" == "ServerRoomTemp" ] && ([ ! -f ${PW_TMPFOLDER}/${SENSOR}.restart ] || ([ -f ${PW_TMPFOLDER}/${SENSOR}.restart ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}.restart)) -ge 900 ])); then
@@ -1396,17 +1396,19 @@ Previous Temp: ${last_temp}${GAUGESH}"
fi
else
[ ! -f ${PW_TMPFOLDER}/${SENSORa}.down ] && touch ${PW_TMPFOLDER}/${SENSORa}.down
if [ ! -f ${PW_TMPFOLDER}/${SENSORa}-error.reading ]; then
touch ${PW_TMPFOLDER}/${SENSORa}-error.reading
elif [ ! -f ${PW_TMPFOLDER}/${SENSORa}.disable ] && (([ ! -f ${PW_TMPFOLDER}/${SENSORa}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSORa}-error.reading)) -ge 60 ]) || ([ -f ${PW_TMPFOLDER}/${SENSORa}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSORa}-error.sent)) -ge $(echo "scale=0; ${PW_RENOTIFY_TIMEOUT}*60" | bc) ])); then
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSORa} Sensor - ERROR reading sensor data" >> ${logtemp}
if [ ${PW_ENABLE_RENOTIFY} -eq 1 ] || [ ! -f ${PW_TMPFOLDER}/${SENSORa}-error.sent ]; then
SENDNOTICE "${SENSORa} Sensor ERROR" "ERROR reading sensor data" 1
touch ${PW_TMPFOLDER}/${SENSORa}-error.sent
if [ ! -f ${NM_TMPFOLDER}/${SENSORa}.disable ] && ([ "${PW_ESXI_HOST_NAME[${SENSORa}]}" == "" ] || ([[ "${PW_ESXI_HOST_NAME[${SENSORa}]}" != *"10.2."* ]] || ([[ "${PW_ESXI_HOST_NAME[${SENSORa}]}" = *"10.2."* ]] && [ ! -f ${PW_TMPFOLDER}/OFF-vMS-Host1.down ]))); then
[ ! -f ${PW_TMPFOLDER}/${SENSORa}.down ] && touch ${PW_TMPFOLDER}/${SENSORa}.down
if [ ! -f ${PW_TMPFOLDER}/${SENSORa}-error.reading ]; then
touch ${PW_TMPFOLDER}/${SENSORa}-error.reading
elif [ ! -f ${PW_TMPFOLDER}/${SENSORa}.disable ] && (([ ! -f ${PW_TMPFOLDER}/${SENSORa}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSORa}-error.reading)) -ge 60 ]) || ([ -f ${PW_TMPFOLDER}/${SENSORa}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSORa}-error.sent)) -ge $(echo "scale=0; ${PW_RENOTIFY_TIMEOUT}*60" | bc) ])); then
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSORa} Sensor - ERROR reading sensor data" >> ${logtemp}
if [ ${PW_ENABLE_RENOTIFY} -eq 1 ] || [ ! -f ${PW_TMPFOLDER}/${SENSORa}-error.sent ]; then
SENDNOTICE "${SENSORa} Sensor ERROR" "ERROR reading sensor data" 1
touch ${PW_TMPFOLDER}/${SENSORa}-error.sent
fi
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ] && [ -f ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.set ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.set)) -ge 900 ]; then
rm -f ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.set
fi
elif [ -f ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.set ] && [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.set)) -ge 900 ]; then
rm -f ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.set
fi
fi
rm -f ${PW_TMPFOLDER}/ztemprun.${SENSORa}.running