update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
VERS='2.7.22-04282024'
|
||||
VERS='2.7.24-04302024'
|
||||
|
||||
noheader=' update service dailytemp confsync -r -report '
|
||||
|
||||
|
||||
@@ -942,10 +942,15 @@ Previous Temp: ${last_temp}${GAUGESH}"
|
||||
[ $(bc -l <<< "${temp_diff} < 0") -eq 1 ] && temp_diff=`echo "scale=2; ${temp_diff}*-1" | bc`
|
||||
|
||||
if [ $(bc -l <<< "${temp_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit}") -eq 1 ]; then
|
||||
|
||||
# [[ "${SENSOR}" = *"${PW_SHUTDOWN_SENSORS}"* ]] && touch ${PW_TMPFOLDER}/temp.warn
|
||||
touch ${PW_TMPFOLDER}/temp.warn.${SENSOR}
|
||||
if (( $(bc <<< "${temp_diff} >= 1") )); then
|
||||
|
||||
if [ ! -f ${PW_TMPFOLDER}/temp.warn.${SENSOR}.pre ]; then
|
||||
touch ${PW_TMPFOLDER}/temp.warn.${SENSOR}.pre
|
||||
|
||||
elif [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/temp.warn.${SENSOR}.pre)) -ge 120 ]; then
|
||||
# if (( $(bc <<< "${temp_diff} >= 1") )); then
|
||||
touch ${PW_TMPFOLDER}/temp.warn.${SENSOR}.pre
|
||||
SENDNOTICE "${SENSOR} ${GAUGE} WARNING" "WARNING ${GAUGE}: ${temp_f}${GAUGESH} - (Difference of ${temp_diff}${GAUGESH})" 1
|
||||
if [ "${last_temp}" != "${temp_f}" ]; then
|
||||
last_temp=${temp_f}
|
||||
@@ -957,7 +962,12 @@ Previous Temp: ${last_temp}${GAUGESH}"
|
||||
|
||||
|
||||
elif [ $(bc -l <<< "${temp_f} >= ${temp_crit}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit_sys}") -eq 1 ]; then
|
||||
if (( $(bc <<< "${temp_diff} >= 1") )); then
|
||||
if [ ! -f ${PW_TMPFOLDER}/temp.crit.${SENSOR}.pre ]; then
|
||||
touch ${PW_TMPFOLDER}/temp.crit.${SENSOR}.pre
|
||||
|
||||
elif [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/temp.crit.${SENSOR}.pre)) -ge 120 ]; then
|
||||
# if (( $(bc <<< "${temp_diff} >= 1") )); then
|
||||
touch ${PW_TMPFOLDER}/temp.crit.${SENSOR}.pre
|
||||
SENDNOTICE "${SENSOR} ${GAUGE} CRITICAL" "CRITICAL ${GAUGE}: ${temp_f}${GAUGESH} - (Difference of ${temp_diff}${GAUGESH})" 1
|
||||
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - CRITICAL - (Difference of ${temp_diff}${GAUGESH})" >> ${logtemp}
|
||||
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} - ${temp_f}${GAUGESH} - CRITICAL ${GAUGE} - (Difference of ${temp_diff}${GAUGESH})" >> ${PW_LOGFILE}
|
||||
@@ -979,7 +989,12 @@ Previous Temp: ${last_temp}${GAUGESH}"
|
||||
fi
|
||||
fi
|
||||
elif [ $(bc -l <<< "${temp_f} >= ${temp_crit_sys}") -eq 1 ]; then
|
||||
if (( $(bc <<< "${temp_diff} >= 1") )); then
|
||||
if [ ! -f ${PW_TMPFOLDER}/temp.critsys.${SENSOR}.pre ]; then
|
||||
touch ${PW_TMPFOLDER}/temp.critsys.${SENSOR}.pre
|
||||
|
||||
elif [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/temp.critsys.${SENSOR}.pre)) -ge 120 ]; then
|
||||
# if (( $(bc <<< "${temp_diff} >= 1") )); then
|
||||
touch ${PW_TMPFOLDER}/temp.critsys.${SENSOR}.pre
|
||||
SENDNOTICE "${SENSOR} TEMP CRITICAL" "SYSTEM CRITICAL ${GAUGE}: ${temp_f}${GAUGESH} - (Difference of ${temp_diff}${GAUGESH})" 1
|
||||
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - SYSTEM CRITICAL - (Difference of ${temp_diff})" >> ${logtemp}
|
||||
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - ${SENSOR} - CRITICAL ${GAUGE} SYSTEM - (Difference of ${temp_diff}${GAUGESH})" >> ${PW_LOGFILE}
|
||||
|
||||
Reference in New Issue
Block a user