Update temp.inc.sh

This commit is contained in:
2023-12-30 14:02:08 -06:00
parent 6a41c662c3
commit 17b15f1b54

View File

@@ -330,11 +330,6 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
fi
if [ "${SENSORS_CHECK}" != "" ]; then
for SENSOR in "${SENSORS_CHECK[@]}"; do
if [ -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then
SENDNOTICE "${SENSOR} Online" "${SENSOR} Sensor is back online"
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} - Sensor is back online" >> ${logtemp}
rm -f ${PW_TMPFOLDER}/${SENSOR}.down
fi
if [ "${PW_THRESHOLDS[${SENSORa}]}" != "" ]; then
echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 1 | read temp_warn
echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 2 | read temp_crit
@@ -397,6 +392,19 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
[ "${last_temp[${SENSOR//-/}]}" == "" ] && last_temp[${SENSOR//-/}]=0
logtemp=${PW_LOGFOLDER}/log-temp-${SENSOR}
if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; then
if [ -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then
SENDNOTICE "${SENSOR} Online" "${SENSOR} Sensor is back online"
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} - Sensor is back online" >> ${logtemp}
rm -f ${PW_TMPFOLDER}/${SENSOR}.down
fi
if [ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ]; then
SENDNOTICE "${SENSOR} Data" "${SENSOR} is reporting data again"
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} - Sensor is reporting data again" >> ${logtemp}
rm -f ${PW_TMPFOLDER}/${SENSOR}-error.*
elif [ -f ${PW_TMPFOLDER}/${SENSOR}-error* ]; then
rm -f ${PW_TMPFOLDER}/${SENSOR}-error.*
fi
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "cpu" ]; then
GAUGE="CPU-USAGE"
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "system" ] && [[ "${SENSORa}" = *"FAN"* ]]; then
@@ -412,13 +420,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
GAUGESH="'F"
fi
[ -f ${PW_TMPFOLDER}/${SENSOR}.* ] && rm -f ${PW_TMPFOLDER}/${SENSOR}.*
if [ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ]; then
SENDNOTICE "${SENSOR} Data" "${SENSOR} is reporting data again"
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} - Sensor is reporting data again" >> ${logtemp}
rm -f ${PW_TMPFOLDER}/${SENSOR}-error.*
elif [ -f ${PW_TMPFOLDER}/${SENSOR}-error* ]; then
rm -f ${PW_TMPFOLDER}/${SENSOR}-error.*
fi
if [ "${SENSOR}" == "ServerRoomTH" ]; then
temp_f=`echo "scale=2; ${temp_c}*1.8+32+${PW_ServerRoomTH_Dev}" | bc`