This commit is contained in:
2024-01-01 12:36:35 -06:00
parent 814fac4d25
commit 5f56848d99
2 changed files with 4 additions and 3 deletions

View File

@@ -273,6 +273,7 @@ CHECKTEMP_SERVICE(){
SCAN_THREADS=4
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - 'Check Temp' Service Startup" >> ${PW_LOGFILE}
SENDTEMPS "TEMP Service Startup" &
[ -d ${PW_TMPFOLDER}/.lastinsert ] && mkdir ${PW_TMPFOLDER}/.lastinsert
[ -d ${PW_TMPFOLDER}/.lasttemp ] && rm -Rf ${PW_TMPFOLDER}/.lasttemp
mkdir ${PW_TMPFOLDER}/.lasttemp
rm -f ${PW_TMPFOLDER}/ztemprun.*
@@ -593,7 +594,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
fi
fi
[ -f ${PW_TMPFOLDER}/${SENSOR}.insert ] && lastinsert=$(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}.insert)) || lastinsert=100000
[ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR} ] && lastinsert=$(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.lastinsert/${SENSOR})) || lastinsert=100000
if [ $(ls ${PW_TMPFOLDER}/temp.* 2>/dev/null | wc -l) -gt 0 ] || [ -f ${PW_TMPFOLDER}/power.ac.low ] || [ -f ${PW_TMPFOLDER}/power.dc.low ]; then
wait=$(echo "scale=0; ${PW_MYSQL_LOG_INTERVAL_ABNORMAL}*60" | bc)
else
@@ -624,7 +625,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
# if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "lacrosse" ]; then
# ${mysql_conn} -e "USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`) VALUES ('${PW_SENSOR_ID["${SENSORa}-Probe"]}','$(date +'%Y-%m-%d %H:%M:%S')','${temp_probe_f}')"
# fi
touch ${PW_TMPFOLDER}/${SENSOR}.insert
touch ${PW_TMPFOLDER}/.lastinsert/${SENSOR}
fi
#### LOGGING OF SERVERROOM SENSOR DIFFERENCE