Update offsite-power-check.sh
This commit is contained in:
@@ -120,7 +120,8 @@ AC VOLTAGE: ${OFFSITE_VOLTIN}'volts"
|
|||||||
touch ${PW_TMPFOLDER}/power.offsite.off
|
touch ${PW_TMPFOLDER}/power.offsite.off
|
||||||
for host in ${PW_OFFSITEHOSTS}; do
|
for host in ${PW_OFFSITEHOSTS}; do
|
||||||
if [ "$TEST" = "" ] || [ "$TEST" = "full" ]; then
|
if [ "$TEST" = "" ] || [ "$TEST" = "full" ]; then
|
||||||
ssh root@${host} /vmfs/volumes/652c94ef-ee49895b-365d-00109b3fea40/.SCRIPTS/esxi-shutdown2.sh &
|
# ssh root@${host} /vmfs/volumes/652c94ef-ee49895b-365d-00109b3fea40/.SCRIPTS/esxi-shutdown2.sh &
|
||||||
|
ssh root@${host} "bash -s" < ${PW_FOLDER}/esxi-scripts/esxi-shutdown2.sh &
|
||||||
else
|
else
|
||||||
echo "TESTMODE: Shutting down '${host}'"
|
echo "TESTMODE: Shutting down '${host}'"
|
||||||
fi
|
fi
|
||||||
@@ -133,7 +134,7 @@ AC VOLTAGE: ${OFFSITE_VOLTIN}'volts"
|
|||||||
|
|
||||||
else
|
else
|
||||||
if [ $(expr `date +%s` - $(stat -f %m ${PW_TMPFOLDER}/power.ups.losscomm)) -ge 30 ]; then
|
if [ $(expr `date +%s` - $(stat -f %m ${PW_TMPFOLDER}/power.ups.losscomm)) -ge 30 ]; then
|
||||||
echo "($(date +'%Y-%m-%d %H:%M:%S')) - 0.0'volts - ${OFFSITE_BATT_CAP}'% Battery - Restarting NUT service" >> ${PW_LOGFILE}
|
echo "($(date +'%Y-%m-%d %H:%M:%S')) - 0.0'volts - 0'% Battery - Restarting NUT service" >> ${PW_LOGFILE}
|
||||||
SENDNOTICE "NUT DRIVER FAILURE" "Restarting NUT service"
|
SENDNOTICE "NUT DRIVER FAILURE" "Restarting NUT service"
|
||||||
/usr/local/etc/rc.d/nut.sh restart
|
/usr/local/etc/rc.d/nut.sh restart
|
||||||
sleep 10s
|
sleep 10s
|
||||||
|
|||||||
Reference in New Issue
Block a user