Update powerwall.sh
This commit is contained in:
@@ -733,12 +733,12 @@ CHECKPOWER(){
|
||||
HOST_WATTS=$(snmpwalk -t 1 -r 0 -v 1 -c public ${PW_HOST_IDRACS[${SENSOR}]} iso.3.6.1.4.1.674.10892.5.4.600.30.1.6.1.${s} | sed 's/.*: //')
|
||||
# break
|
||||
|
||||
elif [[ "${DP}" = *"PS1"* ]]; then
|
||||
elif [[ "${DP}" = *"PS1"* ]] &&; then
|
||||
PS1=$(snmpwalk -t 1 -r 0 -v 1 -c public ${PW_HOST_IDRACS[${SENSOR}]} iso.3.6.1.4.1.674.10892.5.4.600.30.1.6.1.${s} | sed 's/.*: //')
|
||||
PS1=`echo "scale=1; ${PS1}/10" | bc`
|
||||
[ "${PS1}" == "" ] && PS1=0 || PPS1=`echo "scale=1; ${PS1}/10" | bc`; (( $(bc <<<"${PS1} < 1") )) && PS1="0${PS1}"
|
||||
elif [[ "${DP}" = *"PS2"* ]]; then
|
||||
PS2=$(snmpwalk -t 1 -r 0 -v 1 -c public ${PW_HOST_IDRACS[${SENSOR}]} iso.3.6.1.4.1.674.10892.5.4.600.30.1.6.1.${s} | sed 's/.*: //')
|
||||
PS2=`echo "scale=1; ${PS2}/10" | bc`
|
||||
[ "${PS2}" == "" ] && PS2=0 || PS2=`echo "scale=1; ${PS2}/10" | bc` && (( $(bc <<<"${PS2} < 1") )) && PS2="0${PS2}"
|
||||
fi
|
||||
done
|
||||
if [ ${found} -eq 1 ]; then
|
||||
@@ -753,7 +753,7 @@ CHECKPOWER(){
|
||||
else
|
||||
average_disp=""
|
||||
fi
|
||||
echo -e "${idsCL[White]}${SENSOR} ${idsCL[Default]}: ${HOST_WATTS_disp} [PS1=${PS1}'A,PS2=${PS2}'A]${average_disp}${idsCL[Default]}"
|
||||
echo -e "${idsCL[White]}${SENSOR} ${idsCL[Default]}: ${HOST_WATTS_disp} ${idsCL[LightCyan]}[PS1=${PS1}'A, PS2=${PS2}'A]${average_disp}${idsCL[Default]}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user