diff --git a/defaults.inc b/defaults.inc index 32106357..9ebeea05 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='2.7.123b-11092024' +VERS='2.7.123d-11092024' noheader=' update service dailytemp confsync -r -report test ' @@ -104,7 +104,6 @@ ${SN_MSG} $(date)" "${SN_TIT}" ${3} ${4} & else - # echo "HERE: [${SN_TIT}]=${SN_MSG}: DONE" PUSH_TO_MOBILE "${SN_MSG} $(date)" "${SN_TIT}" ${3} ${4} & diff --git a/inc/power.inc.sh b/inc/power.inc.sh index d2157209..ccd55c67 100644 --- a/inc/power.inc.sh +++ b/inc/power.inc.sh @@ -850,7 +850,7 @@ OFFSITE_CHECKPOWER_SERVICE(){ PW_OFFSITEHOSTS=$(echo ${PW_OFFSITE_HOSTS} | tr ',' ' ') [ "${TEST_OFFSITE}" != "" ] && TEST=${TEST_OFFSITE} || TEST='' - echo "HERE: '${TEST_OFFSITE}' '${TEST}'" + if [ "${TEST}" != "" ]; then PW_OFFSITE_SHUTDOWNSERVERS_AT_LOAD=95 #percent PW_OFFSITE_SHUTDOWNSERVERS_AFTER=1 #minutes @@ -861,8 +861,7 @@ OFFSITE_CHECKPOWER_SERVICE(){ else TESTMODE="" fi - echo "testmode: ${TESTMODE}" - + # upsinfo=$(upsc CP1500PFCLCD) upsinfo=$(upsc CP1500PFCLCD 2>&1) if [ "$(echo "${upsinfo}" | grep 'input.voltage:' | sed 's/.*: //')" != "" ]; then diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index c1d84b67..743c9901 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -119,9 +119,7 @@ CHECKTEMP(){ [ ${DETAILS} -eq 0 ] && [ "${last_sensor%%-*}" == "${SENSOR%%-*}" ] && [ "${last_sensor}" != "Offsite-ServerRoom" ] && [ "${last_sensor}" != "Powerwall-Switch" ] && echo -en "\033[1A" c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR_DESC}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; ((c++)); done echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR_DESC}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Pulling data ... " - - echo "HERE: '${PW_TMPFOLDER}/${SENSOR}.down'" - + if [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then IFS=: read -r temp_f temp_h <<< $(CHECKTEMPSENSOR ${SENSOR}); unset IFS if [ "${temp_f}" != "timeout" ] && [ "${temp_f}" != "offline" ]; then @@ -745,9 +743,7 @@ CHECKTEMPSENSOR(){ fi (( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}" fi - # echo "HERE: '${temp_c}' -> '${temp_f}'" - # echo -en "" - + echo "${temp_f}:${temp_h}" elif [ ${TIMEOUT} -eq 1 ]; then @@ -1022,12 +1018,9 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ [ ! -f ${PW_TMPFOLDER}/.lasttemp/${SENSOR} ] && echo 0 > ${PW_TMPFOLDER}/.lasttemp/${SENSOR} last_temp=$(cat ${PW_TMPFOLDER}/.lasttemp/${SENSOR}) - # [ "${SENSORa}" == "ServerRoomTemp" ] && echo "HERE: [${SENSOR//-/}] - ${last_temp} - ${temp_c} - ${temp_f} - ${temp_warn} - ${temp_crit} - ${temp_crit_sys}" - logtemp=${PW_LOGFOLDER}/log-temp-${SENSOR} if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ] && [ "${temp_c}" != "unavailable" ] && [ "${temp_c}" != "unknown" ] && [ "${temp_h}" != "0" ]; then - if [ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] || [ -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then if [ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] || [ -f ${PW_TMPFOLDER}/${SENSOR}.restart ]; then SENDNOTICE "${SENSOR} Data" "${SENSOR} is reporting data again" @@ -1062,10 +1055,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ fi (( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}" fi - - # echo "HERE: [${SENSOR//-/}] - ${last_temp} - ${temp_c} - ${temp_f} - ${temp_warn} - ${temp_crit} - ${temp_crit_sys}" - # [ ! "${temp_c}" ] || [ ! "${temp_f}" ] || [ ! "${temp_warn}" ] || [ ! "${temp_crit}" ] || [ ! "${temp_crit_sys}" ] && echo "VALUE NOT FOUND" - + if [ "${PW_SENSOR_TYPE[${SENSORa}]}" != "esxi" ]; then echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 1 | read temp_warn echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 2 | read temp_crit