Update powerwall.sh

This commit is contained in:
2023-11-04 11:05:29 -05:00
parent 707164234f
commit 05410d5e2a

View File

@@ -55,16 +55,15 @@ CHECKTEMP(){
if [ ${#vHOST_TEMPNAMES[@]} > 1 ]; then
t=1
for sensorname in "${vHOST_TEMPNAMES[@]}"; do
echo ${t}
temp_c=$(snmpwalk -v 1 -c public -t 2 10.10.2.20 .1.3.6.1.4.1.674.10892.5.4.700.20.1.6.1.${t} -O vq | sed -e 's/"//g')
echo $temp_c
temp_c=`echo "scale=2; ${temp_c}/10" | bc`
# temp_warn=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $7}' | sed -e 's/C//g'); temp_warn=${temp_warn/ /}
# temp_crit=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g'); temp_crit=${temp_crit/ /}
# reading=$(CHECKTEMPSENSOR ${SENSOR} ${temp_c} ${temp_warn} ${temp_crit} ${sensorname// /_} ${1})
temp_c=`echo "scale=1; ${temp_c}/10" | bc`
temp_warn=$(snmpwalk -v 1 -c public -t 2 10.10.2.20 .1.3.6.1.4.1.674.10892.5.4.700.20.1.11.1.${t} -O vq | sed -e 's/"//g')
temp_warn=`echo "scale=1; ${temp_warn}/10" | bc`
temp_crit=$(snmpwalk -v 1 -c public -t 2 10.10.2.20 .1.3.6.1.4.1.674.10892.5.4.700.20.1.10.1.${t} -O vq | sed -e 's/"//g')
temp_crit=`echo "scale=1; ${temp_crit}/10" | bc`
reading=$(CHECKTEMPSENSOR ${SENSOR} ${temp_c} ${temp_warn} ${temp_crit} ${sensorname// /_} ${1})
c=0; spc=''; spc1=`expr ${cw} - ${#sensorname} - 1`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
echo -e "${idsCL[LightCyan]} ${sensorname}${spc}${idsCL[Default]}: ${temp_c} - ${reading}"
echo -e "${idsCL[LightCyan]} ${sensorname}${spc}${idsCL[Default]}: ${reading}"
((t++))
done