Update powerwall.sh

This commit is contained in:
2022-09-11 15:35:04 -05:00
parent a657732849
commit db008e4537

View File

@@ -11,6 +11,8 @@ source /opt/idssys/defaults/default.inc
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
@@ -118,20 +120,20 @@ CHECKACV_SERVICE(){
datetime=`date +'%Y-%m-%d %H:%M:%S'`
if [ ${INPUTACV} -ge ${min_volt} ]; 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 "alert sent"
[ $VERBOSE = true ] && echo "alert sent"
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 "alert sent"
[ $VERBOSE = true ] && echo "alert sent"
fi
voltstatus=1
else
echo "($datetime) LOW voltage: ${INPUTACV}V"
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 "alert sent"
[ $VERBOSE = true ] && echo "alert sent"
fi
voltstatus=3
fi