From 3c2fa2f47aee08cd1dd456d4f046a96fd93b3b97 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 1 Jan 2024 10:45:22 -0600 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 8bc9cdb9..630ae8dd 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -400,7 +400,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ fi echo "HERE1: ${SENSOR} = ${last_temp[${SENSOR//-/}]}" - [ "${last_temp[${SENSOR//-/}]}" == "" ] && last_temp[${SENSOR//-/}]=0 + [ "${last_temp[${SENSOR//-/}]}" == "" ] && export last_temp[${SENSOR//-/}]=0 echo "HERE2: ${SENSOR} = ${last_temp[${SENSOR//-/}]}" echo logtemp=${PW_LOGFOLDER}/log-temp-${SENSOR} @@ -493,7 +493,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ ([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && rm -f ${PW_TMPFOLDER}/temp.* rm -f ${PW_TMPFOLDER}/power.${SENSORa}.* - last_temp[${SENSOR//-/}]=1 + export last_temp[${SENSOR//-/}]=1 # iDS-vMS-Offsite Fan Issue Workaround if [ "${PW_HOST_IDRACS[${SENSORa}]}" == "10.2.1.21" ] && [ "${FanSpeed}" != "" ]; then @@ -509,7 +509,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ else - ([ ! "${last_temp[${SENSOR//-/}]}" ] || (( $(bc <<< "${last_temp[${SENSOR//-/}]} < 2") ))) && last_temp[${SENSOR//-/}]=${temp_f} + ([ ! "${last_temp[${SENSOR//-/}]}" ] || (( $(bc <<< "${last_temp[${SENSOR//-/}]} < 2") ))) && export last_temp[${SENSOR//-/}]=${temp_f} temp_diff=`echo "scale=2; ${last_temp[${SENSOR//-/}]}-${temp_f}" | bc` [ $(bc -l <<< "${temp_diff} < 0") -eq 1 ] && temp_diff=`echo "scale=2; ${temp_diff}*-1" | bc` @@ -518,7 +518,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ ([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && touch ${PW_TMPFOLDER}/temp.warn if (( $(bc <<< "${temp_diff} >= 1") )); then SENDNOTICE "${SENSOR} ${GAUGE} WARNING" "WARNING ${GAUGE}: ${temp_f}${GAUGESH} - (Difference of ${temp_diff}')" 1 - last_temp[${SENSOR//-/}]=${temp_f} + export last_temp[${SENSOR//-/}]=${temp_f} echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - WARNING ${GAUGE} - (Difference of ${temp_diff}')" >> ${logtemp} fi @@ -537,7 +537,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ SENDNOTICE "${SENSOR} ${GAUGE} CRITICAL" "CRITICAL ${GAUGE}: ${temp_f}${GAUGESH} - (Difference of ${temp_diff}')" 1 echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - CRITICAL - (Difference of ${temp_diff}${GAUGESH})" >> ${logtemp} 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} + export last_temp[${SENSOR//-/}]=${temp_f} if ([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && [ ! -f touch ${PW_TMPFOLDER}/temp.crit ]; then touch ${PW_TMPFOLDER}/temp.crit @@ -556,7 +556,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){ SENDNOTICE "${SENSOR} TEMP CRITICAL" "SYSTEM CRITICAL ${GAUGE}: ${temp_f}${GAUGESH} - (Difference of ${temp_diff}')" 1 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} - last_temp[${SENSOR//-/}]=${temp_f} + export last_temp[${SENSOR//-/}]=${temp_f} if ([ "${SENSOR}" == "ServerRoomTH" ] || [[ "${SENSOR}" = *"ServerRoomLA"* ]]) && [ ! -f ${PW_TMPFOLDER}/temp.critsys ]; then touch ${PW_TMPFOLDER}/temp.critsys SHUTDOWN_SYS ${SENSOR} TEMP &