Update powerwall.sh

This commit is contained in:
2023-10-31 11:19:45 -05:00
parent 68bf9d389d
commit db7e75cfcd

View File

@@ -598,8 +598,10 @@ CHECKPOWER(){
host=${hostfile%.*}; host=${host##*/} host=${hostfile%.*}; host=${host##*/}
if [ "${host}" != "*" ] && [ "${host}" != "done" ]; then if [ "${host}" != "*" ] && [ "${host}" != "done" ]; then
watts=$(cat ${hostfile}) watts=$(cat ${hostfile})
echo -e "${idsCL[LightCyan]}HOST '${PW_iDRACHOST_SHORTNAMES[${host}]}' ${idsCL[Default]}: ${idsCL[Green]}${watts}W${idsCL[Default]}" if [ "${watts}" == "down" ]; then hostpower="${idsCL[Red]}Host Offline"
# echo -e "${idsCL[LightCyan]}HOST '${host}' ${idsCL[Default]}: ${idsCL[Green]}${watts}W${idsCL[Default]}" elif [ "${watts}" == "0" ]; then hostpower="${idsCL[Default]}n/a"
else hostpower="${idsCL[Green]}${watts} W"
echo -e "${idsCL[LightCyan]}HOST '${PW_iDRACHOST_SHORTNAMES[${host}]}' ${idsCL[Default]}: ${hostpower}${idsCL[Default]}"
mv ${hostfile} ${hostfile}.done mv ${hostfile} ${hostfile}.done
elif [ "${host}" == "done" ]; then elif [ "${host}" == "done" ]; then
@@ -789,6 +791,7 @@ POWERLOGGER_SERVICE(){
SVRRM_AMP=$(snmpwalk -v 1 -c public 10.10.1.205 iso.3.6.1.2.1.33.1.4.4.1.3.1 | sed 's/.*: //') SVRRM_AMP=$(snmpwalk -v 1 -c public 10.10.1.205 iso.3.6.1.2.1.33.1.4.4.1.3.1 | sed 's/.*: //')
SVRRM_AMP=`echo "scale=1; ${SVRRM_AMP}/10" | bc` SVRRM_AMP=`echo "scale=1; ${SVRRM_AMP}/10" | bc`
APCPDU_AMP=$(snmpwalk -v 1 -c public 10.10.1.210 .1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1 | sed 's/.*: //') APCPDU_AMP=$(snmpwalk -v 1 -c public 10.10.1.210 .1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1 | sed 's/.*: //')
APCPDU_AMP=`echo "scale=1; ${APCPDU_AMP}/10" | bc` APCPDU_AMP=`echo "scale=1; ${APCPDU_AMP}/10" | bc`
# APCPDU_WATT=$(snmpwalk -v 1 -c public 10.10.1.210 .1.3.6.1.4.1.318.1.1.12.1.16.0 | sed 's/.*: //') # APCPDU_WATT=$(snmpwalk -v 1 -c public 10.10.1.210 .1.3.6.1.4.1.318.1.1.12.1.16.0 | sed 's/.*: //')