From 8c2ae458c209be53e2e0b2664d076925f21144cd Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 4 Nov 2023 11:00:46 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index b4a708e1..aeac8217 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -57,9 +57,10 @@ CHECKTEMP(){ 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/ /} + # 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}) c=0; spc=''; spc1=`expr ${cw} - ${#sensorname} - 1`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done