From d50cd98512566428b8fcd6f1a436ba494051a87b Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 9 Jan 2024 16:45:26 -0600 Subject: [PATCH] update --- defaults.inc | 2 +- inc/temp.inc.sh | 25 ++++++++++--------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/defaults.inc b/defaults.inc index 057e8c43..69d009cd 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,5 +1,5 @@ -VERS='2.5.123-01092024' +VERS='2.5.124-01092024' noheader=' update service dailytemp confsync -r -report ' diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index dfa5ffa9..5dc3050f 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -554,11 +554,8 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ fi ####### Fan Issue Workaround ####### - echo -en "HERE: ${SENSORa} [ ${SENSOR} ] - ${FanSpeed} = " - if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ] && [ ! -f ${PW_TMPFOLDER}/${SENSORa}.down ] && [ "${FanSpeed}" != "" ] && ([ "${PW_HOST_IDRACS[${SENSORa}]}" == "10.2.1.21" ] || [ "${PW_HOST_IDRACS[${SENSORa}]}" == "10.10.2.27" ]) && [[ "${SENSOR}" = *"CPU1"* ]]; then - echo -en "yes1 - " + if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ] && [ ! -f ${PW_TMPFOLDER}/${SENSORa}.down ] && [ "${FanSpeed}" != "" ] && ([ "${PW_HOST_IDRACS[${SENSORa}]}" == "10.2.1.21" ] || [ "${PW_HOST_IDRACS[${SENSORa}]}" == "10.10.2.27" ]); then if [ ! -f ${PW_TMPFOLDER}/.fancheck.${SENSORa} ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.fancheck.${SENSORa})) -ge 300 ]; then - echo -en "yes2 - " # if [ ${FanSpeed} -lt 26 ] || [ ${FanSpeed} -gt 34 ]; then if [ ${FanSpeed} -ne 30 ]; then SENDNOTICE "${PW_HOST_IDRACS[${SENSORa}]} Fan Issue" "Settings fans back to normal 30%" @@ -568,13 +565,8 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${FanSpeed}% - ${SENSOR} - Resetting FanSpeed back to 30%" >> ${PW_LOGFILE} fi touch ${PW_TMPFOLDER}/.fancheck.${SENSORa} - else - echo -en "no2 - " fi - else - echo -en "no1 - " fi - echo elif [[ "${SENSORa}" != *"-Usage"* ]]; then @@ -589,7 +581,8 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ if [ $(bc -l <<< "${temp_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit}") -eq 1 ]; then - ([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && touch ${PW_TMPFOLDER}/temp.warn + # ([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && touch ${PW_TMPFOLDER}/temp.warn + touch ${PW_TMPFOLDER}/temp.warn.${SENSOR} if (( $(bc <<< "${temp_diff} >= 1") )); then SENDNOTICE "${SENSOR} ${GAUGE} WARNING" "WARNING ${GAUGE}: ${temp_f}${GAUGESH} - (Difference of ${temp_diff}${GAUGESH})" 1 if [ "${last_temp}" != "${temp_f}" ]; then @@ -624,9 +617,10 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ last_temp=${temp_f} echo ${last_temp} >| ${PW_TMPFOLDER}/.lasttemp/${SENSOR} fi - - if ([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && [ ! -f touch ${PW_TMPFOLDER}/temp.crit ]; then - touch ${PW_TMPFOLDER}/temp.crit + + # if ([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && [ ! -f ${PW_TMPFOLDER}/temp.crit ]; then + if [ "${SENSOR}" == "ServerRoomTH" ] && [ ! -f ${PW_TMPFOLDER}/temp.crit.${SENSOR} ]; then + touch ${PW_TMPFOLDER}/temp.crit.${SENSOR} SHUTDOWN_MAIN ${SENSOR} & echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Shutting down MAIN servers" >> ${logtemp} @@ -646,8 +640,9 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ last_temp=${temp_f} echo ${last_temp} >| ${PW_TMPFOLDER}/.lasttemp/${SENSOR} fi - if ([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && [ ! -f ${PW_TMPFOLDER}/temp.critsys ]; then - touch ${PW_TMPFOLDER}/temp.critsys + # if ([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && [ ! -f ${PW_TMPFOLDER}/temp.critsys ]; then + if [ "${SENSOR}" == "ServerRoomTH" ] && [ ! -f ${PW_TMPFOLDER}/temp.critsys.${SENSOR} ]; then + touch ${PW_TMPFOLDER}/temp.critsys.${SENSOR} SHUTDOWN_SYS ${SENSOR} TEMP & SHUTDOWN_CRIT ${SENSOR} & echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Sending system shutdown signals, if applicable. Check main Powerwall Logs" >> ${logtemp}