Update powerwall.sh
This commit is contained in:
13
powerwall.sh
13
powerwall.sh
@@ -314,9 +314,11 @@ CHECKTEMP_SERVICE(){
|
|||||||
echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 3 | read temp_crit_sys
|
echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 3 | read temp_crit_sys
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo 1
|
||||||
if (( $(bc <<< "${temp_f} < ${temp_warn}") )); then
|
if (( $(bc <<< "${temp_f} < ${temp_warn}") )); then
|
||||||
|
echo 2
|
||||||
if (( $(bc <<< "${last_temp[${SENSOR}]} > 1") )); then
|
if (( $(bc <<< "${last_temp[${SENSOR}]} > 1") )); then
|
||||||
|
echo 3
|
||||||
SENDNOTICE "${SENSOR} BACK TO NORMAL" "NORMAL TEMP: ${temp_f}${GAUGESH}
|
SENDNOTICE "${SENSOR} BACK TO NORMAL" "NORMAL TEMP: ${temp_f}${GAUGESH}
|
||||||
Previous Temp: ${last_temp[${SENSOR}]}${GAUGESH}"
|
Previous Temp: ${last_temp[${SENSOR}]}${GAUGESH}"
|
||||||
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Back to NORMAL ${GAUGE} - Previous ${GAUGE}: ${last_temp[${SENSOR}]}${GAUGESH}" >> ${logtemp}
|
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Back to NORMAL ${GAUGE} - Previous ${GAUGE}: ${last_temp[${SENSOR}]}${GAUGESH}" >> ${logtemp}
|
||||||
@@ -324,6 +326,7 @@ Previous Temp: ${last_temp[${SENSOR}]}${GAUGESH}"
|
|||||||
# [ "$(compgen -G "${PW_TMPFOLDER}/power.*.off")" != "" ] && rm -f ${PW_TMPFOLDER}/power.*.off
|
# [ "$(compgen -G "${PW_TMPFOLDER}/power.*.off")" != "" ] && rm -f ${PW_TMPFOLDER}/power.*.off
|
||||||
|
|
||||||
elif (( $(bc <<< "${temp_diff} = 0") )); then
|
elif (( $(bc <<< "${temp_diff} = 0") )); then
|
||||||
|
echo 4
|
||||||
# SENDNOTICE "${SENSOR} TEMP NORMAL" "Service Startup
|
# SENDNOTICE "${SENSOR} TEMP NORMAL" "Service Startup
|
||||||
# NORMAL TEMP: ${temp_f}${GAUGESH}"
|
# NORMAL TEMP: ${temp_f}${GAUGESH}"
|
||||||
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Service Startup - NORMAL ${GAUGE}" >> ${logtemp}
|
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Service Startup - NORMAL ${GAUGE}" >> ${logtemp}
|
||||||
@@ -331,13 +334,15 @@ Previous Temp: ${last_temp[${SENSOR}]}${GAUGESH}"
|
|||||||
# [ "$(compgen -G "${PW_TMPFOLDER}/power.*.off")" != "" ] && rm -f ${PW_TMPFOLDER}/power.*.off
|
# [ "$(compgen -G "${PW_TMPFOLDER}/power.*.off")" != "" ] && rm -f ${PW_TMPFOLDER}/power.*.off
|
||||||
|
|
||||||
elif [ "${relog}" == "1" ]; then
|
elif [ "${relog}" == "1" ]; then
|
||||||
|
echo 5
|
||||||
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Normal ${GAUGE}" >> ${logtemp}
|
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Normal ${GAUGE}" >> ${logtemp}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
echo 6
|
||||||
rm -f ${PW_TMPFOLDER}/temp.*
|
rm -f ${PW_TMPFOLDER}/temp.*
|
||||||
rm -f ${PW_TMPFOLDER}/power.${SENSORa}.off
|
rm -f ${PW_TMPFOLDER}/power.${SENSORa}.off
|
||||||
last_temp[${SENSOR}]=1
|
last_temp[${SENSOR}]=1
|
||||||
echo 1
|
|
||||||
# iDS-vMS-Offsite Fan Issue Workaround
|
# iDS-vMS-Offsite Fan Issue Workaround
|
||||||
if [ "${PW_HOST_IDRACS[${SENSORa}]}" == "10.2.1.21" ]; then
|
if [ "${PW_HOST_IDRACS[${SENSORa}]}" == "10.2.1.21" ]; then
|
||||||
vHOSTFAN=$(snmpwalk -v 1 -c public -t 2 ${PW_HOST_IDRACS[${SENSORa}]} .1.3.6.1.4.1.674.10892.5.4.700.12.1.6.1.3 -O vq)
|
vHOSTFAN=$(snmpwalk -v 1 -c public -t 2 ${PW_HOST_IDRACS[${SENSORa}]} .1.3.6.1.4.1.674.10892.5.4.700.12.1.6.1.3 -O vq)
|
||||||
@@ -408,7 +413,7 @@ Previous Temp: ${last_temp[${SENSOR}]}${GAUGESH}"
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo 2
|
|
||||||
[ -f ${PW_TMPFOLDER}/${SENSOR}.insert ] && lastinsert=$(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}.insert)) || lastinsert=100000
|
[ -f ${PW_TMPFOLDER}/${SENSOR}.insert ] && lastinsert=$(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}.insert)) || lastinsert=100000
|
||||||
if [ "$(compgen -G "${PW_TMPFOLDER}/temp.*")" != "" ] || [ "$(compgen -G "${PW_TMPFOLDER}/power.ac.*")" != "" ] || [ "$(compgen -G "${PW_TMPFOLDER}/power.dc.*")" != "" ]; then
|
if [ "$(compgen -G "${PW_TMPFOLDER}/temp.*")" != "" ] || [ "$(compgen -G "${PW_TMPFOLDER}/power.ac.*")" != "" ] || [ "$(compgen -G "${PW_TMPFOLDER}/power.dc.*")" != "" ]; then
|
||||||
wait=60
|
wait=60
|
||||||
@@ -444,7 +449,7 @@ Previous Temp: ${last_temp[${SENSOR}]}${GAUGESH}"
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
echo 3
|
|
||||||
done
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user