diff --git a/inc/power.inc.sh b/inc/power.inc.sh index 8547afc0..81e92180 100644 --- a/inc/power.inc.sh +++ b/inc/power.inc.sh @@ -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)