Update power.inc.sh

This commit is contained in:
2024-02-11 11:14:55 -06:00
parent 015d372649
commit 0082c342ee

View File

@@ -354,8 +354,8 @@ CHECKPOWER(){
DIVIDER . yellow ${PRI_WIDTH}
echo -en "${idsCL[Yellow]}ESXi Host Power Information"
[ "${avgdays}" != "" ] && echo -e " --${idsCL[LightYellow]}${avgdays_disp}-Averages---" || echo
echo -en "${idsCL[LightCyan]} Amps Watts"
[ "${avgdays}" != "" ] && echo -e " Amps Watts" || echo
# echo -en "${idsCL[LightCyan]} Amps Watts"
# [ "${avgdays}" != "" ] && echo -e " Amps Watts" || echo
DIVIDER . yellow ${PRI_WIDTH}
SENSOR_TOTAL_WATTS_MAINSITE=0
@@ -401,7 +401,7 @@ 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`
AD=$(IDS_NUMBER_FORMAT ${HOST_AMPS} 2 yes); c=0; spc=''; spc1=`expr ${wspc} - ${#AD}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; ((c++)); done
HOST_WATTS_disp="${idsCL[Green]}${AD}'A${spc}`IDS_NUMBER_FORMAT ${HOST_WATTS} 0`'W"
HOST_WATTS_disp="${idsCL[Green]}${AD}'amps${spc}`IDS_NUMBER_FORMAT ${HOST_WATTS} 0`'watts"
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 powered down"
@@ -450,8 +450,8 @@ CHECKPOWER(){
fi
if [ ${HOST_WATTS} -gt 0 ]; then
DIVIDER . lightCyan ${PRI_WIDTH}
echo -e "${idsCL[LightCyan]} PS1 ${idsCL[Default]}: ${idsCL[LightCyan]}${PS1}'A @ ${PS1V}'V"
echo -e "${idsCL[LightCyan]} PS2 ${idsCL[Default]}: ${idsCL[LightCyan]}${PS2}'A @ ${PS2V}'V"
echo -e "${idsCL[LightCyan]} PS1 ${idsCL[Default]}: ${idsCL[LightCyan]}${PS1}'amps ${idsCL[Default]}@${idsCL[LightCyan]}${PS1} ${PS1V}'volts"
echo -e "${idsCL[LightCyan]} PS2 ${idsCL[Default]}: ${idsCL[LightCyan]}${PS2}'amps ${idsCL[Default]}@${idsCL[LightCyan]}${PS1} ${PS2V}'volts"
fi
echo -e "${idsCL[Default]}"
fi