Update power.inc.sh
This commit is contained in:
@@ -54,6 +54,7 @@ CHECKPOWER(){
|
|||||||
start=`date +%s`
|
start=`date +%s`
|
||||||
rm -f ${PW_TMPFOLDER}/*.hostpower*
|
rm -f ${PW_TMPFOLDER}/*.hostpower*
|
||||||
REPORT=0
|
REPORT=0
|
||||||
|
wspc=15
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-a|-avg) avgdays=${2};;
|
-a|-avg) avgdays=${2};;
|
||||||
@@ -154,6 +155,8 @@ CHECKPOWER(){
|
|||||||
|
|
||||||
# echo
|
# echo
|
||||||
DIVIDER . lightCyan ${PRI_WIDTH}
|
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' ... "
|
[ ${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)
|
APCPDU_WATT_avg=$(echo ${APCPDU_avg} | cut -d'~' -f 2)
|
||||||
echo -en "\r\033[K"
|
echo -en "\r\033[K"
|
||||||
fi
|
fi
|
||||||
wspc=20
|
|
||||||
AD=$(IDS_NUMBER_FORMAT ${APCPDU_AMP} 2 yes)
|
AD=$(IDS_NUMBER_FORMAT ${APCPDU_AMP} 2 yes)
|
||||||
c=0; spc=''; spc1=`expr ${wspc} - ${#AD}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; ((c++)); done
|
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}
|
DIVIDER . lightCyan ${PRI_WIDTH}
|
||||||
|
|||||||
Reference in New Issue
Block a user