Update powerwall.sh

This commit is contained in:
2023-10-23 10:21:52 -05:00
parent 4c6a34a640
commit dcec7c0c58

View File

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