This commit is contained in:
2024-08-22 19:27:31 -05:00
parent 6e01ad3606
commit 195528d7c4
2 changed files with 15 additions and 8 deletions

View File

@@ -1281,9 +1281,11 @@ Previous Temp: ${last_temp}${GAUGESH}"
if [ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.reading ]; then
touch ${PW_TMPFOLDER}/${SENSOR}-error.reading
elif [ ! -f ${PW_TMPFOLDER}/${SENSOR}.disable ] && (([ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}-error.reading)) -ge 60 ]) || ([ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}-error.sent)) -ge $(echo "scale=0; ${PW_RENOTIFY_TIMEOUT}*60" | bc) ])); then
touch ${PW_TMPFOLDER}/${SENSOR}-error.sent
SENDNOTICE "${SENSOR} Sensor ERROR" "ERROR reading sensor data" 1
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} Sensor - ERROR reading sensor data" >> ${logtemp}
if [ ${PW_ENABLE_RENOTIFY} -eq 1 ] || [ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ]; then
SENDNOTICE "${SENSOR} Sensor ERROR" "ERROR reading sensor data" 1
touch ${PW_TMPFOLDER}/${SENSOR}-error.sent
fi
fi
QRY=""
@@ -1347,10 +1349,11 @@ Previous Temp: ${last_temp}${GAUGESH}"
# fi
elif [ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] || ([ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}-error.sent)) -ge $(echo "scale=0; ${PW_RENOTIFY_TIMEOUT}*60" | bc) ]); then
touch ${PW_TMPFOLDER}/${SENSOR}-error.sent
SENDNOTICE "${SENSOR} Sensor ERROR" "ERROR reading sensor data" 1
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} Sensor - ERROR reading sensor data" >> ${logtemp}
if [ ${PW_ENABLE_RENOTIFY} -eq 1 ] || [ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ]; then
SENDNOTICE "${SENSOR} Sensor ERROR" "ERROR reading sensor data" 1
touch ${PW_TMPFOLDER}/${SENSOR}-error.sent
fi
fi
fi
@@ -1386,9 +1389,11 @@ Previous Temp: ${last_temp}${GAUGESH}"
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
touch ${PW_TMPFOLDER}/${SENSORa}-error.sent
SENDNOTICE "${SENSORa} Sensor ERROR" "ERROR reading sensor data" 1
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 [ -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