Update powerwall.sh
This commit is contained in:
12
powerwall.sh
12
powerwall.sh
@@ -11,6 +11,8 @@ source /opt/idssys/defaults/default.inc
|
|||||||
|
|
||||||
shopt -s lastpipe
|
shopt -s lastpipe
|
||||||
|
|
||||||
|
VERBOSE=false
|
||||||
|
|
||||||
|
|
||||||
#ssh root@10.5.10.35 '/vmfs/volumes/NFS_ESXi-Vault/esxi-shutdown.sh > /dev/null 2>&1' & > /dev/null 2>&1
|
#ssh root@10.5.10.35 '/vmfs/volumes/NFS_ESXi-Vault/esxi-shutdown.sh > /dev/null 2>&1' & > /dev/null 2>&1
|
||||||
|
|
||||||
@@ -118,20 +120,20 @@ CHECKACV_SERVICE(){
|
|||||||
datetime=`date +'%Y-%m-%d %H:%M:%S'`
|
datetime=`date +'%Y-%m-%d %H:%M:%S'`
|
||||||
if [ ${INPUTACV} -ge ${min_volt} ]; then
|
if [ ${INPUTACV} -ge ${min_volt} ]; then
|
||||||
if [ $voltstatus -eq 3 ]; then
|
if [ $voltstatus -eq 3 ]; then
|
||||||
echo "($datetime) back to normal voltage: ${INPUTACV}V"
|
[ $VERBOSE = true ] && echo "($datetime) back to normal voltage: ${INPUTACV}V"
|
||||||
echo -e "($datetime) Normal voltage detected\nVOLTAGE: ${INPUTACV}V" | mail -s "POWER NOMINAL AGAIN" $email_alert
|
echo -e "($datetime) Normal voltage detected\nVOLTAGE: ${INPUTACV}V" | mail -s "POWER NOMINAL AGAIN" $email_alert
|
||||||
echo "alert sent"
|
[ $VERBOSE = true ] && echo "alert sent"
|
||||||
elif [ $voltstatus -eq 0 ]; then
|
elif [ $voltstatus -eq 0 ]; then
|
||||||
echo "($datetime) normal voltage: ${INPUTACV}V"
|
[ $VERBOSE = true ] && echo "($datetime) normal voltage: ${INPUTACV}V"
|
||||||
echo -e "($datetime) Normal voltage detected\nVOLTAGE: ${INPUTACV}V" | mail -s "Power Nominal" $email_alert
|
echo -e "($datetime) Normal voltage detected\nVOLTAGE: ${INPUTACV}V" | mail -s "Power Nominal" $email_alert
|
||||||
echo "alert sent"
|
[ $VERBOSE = true ] && echo "alert sent"
|
||||||
fi
|
fi
|
||||||
voltstatus=1
|
voltstatus=1
|
||||||
else
|
else
|
||||||
echo "($datetime) LOW voltage: ${INPUTACV}V"
|
echo "($datetime) LOW voltage: ${INPUTACV}V"
|
||||||
if [ $voltstatus -lt 3 ]; then
|
if [ $voltstatus -lt 3 ]; then
|
||||||
echo -e "($datetime) Power off or low voltage detected\nVOLTAGE: ${INPUTACV}V" | mail -s "POWER ALERT - LOW POWER!!" $email_alert
|
echo -e "($datetime) Power off or low voltage detected\nVOLTAGE: ${INPUTACV}V" | mail -s "POWER ALERT - LOW POWER!!" $email_alert
|
||||||
echo "alert sent"
|
[ $VERBOSE = true ] && echo "alert sent"
|
||||||
fi
|
fi
|
||||||
voltstatus=3
|
voltstatus=3
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user