Update temp.inc.sh

This commit is contained in:
2024-01-30 19:36:04 -06:00
parent dfbcf6a388
commit 473d26f400

View File

@@ -417,9 +417,9 @@ CHECKTEMP_SERVICE(){
if [ "${tsensor}" != "*" ]; then
rm -f ${sensor}
((s_count++))
# if [ ! -f ${PW_TMPFOLDER}/${tsensor}.down ] && [ -f ${PW_TMPFOLDER}/.lastfancheck/${tsensor} ]; then
# rm -f ${PW_TMPFOLDER}/.lastfancheck/${tsensor}*
# fi
if [ ! -f ${PW_TMPFOLDER}/${tsensor}.down ] && [ -f ${PW_TMPFOLDER}/.lastfancheck/${tsensor} ]; then
rm -f ${PW_TMPFOLDER}/.lastfancheck/${tsensor}*
fi
fi
done
@@ -620,7 +620,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
# echo "${temp_f} -- scale=2; ${DEFAULT_ESXI_EXHAUST_MIN}+${ESXI_FANSPEED_GL_ZONE} - ${GL_HIGH} - ${GL_LOW}"
### GOLDILOCK ZONE ###
if (( $(bc <<< "${temp_f} >= ${GL_LOW}") )) && (( $(bc <<< "${temp_f} <= ${GL_HIGH}") )); then
if [ ! -f ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.gl ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.set)) -ge 3600 ]; then
if [ ! -f ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.gl ] && [ -f ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.set ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.set)) -ge 3600 ]; then
SENDNOTICE "${PW_HOST_IDRACS[${SENSORa}]} FAN CONTROL" "Goldilock Zone Found at ${FanSpeed}%"
echo "${FanSpeed}" >| ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.gl
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${FanSpeed}% - ${SET_HOST} - Goldilock Zone Found (1HR)" >> ${logtemp}