Update temp.inc.sh
This commit is contained in:
@@ -678,7 +678,6 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
|
|||||||
SENDNOTICE "${SENSOR} Data" "${SENSOR} is reporting data again"
|
SENDNOTICE "${SENSOR} Data" "${SENSOR} is reporting data again"
|
||||||
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} - Sensor is reporting data again" >> ${logtemp}
|
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} - Sensor is reporting data again" >> ${logtemp}
|
||||||
fi
|
fi
|
||||||
rm -f ${PW_TMPFOLDER}/${SENSOR}*
|
|
||||||
fi
|
fi
|
||||||
if [ "${SENSORa}" == "iDS-vMS-Host6" ] && [ ! -f ${PW_TMPFOLDER}/.lastfancheck/iDS-vMS-Host6.set ]; then
|
if [ "${SENSORa}" == "iDS-vMS-Host6" ] && [ ! -f ${PW_TMPFOLDER}/.lastfancheck/iDS-vMS-Host6.set ]; then
|
||||||
[ -f ${PW_TMPFOLDER}/.lastfancheck/iDS-vMS-Host7.set ] && nfs=$(cat ${PW_TMPFOLDER}/.lastfancheck/iDS-vMS-Host7.set) || nfs=35
|
[ -f ${PW_TMPFOLDER}/.lastfancheck/iDS-vMS-Host7.set ] && nfs=$(cat ${PW_TMPFOLDER}/.lastfancheck/iDS-vMS-Host7.set) || nfs=35
|
||||||
@@ -890,6 +889,7 @@ Previous Temp: ${last_temp}${GAUGESH}"
|
|||||||
|
|
||||||
if [ "${PW_SENSOR_ID[${SENSORa}]}" != "" ] && [ ${lastinsert} -ge ${wait} ]; then
|
if [ "${PW_SENSOR_ID[${SENSORa}]}" != "" ] && [ ${lastinsert} -ge ${wait} ]; then
|
||||||
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ]; then
|
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ]; then
|
||||||
|
rm -f ${PW_TMPFOLDER}/${SENSOR}*
|
||||||
entityid=($(${mysql_conn} -e "SELECT id FROM servermonitor.entities WHERE BINARY name='${vSENSOR// /_}' AND sensorid='${PW_SENSOR_ID[${SENSORa}]}'"))
|
entityid=($(${mysql_conn} -e "SELECT id FROM servermonitor.entities WHERE BINARY name='${vSENSOR// /_}' AND sensorid='${PW_SENSOR_ID[${SENSORa}]}'"))
|
||||||
if [ "${entityid[1]}" == "" ]; then
|
if [ "${entityid[1]}" == "" ]; then
|
||||||
${mysql_conn} -e "USE servermonitor; INSERT INTO entities (\`sensorid\`, \`name\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','${vSENSOR// /_}')"
|
${mysql_conn} -e "USE servermonitor; INSERT INTO entities (\`sensorid\`, \`name\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','${vSENSOR// /_}')"
|
||||||
@@ -909,10 +909,13 @@ Previous Temp: ${last_temp}${GAUGESH}"
|
|||||||
${mysql_conn} -e "USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`entity\`, \`date\`, \`speed\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','${entityid}','$(date +'%Y-%m-%d %H:%M:%S')','${FanSpeed}')"
|
${mysql_conn} -e "USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`entity\`, \`date\`, \`speed\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','${entityid}','$(date +'%Y-%m-%d %H:%M:%S')','${FanSpeed}')"
|
||||||
fi
|
fi
|
||||||
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "system" ] && [[ "${SENSORa}" = *"FAN"* ]]; then
|
elif [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "system" ] && [[ "${SENSORa}" = *"FAN"* ]]; then
|
||||||
|
rm -f ${PW_TMPFOLDER}/${SENSOR}*
|
||||||
${mysql_conn} -e "USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`speed\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','$(date +'%Y-%m-%d %H:%M:%S')','${temp_f}')"
|
${mysql_conn} -e "USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`speed\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','$(date +'%Y-%m-%d %H:%M:%S')','${temp_f}')"
|
||||||
elif [ "${temp_h}" != "" ] && [ "${temp_h}" != "0" ]; then
|
elif [ "${temp_h}" != "" ] && [ "${temp_h}" != "0" ]; then
|
||||||
|
rm -f ${PW_TMPFOLDER}/${SENSOR}*
|
||||||
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`, \`hum\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','$(date +'%Y-%m-%d %H:%M:%S')','${temp_f}','${temp_h}')"
|
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`, \`hum\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','$(date +'%Y-%m-%d %H:%M:%S')','${temp_f}','${temp_h}')"
|
||||||
elif [ "${temp_f}" != "32.00" ]; then
|
elif [ "${temp_f}" != "32.00" ]; then
|
||||||
|
rm -f ${PW_TMPFOLDER}/${SENSOR}*
|
||||||
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','$(date +'%Y-%m-%d %H:%M:%S')','${temp_f}')"
|
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`) VALUES ('${PW_SENSOR_ID[${SENSORa}]}','$(date +'%Y-%m-%d %H:%M:%S')','${temp_f}')"
|
||||||
|
|
||||||
elif [ "${SENSOR}" == "Powerwall-Switch" ]; then
|
elif [ "${SENSOR}" == "Powerwall-Switch" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user