diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 75215838..be132302 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -31,7 +31,7 @@ CHECKTEMP(){ echo -e "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR} Host Sensors ${idsST[Reset]}${idsCL[White]}[${vHOSTiDRACIP}]${idsCL[Default]}" echo -en "${idsCL[Yellow]}Pulling data for '${SENSOR}' ... " - if [ "$(CHECK_HOST ${vHOSTIP})" != "false" ]; then + if [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ] && [ "$(CHECK_HOST ${vHOSTIP})" != "false" ]; then vHOST_TEMPNAMES=$(snmpwalk -v 1 -c public -t 2 ${vHOSTiDRACIP} .1.3.6.1.4.1.674.10892.5.4.700.20.1.8 -O vq | sed -e 's/"//g' | sed -e 's/ Temp//g') IFS=$'\n' read -rd '' -a vHOST_TEMPNAMES <<<"${vHOST_TEMPNAMES}" @@ -332,6 +332,7 @@ CHECKTEMP_SERVICE(){ if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; then [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "cpu" ] && GAUGE="CPU-USAGE" || GAUGE="TEMP" [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "cpu" ] && GAUGESH='%' || GAUGESH="'F" + [ -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} @@ -510,6 +511,7 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}" ################### else + [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ] && touch ${PW_TMPFOLDER}/${SENSOR}.down if [ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.reading ]; then touch ${PW_TMPFOLDER}/${SENSOR}-error.reading elif ([ ! -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