Update temp.inc.sh
This commit is contained in:
@@ -488,7 +488,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f ${PW_TMPFOLDER}/temp.*
|
([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && rm -f ${PW_TMPFOLDER}/temp.*
|
||||||
rm -f ${PW_TMPFOLDER}/power.${SENSORa}.*
|
rm -f ${PW_TMPFOLDER}/power.${SENSORa}.*
|
||||||
last_temp[${SENSOR//-/}]=1
|
last_temp[${SENSOR//-/}]=1
|
||||||
|
|
||||||
@@ -512,7 +512,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
|
|||||||
|
|
||||||
if [ $(bc -l <<< "${temp_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit}") -eq 1 ]; then
|
if [ $(bc -l <<< "${temp_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit}") -eq 1 ]; then
|
||||||
|
|
||||||
touch ${PW_TMPFOLDER}/temp.warn
|
([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && touch ${PW_TMPFOLDER}/temp.warn
|
||||||
if (( $(bc <<< "${temp_diff} >= 1") )); then
|
if (( $(bc <<< "${temp_diff} >= 1") )); then
|
||||||
SENDNOTICE "${SENSOR} ${GAUGE} WARNING" "WARNING ${GAUGE}: ${temp_f}${GAUGESH} - (Difference of ${temp_diff}')" 1
|
SENDNOTICE "${SENSOR} ${GAUGE} WARNING" "WARNING ${GAUGE}: ${temp_f}${GAUGESH} - (Difference of ${temp_diff}')" 1
|
||||||
last_temp[${SENSOR//-/}]=${temp_f}
|
last_temp[${SENSOR//-/}]=${temp_f}
|
||||||
@@ -536,7 +536,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
|
|||||||
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} - ${temp_f}${GAUGESH} - CRITICAL ${GAUGE} - (Difference of ${temp_diff}')" >> ${PW_LOGFILE}
|
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} - ${temp_f}${GAUGESH} - CRITICAL ${GAUGE} - (Difference of ${temp_diff}')" >> ${PW_LOGFILE}
|
||||||
last_temp[${SENSOR//-/}]=${temp_f}
|
last_temp[${SENSOR//-/}]=${temp_f}
|
||||||
|
|
||||||
if [ "${SENSOR}" == "ServerRoomTH" ] && [ ! -f touch ${PW_TMPFOLDER}/temp.crit ]; then
|
if ([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && [ ! -f touch ${PW_TMPFOLDER}/temp.crit ]; then
|
||||||
touch ${PW_TMPFOLDER}/temp.crit
|
touch ${PW_TMPFOLDER}/temp.crit
|
||||||
SHUTDOWN_MAIN ${SENSOR} &
|
SHUTDOWN_MAIN ${SENSOR} &
|
||||||
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Shutting down MAIN servers" >> ${logtemp}
|
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Shutting down MAIN servers" >> ${logtemp}
|
||||||
@@ -554,9 +554,9 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
|
|||||||
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - SYSTEM CRITICAL - (Difference of ${temp_diff})" >> ${logtemp}
|
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - SYSTEM CRITICAL - (Difference of ${temp_diff})" >> ${logtemp}
|
||||||
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - ${SENSOR} - CRITICAL ${GAUGE} SYSTEM - (Difference of ${temp_diff}')" >> ${PW_LOGFILE}
|
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - ${SENSOR} - CRITICAL ${GAUGE} SYSTEM - (Difference of ${temp_diff}')" >> ${PW_LOGFILE}
|
||||||
last_temp[${SENSOR//-/}]=${temp_f}
|
last_temp[${SENSOR//-/}]=${temp_f}
|
||||||
if [ ! -f touch ${PW_TMPFOLDER}/temp.critsys ]; then
|
if ([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && [ ! -f ${PW_TMPFOLDER}/temp.critsys ]; then
|
||||||
touch ${PW_TMPFOLDER}/temp.critsys
|
touch ${PW_TMPFOLDER}/temp.critsys
|
||||||
[ "${SENSOR}" == "ServerRoomTH" ] && SHUTDOWN_SYS ${SENSOR} TEMP &
|
SHUTDOWN_SYS ${SENSOR} TEMP &
|
||||||
SHUTDOWN_CRIT ${SENSOR} &
|
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}
|
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Sending system shutdown signals, if applicable. Check main Powerwall Logs" >> ${logtemp}
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user