Update power.inc.sh
This commit is contained in:
@@ -194,22 +194,12 @@ CHECKPOWER(){
|
|||||||
|
|
||||||
# echo
|
# echo
|
||||||
DIVIDER . lightCyan ${PRI_WIDTH}
|
DIVIDER . lightCyan ${PRI_WIDTH}
|
||||||
|
[ "${avgdays}" != "" ] && echo -e " ${idsCL[LightYellow]}${avgdays_disp}-Averages"
|
||||||
echo -en "${idsCL[LightCyan]}Totals : Amps Watts"
|
echo -en "${idsCL[LightCyan]}Totals : Amps Watts"
|
||||||
[ "${avgdays}" != "" ] && echo -e " Amps Watts" || echo
|
[ "${avgdays}" != "" ] && echo -e " Amps Watts" || echo
|
||||||
|
|
||||||
if [ ${REPORT} -eq 0 ]; then
|
if [ ${REPORT} -eq 0 ]; then
|
||||||
echo -en "\r\033[K"
|
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
|
if [ "${avgdays}" != "" ]; then
|
||||||
echo -en "${idsCL[Yellow]}Calculating NetworkRack Averages ... "
|
echo -en "${idsCL[Yellow]}Calculating NetworkRack Averages ... "
|
||||||
NETRK_avg=$(AVERAGEPOWER ${PW_POWERSENSOR_ID['network-rack']} ${avgdays} both)
|
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"
|
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
|
[ "${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
|
if [ "${avgdays}" != "" ]; then
|
||||||
echo -en "${idsCL[Yellow]}Calculating Air Conidtioner Averages ... "
|
echo -en "${idsCL[Yellow]}Calculating Air Conidtioner Averages ... "
|
||||||
AIRCON_avg=$(AVERAGEPOWER ${PW_POWERSENSOR_ID['ServerRoom-AC']} ${avgdays} both)
|
AIRCON_avg=$(AVERAGEPOWER ${PW_POWERSENSOR_ID['ServerRoom-AC']} ${avgdays} both)
|
||||||
|
|||||||
Reference in New Issue
Block a user