From dcec7c0c58ded729b2bcac588af7f04460731dd3 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 23 Oct 2023 10:21:52 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index ae53a4d7..25fc270b 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -30,8 +30,8 @@ CHECKTEMP(){ vHOSTIP=${PW_HOST_ADDRESSES[${SENSOR}]} vHOSTNAME=${PW_ESXI_HOST_NAMES[${vHOSTiDRACIP}]} echo -e "\r\033[K${idsCL[LightCyan]}${idsST[Bold]}${SENSOR} Host Sensors ${idsST[Reset]}${idsCL[LightCyan]}- ${vHOSTiDRACIP}${idsCL[Default]}" - # echo -en "${idsCL[Yellow]}Pulling data and calculating averages for '${SENSOR}' ..." - echo -en "${idsCL[Yellow]}Pulling data for '${SENSOR}' ..." + echo -en "${idsCL[Yellow]}Pulling data and calculating averages for '${SENSOR}' ..." + # echo -en "${idsCL[Yellow]}Pulling data for '${SENSOR}' ..." if [ "$(CHECK_HOST ${vHOSTIP})" != "false" ]; then vHOSTDATA=$(ssh root@${PW_RACADM_ACCESS} racadm -r ${vHOSTiDRACIP} -u ${PW_ESXI_USER} -p "'${PW_ESXI_PASS}'" getsensorinfo | grep " Temp" 2>&1) @@ -154,7 +154,7 @@ AVERAGETEMP(){ daysback=${2} sensorid=${1} logsfound=0; - if [ "${PW_SENSOR_TYPE[${sensorid}]}" == "esxi" ]; then + if [ "${3}" != "" ]; 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}"