Update power.inc.sh

This commit is contained in:
2024-02-11 09:43:11 -06:00
parent 0e8ad99f28
commit 6298532cca

View File

@@ -194,22 +194,12 @@ CHECKPOWER(){
# echo
DIVIDER . lightCyan ${PRI_WIDTH}
[ "${avgdays}" != "" ] && echo -e " ${idsCL[LightYellow]}${avgdays_disp}-Averages"
echo -en "${idsCL[LightCyan]}Totals : Amps Watts"
[ "${avgdays}" != "" ] && echo -e " Amps Watts" || echo
if [ ${REPORT} -eq 0 ]; then
echo -en "\r\033[K"
if [ "${avgdays}" != "" ]; then
echo -en "${idsCL[Yellow]}Calculating ServerRack Averages ... "
APCPDU_avg=$(AVERAGEPOWER ${PW_POWERSENSOR_ID['server-rack']} ${avgdays} both)
APCPDU_AMP_avg=$(echo ${APCPDU_avg} | cut -d'~' -f 1)
APCPDU_WATT_avg=$(echo ${APCPDU_avg} | cut -d'~' -f 2)
echo -en "\r\033[K"
fi
AD=$(IDS_NUMBER_FORMAT ${APCPDU_AMP} 2 yes); c=0; spc=''; spc1=`expr ${wspc} - ${#AD}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; ((c++)); done
echo -en "${idsCL[White]}Server Rack ${idsCL[Default]}: ${idsCL[Green]}${AD}'A${spc}`IDS_NUMBER_FORMAT ${APCPDU_WATT} 0`'W"
[ "${avgdays}" != "" ] && echo -e "${idsCL[LightYellow]} ${AD}'A${spc}`IDS_NUMBER_FORMAT ${APCPDU_WATT_avg} 0`'W" || echo
if [ "${avgdays}" != "" ]; then
echo -en "${idsCL[Yellow]}Calculating NetworkRack Averages ... "
NETRK_avg=$(AVERAGEPOWER ${PW_POWERSENSOR_ID['network-rack']} ${avgdays} both)
@@ -221,6 +211,17 @@ CHECKPOWER(){
echo -en "${idsCL[White]}Network Rack ${idsCL[Default]}: ${idsCL[Green]}${AD}'A${spc}`IDS_NUMBER_FORMAT ${NETRK_WATT} 0`'W"
[ "${avgdays}" != "" ] && echo -e "${idsCL[LightYellow]} ${AD}'A${spc}`IDS_NUMBER_FORMAT ${NETRK_WATT_avg} 0`'W" || echo
if [ "${avgdays}" != "" ]; then
echo -en "${idsCL[Yellow]}Calculating ServerRack Averages ... "
APCPDU_avg=$(AVERAGEPOWER ${PW_POWERSENSOR_ID['server-rack']} ${avgdays} both)
APCPDU_AMP_avg=$(echo ${APCPDU_avg} | cut -d'~' -f 1)
APCPDU_WATT_avg=$(echo ${APCPDU_avg} | cut -d'~' -f 2)
echo -en "\r\033[K"
fi
AD=$(IDS_NUMBER_FORMAT ${APCPDU_AMP} 2 yes); c=0; spc=''; spc1=`expr ${wspc} - ${#AD}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; ((c++)); done
echo -en "${idsCL[White]}Server Rack ${idsCL[Default]}: ${idsCL[Green]}${AD}'A${spc}`IDS_NUMBER_FORMAT ${APCPDU_WATT} 0`'W"
[ "${avgdays}" != "" ] && echo -e "${idsCL[LightYellow]} ${AD}'A${spc}`IDS_NUMBER_FORMAT ${APCPDU_WATT_avg} 0`'W" || echo
if [ "${avgdays}" != "" ]; then
echo -en "${idsCL[Yellow]}Calculating Air Conidtioner Averages ... "
AIRCON_avg=$(AVERAGEPOWER ${PW_POWERSENSOR_ID['ServerRoom-AC']} ${avgdays} both)