This commit is contained in:
2023-12-11 16:03:22 -06:00
parent 9b47605cfc
commit 4ea538c507
2 changed files with 19 additions and 9 deletions

View File

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

View File

@@ -871,13 +871,19 @@ BATT VOLTAGE: ${BATTVOLT}'volts"
echo "($(date +'%Y-%m-%d %H:%M:%S')) - Input: ${INPUTACV}'volts - 'Check Power' Service Startup - Normal voltage detected" >> ${PW_LOGPOWER} echo "($(date +'%Y-%m-%d %H:%M:%S')) - Input: ${INPUTACV}'volts - 'Check Power' Service Startup - Normal voltage detected" >> ${PW_LOGPOWER}
fi fi
fi fi
if [ ! -f ${PW_TMPFOLDER}/power.ac.good ]; then if [ ! -f ${PW_TMPFOLDER}/power.ac.good ]; then
# if [ -f ${PW_TMPFOLDER}/power.sys.off ]
# if [ -f ${PW_TMPFOLDER}/power.sys.off ] || [ -f ${PW_TMPFOLDER}/power.main.off ] || [ -f ${PW_TMPFOLDER}/power.ac.conserve ]
# fi SENDNOTICE "HOSTS POWER" "Power restored! Will wait 3'mins before turning host(s) back on"
touch ${PW_TMPFOLDER}/.power.restored
fi
rm -f ${PW_TMPFOLDER}/power.ac.* rm -f ${PW_TMPFOLDER}/power.ac.*
touch ${PW_TMPFOLDER}/power.ac.good touch ${PW_TMPFOLDER}/power.ac.good
elif [ -f ${PW_TMPFOLDER}/.power.restored ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.power.restored)) -ge 300 ]; then
HOSTMGMT mainsite -p on >/dev/null 2>&1
rm -f ${PW_TMPFOLDER}/.power.restored
fi fi
# UPDATE APC-PDU LINE TO LINE VOLTAGE # UPDATE APC-PDU LINE TO LINE VOLTAGE
@@ -1171,12 +1177,14 @@ CHECK_SERVICES(){
SHUTDOWN_MAIN(){ SHUTDOWN_MAIN(){
if [ "${1}" == "ServerRoomTH"] || [ "${1}" == "TEMP"]; then if [ "${1}" == "ServerRoomTH"] || [ "${1}" == "TEMP"]; then
SHUTDOWN_SERVERS MAIN ${1} # SHUTDOWN_SERVERS MAIN ${1}
HOSTMGMT main -e off >/dev/null 2>&1
reason='Server Room Overheated!' reason='Server Room Overheated!'
sendnotice=true sendnotice=true
elif [ "${1}" == "POWER"]; then elif [ "${1}" == "POWER"]; then
SHUTDOWN_SERVERS MAIN ${1} # SHUTDOWN_SERVERS MAIN ${1}
HOSTMGMT main -e off >/dev/null 2>&1
reason='Low Power!' reason='Low Power!'
sendnotice=true sendnotice=true
@@ -1194,12 +1202,14 @@ ${reason}" 1
} }
SHUTDOWN_SYS(){ SHUTDOWN_SYS(){
if [ "${1}" == "ServerRoomTH"] || [ "${1}" == "TEMP"]; then if [ "${1}" == "ServerRoomTH"] || [ "${1}" == "TEMP"]; then
SHUTDOWN_SERVERS SYS ${1} # SHUTDOWN_SERVERS SYS ${1}
HOSTMGMT sys -e off >/dev/null 2>&1
reason='Server Room Overheated!' reason='Server Room Overheated!'
sendnotice=true sendnotice=true
elif [ "${1}" == "POWER"]; then elif [ "${1}" == "POWER"]; then
SHUTDOWN_SERVERS SYS ${1} # SHUTDOWN_SERVERS SYS ${1}
HOSTMGMT sys -e off >/dev/null 2>&1
reason='Low Power!' reason='Low Power!'
sendnotice=true sendnotice=true