This commit is contained in:
2023-12-11 17:01:34 -06:00
parent a57149ea19
commit e3131efc67
2 changed files with 8 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
VERS='2.4.18-12112023'
VERS='2.4.19-12112023'
noheader=' update service dailytemp '
hc_cw=60

View File

@@ -223,7 +223,6 @@ CHECKTEMP_SERVICE(){
for SENSORa in ${PW_SENSOR_ORD[@]}; do
logtemp=${PW_LOGFOLDER}/log-temp-${SENSORa}
[ ! -f ${logtemp} ] && touch ${logtemp}
[ ! "${last_temp[${SENSORa}]}"] && last_temp[${SENSORa}]=0
[ $(expr `date +%s` - $(stat -c %Y ${logtemp})) -ge 3600 ] && relog=1 || relog=0
if ([ "${PW_REMOTE_SENSORS[${SENSORa}]}" != "" ] && [ "$(CHECK_HOST ${PW_REMOTE_SENSORS[${SENSORa}]})" != "false" ]) || ([ "${PW_HOST_ADDRESSES[${SENSORa}]}" != "" ] && [ "$(CHECK_HOST ${PW_HOST_ADDRESSES[${SENSORa}]})" != "false" ]); then
@@ -246,6 +245,7 @@ CHECKTEMP_SERVICE(){
fi
if [ "${SENSORS_CHECK}" != "" ]; then
for SENSOR in "${SENSORS_CHECK[@]}"; do
[ ! "${last_temp[${SENSOR}]}" ] && last_temp[${SENSOR}]=0
if [ "${PW_THRESHOLDS[${SENSORa}]}" != "" ]; then
echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 1 | read temp_warn
echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 2 | read temp_crit
@@ -1180,13 +1180,13 @@ CHECK_SERVICES(){
}
SHUTDOWN_MAIN(){
if [ "${1}" == "ServerRoomTH"] || [ "${1}" == "TEMP"]; then
if [ "${1}" == "ServerRoomTH" ] || [ "${1}" == "TEMP" ]; then
SHUTDOWN_SERVERS MAIN ${1}
# HOSTMGMT main -e off >/dev/null 2>&1
reason='Server Room Overheated!'
sendnotice=true
elif [ "${1}" == "POWER"]; then
elif [ "${1}" == "POWER" ]; then
SHUTDOWN_SERVERS MAIN ${1}
# HOSTMGMT main -e off >/dev/null 2>&1
reason='Low Power!'
@@ -1196,7 +1196,7 @@ SHUTDOWN_MAIN(){
sendnotice=false
fi
if [ "${sendnotice}" == "true"]; then
if [ "${sendnotice}" == "true" ]; then
SENDNOTICE "MAIN SERVERS SHUTDOWN" "MAIN servers have been shutdown
${reason}" 1
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - Main servers have been shutdown, ${reason}" >> ${PW_LOGFILE}
@@ -1205,13 +1205,13 @@ ${reason}" 1
echo
}
SHUTDOWN_SYS(){
if [ "${1}" == "ServerRoomTH"] || [ "${1}" == "TEMP"]; then
if [ "${1}" == "ServerRoomTH" ] || [ "${1}" == "TEMP" ]; then
SHUTDOWN_SERVERS SYS ${1}
# HOSTMGMT sys -e off >/dev/null 2>&1
reason='Server Room Overheated!'
sendnotice=true
elif [ "${1}" == "POWER"]; then
elif [ "${1}" == "POWER" ]; then
SHUTDOWN_SERVERS SYS ${1}
# HOSTMGMT sys -e off >/dev/null 2>&1
reason='Low Power!'
@@ -1221,7 +1221,7 @@ SHUTDOWN_SYS(){
sendnotice=false
fi
if [ "${sendnotice}" == "true"]; then
if [ "${sendnotice}" == "true" ]; then
SENDNOTICE "SYS SERVERS SHUTDOWN" "SYS servers have been shutdown
${reason}" 1
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - SYS servers have been shutdown, ${reason}" >> ${PW_LOGFILE}