This commit is contained in:
2024-03-01 22:42:16 -06:00
parent a1db3da15a
commit 8e4fb60d2e
2 changed files with 10 additions and 3 deletions

View File

@@ -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 '

View File

@@ -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