Update powerwall.sh

This commit is contained in:
2023-10-23 08:51:39 -05:00
parent 8eee774f4d
commit 408e97f699

View File

@@ -385,8 +385,9 @@ Previous Temp: ${last_temp[${SENSOR}]}'F"
entityid=($(${mysql_conn} -e "SELECT id FROM servermonitor.entities WHERE BINARY name='${vSENSOR// /_}' AND sensorid='${PW_SENSOR_ID[${SENSORa}]}'"))
fi
entityid=${entityid[1]}
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`entity\`, \`date\`, \`temp\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','${entityid}','${datetime}','${temp_f}')"
echo "HERE: $QRY"
if [ "${PW_HOST_IDRACS[${SENSORa}]}" == "10.2.1.21" ] && [ "${vSENSOR// /_}" == "System_Board_Inlet" ]; then
QRY2="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`speed\`) VALUES ('14','${datetime}','${FanSpeed}')"
${mysql_conn} -e "${QRY2}"