From 8e4fb60d2e1bca4e478f9fdd9fadabf4713995ad Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 1 Mar 2024 22:42:16 -0600 Subject: [PATCH] update --- defaults.inc | 2 +- inc/temp.inc.sh | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/defaults.inc b/defaults.inc index 1cae75c5..8012f93a 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='2.6.52-02262024' +VERS='2.6.54-03012024' noheader=' update service dailytemp confsync -r -report ' diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index ae88134b..0cd23d51 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -183,7 +183,12 @@ CHECKTEMP(){ fi if [ "${temp_h}" != "" ] && [ "${temp_h}" != "0" ]; then - echo -e " ${idsCL[White]}|-- ${idsCL[Default]}Humidity ${idsCL[LightCyan]}$(ROUND_NUMBER ${temp_h} 2)%${idsCL[Default]}" + echo -en " ${idsCL[White]}|-- ${idsCL[Default]}Humidity ${idsCL[LightCyan]}$(ROUND_NUMBER ${temp_h} 2)%" + if [ "${avgdays}" != "noavg" ]; then + echo -en " / ${idsCL[Yellow]}Calculating ${avgdays_disp} average ... " + average=$(AVERAGETEMP ${SENSOR} ${avgdays} hum) + fi + echo -e "${idsCL[Default]}" fi echo @@ -432,7 +437,7 @@ AVERAGETEMP(){ sensor=${1} sensorid=${PW_SENSOR_ID[${sensor}]} logsfound=0; - if [ "${3}" != "" ]; then + if [ "${3}" != "" ] && [ "${3}" != "hum" ]; then entityid=($(${mysql_conn} -e "SELECT id FROM servermonitor.entities WHERE BINARY name='${3}' AND sensorid='${sensorid}'")) entityid=${entityid[1]} WHERE="sensorid=${sensorid} AND entity=${entityid}" @@ -453,6 +458,8 @@ AVERAGETEMP(){ while IFS=$'\t' read date temp hum speed ;do if ([ "${3}" == "FanSpeed" ] && [[ "${PW_ESXI_FANSPEEDCONTROL_HOSTS}" = *"${PW_HOST_IDRACS[${sensor}]}"* ]]) || [ "${sensorid}" == "19" ]; then val=${speed} + elif [ "${3}" == "hum" ]; then + val=${hum} else val=${temp} fi