Update power.inc.sh

This commit is contained in:
2024-02-11 08:56:58 -06:00
parent 25f4207bb5
commit a47c796aea

View File

@@ -54,6 +54,7 @@ CHECKPOWER(){
start=`date +%s`
rm -f ${PW_TMPFOLDER}/*.hostpower*
REPORT=0
wspc=15
while [ $# -gt 0 ]; do
case "$1" in
-a|-avg) avgdays=${2};;
@@ -154,6 +155,8 @@ CHECKPOWER(){
# echo
DIVIDER . lightCyan ${PRI_WIDTH}
c=0; spc=''; spc1=`expr ${wspc} - ${#AD}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; ((c++)); done
echo -e "${idsCL[LightCyan]}Totals ${idsCL[Default]}: Amps ${idsCL[Green]}Watts${idsCL[Default]}"
[ ${REPORT} -eq 0 ] && echo -en "${idsCL[Yellow]}Pulling data from 'ServerRoom' ... "
@@ -202,10 +205,9 @@ CHECKPOWER(){
APCPDU_WATT_avg=$(echo ${APCPDU_avg} | cut -d'~' -f 2)
echo -en "\r\033[K"
fi
wspc=20
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]}ServerRack ${idsCL[Default]}: ${idsCL[Green]}${AD}'amps${spc}${idsCL[Green]}`IDS_NUMBER_FORMAT ${APCPDU_WATT} 0`'watts ${idsCL[Default]}~ est"
echo -e "${idsCL[White]}ServerRack ${idsCL[Default]}: ${idsCL[Green]}${AD}'amps${spc}${idsCL[Green]}`IDS_NUMBER_FORMAT ${APCPDU_WATT} 0`'watts ${idsCL[Default]}~ est"
DIVIDER . lightCyan ${PRI_WIDTH}