Update temp.inc.sh

This commit is contained in:
2024-01-30 14:57:26 -06:00
parent e4e919d9a3
commit 156b40e0da

View File

@@ -103,7 +103,7 @@ CHECKTEMP(){
else
echo -e "${idsCL[Default]}"
fi
if [ "${temptype}" != "fans" ]; then
# if [ "${temptype}" != "fans" ]; then
DIVIDER . lightCyan 70
echo -en "${idsCL[Yellow]}Pulling data for '${SENSOR}' ... "
@@ -117,21 +117,23 @@ CHECKTEMP(){
if [ ${#vHOST_TEMPNAMES[@]} -gt 1 ]; then
t=1
for sensorname in "${vHOST_TEMPNAMES[@]}"; do
temp_c=$(snmpwalk -v 1 -c public -t 2 ${vHOSTiDRACIP} .1.3.6.1.4.1.674.10892.5.4.700.20.1.6.1.${t} -O vq | sed -e 's/"//g')
temp_c=`echo "scale=1; ${temp_c}/10" | bc`
temp_warn=$(snmpwalk -v 1 -c public -t 2 ${vHOSTiDRACIP} .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 ${vHOSTiDRACIP} .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`
if [ "${temptype}" != "fans" ] || ([ "${temptype}" == "fans" ] && [[ "${sensorname}" = *"Exhaust"* ]]); then
temp_c=$(snmpwalk -v 1 -c public -t 2 ${vHOSTiDRACIP} .1.3.6.1.4.1.674.10892.5.4.700.20.1.6.1.${t} -O vq | sed -e 's/"//g')
temp_c=`echo "scale=1; ${temp_c}/10" | bc`
temp_warn=$(snmpwalk -v 1 -c public -t 2 ${vHOSTiDRACIP} .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 ${vHOSTiDRACIP} .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`
c=0; spc=''; spc1=`expr ${cw} - ${#sensorname} - 1`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
c=0; spc=''; spc1=`expr ${cw} - ${#sensorname} - 1`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
[ "${avgdays}" != "noavg" ] && echo -en "${idsCL[LightCyan]} ${sensorname}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Calculating ${avgdays_disp} average ... "
reading=$(CHECKTEMPSENSOR ${SENSOR} ${temp_c} ${temp_warn} ${temp_crit} ${sensorname// /_} ${avgdays})
[ "${avgdays}" != "noavg" ] && echo -en "\r\033[K"
echo -e "${idsCL[LightCyan]} ${sensorname}${spc}${idsCL[Default]}: ${reading}"
[ "${avgdays}" != "noavg" ] && echo -en "${idsCL[LightCyan]} ${sensorname}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Calculating ${avgdays_disp} average ... "
reading=$(CHECKTEMPSENSOR ${SENSOR} ${temp_c} ${temp_warn} ${temp_crit} ${sensorname// /_} ${avgdays})
[ "${avgdays}" != "noavg" ] && echo -en "\r\033[K"
echo -e "${idsCL[LightCyan]} ${sensorname}${spc}${idsCL[Default]}: ${reading}"
((t++))
((t++))
fi
done
else
echo -e "${idsCL[LightCyan]} ${vHOSTNAME}${spc}${idsCL[Default]}: No Data"
@@ -146,7 +148,7 @@ CHECKTEMP(){
# touch ${PW_TMPFOLDER}/${EHOST}.down
# fi
fi
fi
# fi
echo
fi