Update temp.inc.sh
This commit is contained in:
@@ -288,11 +288,6 @@ AVERAGETEMP(){
|
|||||||
# echo ${logsfound}
|
# echo ${logsfound}
|
||||||
}
|
}
|
||||||
|
|
||||||
SENDTEMPS(){
|
|
||||||
st_temps=$(DAILYTEMP)
|
|
||||||
SENDNOTICE "${1}" "${st_temps}"
|
|
||||||
}
|
|
||||||
|
|
||||||
CHECKTEMP_SERVICE(){
|
CHECKTEMP_SERVICE(){
|
||||||
cw=20
|
cw=20
|
||||||
declare -A last_temp
|
declare -A last_temp
|
||||||
@@ -305,7 +300,7 @@ CHECKTEMP_SERVICE(){
|
|||||||
# if [ ! -f ${PW_TMPFOLDER}/temp.* ] && [ $(date +%H)$(date +%M) -ge 0700 ] && [ $(date +%H)$(date +%M) -lt 0705 ]; then
|
# if [ ! -f ${PW_TMPFOLDER}/temp.* ] && [ $(date +%H)$(date +%M) -ge 0700 ] && [ $(date +%H)$(date +%M) -lt 0705 ]; then
|
||||||
# if [ ! -f ${PW_TMPFOLDER}/.sentdaily ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.sentdaily)) -gt 600 ]; then
|
# if [ ! -f ${PW_TMPFOLDER}/.sentdaily ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.sentdaily)) -gt 600 ]; then
|
||||||
# touch ${PW_TMPFOLDER}/.sentdaily
|
# touch ${PW_TMPFOLDER}/.sentdaily
|
||||||
# SENDTEMPS "Daily Temp Readings" &
|
# SENDTEMPS "Daily Temp Readings" yes &
|
||||||
# fi
|
# fi
|
||||||
# fi
|
# fi
|
||||||
SENSORS_CHECKED=()
|
SENSORS_CHECKED=()
|
||||||
@@ -645,10 +640,15 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
|
|||||||
touch ${PW_TMPFOLDER}/zservicerun.${SENSORa}.done
|
touch ${PW_TMPFOLDER}/zservicerun.${SENSORa}.done
|
||||||
}
|
}
|
||||||
|
|
||||||
DAILYTEMP(){
|
SENDTEMPS(){
|
||||||
|
st_temps=$(SENDTEMP ${2})
|
||||||
|
SENDNOTICE "${1}" "${st_temps}"
|
||||||
|
}
|
||||||
|
SENDTEMP(){
|
||||||
cw=35;
|
cw=35;
|
||||||
echo
|
echo
|
||||||
echo -e "Sensor Temperature(s) Now / 1DayAVG / 7DayAVG"
|
echo -en "Sensor Temperature(s)"
|
||||||
|
[ "${1}" != "" ] && echo " Now / 1DayAVG / 7DayAVG" || echo
|
||||||
DIVIDER . . 60
|
DIVIDER . . 60
|
||||||
for SENSORa in ${PW_SENSOR_ORD[@]}; do
|
for SENSORa in ${PW_SENSOR_ORD[@]}; do
|
||||||
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" != "esxi" ]; then
|
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" != "esxi" ]; then
|
||||||
@@ -685,20 +685,20 @@ DAILYTEMP(){
|
|||||||
temp_c=''
|
temp_c=''
|
||||||
|
|
||||||
fi
|
fi
|
||||||
# if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ]; then
|
if [ "${1}" != "" ]; then
|
||||||
# average1=$(AVERAGETEMP ${PW_SENSOR_ID[${SENSORa}]} 1 ${vSENSOR// /_})
|
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "esxi" ]; then
|
||||||
# average7=$(AVERAGETEMP ${PW_SENSOR_ID[${SENSORa}]} 7 ${vSENSOR// /_})
|
average1=$(AVERAGETEMP ${PW_SENSOR_ID[${SENSORa}]} 1 ${vSENSOR// /_})
|
||||||
# else
|
average7=$(AVERAGETEMP ${PW_SENSOR_ID[${SENSORa}]} 7 ${vSENSOR// /_})
|
||||||
# average1=$(AVERAGETEMP ${PW_SENSOR_ID[${SENSORa}]} 1)
|
else
|
||||||
# average7=$(AVERAGETEMP ${PW_SENSOR_ID[${SENSORa}]} 7)
|
average1=$(AVERAGETEMP ${PW_SENSOR_ID[${SENSORa}]} 1)
|
||||||
# fi
|
average7=$(AVERAGETEMP ${PW_SENSOR_ID[${SENSORa}]} 7)
|
||||||
average1=0
|
fi
|
||||||
average7=0
|
fi
|
||||||
|
|
||||||
c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
|
c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
|
||||||
if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; then
|
if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; then
|
||||||
temp_f=`echo "scale=2; ${temp_c}*1.8 + 32" | bc`
|
temp_f=`echo "scale=2; ${temp_c}*1.8 + 32" | bc`
|
||||||
echo -e "${SENSOR}${spc}${temp_f}'F / ${average1}'F / ${average7}'F"
|
[ "${1}" != "" ] && echo -e "${SENSOR}${spc}${temp_f}'F / ${average1}'F / ${average7}'F" || echo -e "${SENSOR}${spc}${temp_f}'F"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo -e "${SENSOR}${spc}No Data"
|
echo -e "${SENSOR}${spc}No Data"
|
||||||
|
|||||||
Reference in New Issue
Block a user