Update powerwall.sh

This commit is contained in:
2023-12-03 11:57:36 -06:00
parent 4dfd49728f
commit 5077e4a1e1

View File

@@ -765,13 +765,16 @@ CHECKPOWER(){
[ "${PS2}" != "0.0" ] && PS2=`echo "scale=1; ${PS2}/10" | bc` && (( $(bc <<<"${PS2} < 1") )) && [[ "${PS2}" = *"."* ]] && PS2="0${PS2}"
HOST_AMPS=`echo "scale=1; ${PS1}+${PS2}" | bc`
[[ "${HOST_WATTS}" = *"Timeout"* ]] && HOST_WATTS_disp="${idsCL[LightRed]}Host Offline" || HOST_WATTS_disp="${idsCL[Green]}${HOST_AMPS}'amps - `IDS_NUMBER_FORMAT ${HOST_WATTS}`'watts"
elif [[ "${HOST_WATT_SENSORS}" = *"Timeout"* ]]; then
elif [ "$(ipmitool -I lanplus -H ${PW_HOST_IDRACS[${SENSOR}]} -U ${PW_ESXI_USER} -P "${PW_ESXI_PASS}" chassis power status | grep off)" != "" ]; then
HOST_WATTS_disp="${idsCL[LightRed]}Host offline"
elif [ "${HOST_WATTS}" == "0" ]; then
HOST_WATTS_disp="${idsCL[Yellow]}Host PSU not capable"
echo "HERE: $HOST_WATT_SENSORS"
else
HOST_WATTS_disp="${idsCL[LightRed]}Could not pull data"
fi
# fi
MSG="${idsCL[White]}${SENSOR} ${idsCL[Default]}: ${HOST_WATTS_disp}"