Removed last remaining trace of last_alarm, only alert if it's new

This commit is contained in:
Trey Blancher 2023-08-25 18:06:02 -04:00
parent 427fb181d1
commit 7c6742a1b2

View File

@ -282,7 +282,6 @@ while true; do
integer elapsed=$(( now - ${secs[${alarm}]} ))
if is_clear "${alarm}" && (( elapsed >= 300 )); then
current_alarms=$(sed -E "s/${alarm}\|?//" <<< "${current_alarms}")
last_alarm=$(awk -F'|' '{print $NF}' <<< "${current_alarms}")
unset "notice_sent[${alarm}]"
unset "secs[${alarm}]"
fi
@ -296,6 +295,7 @@ while true; do
continue
fi
last_line="${line}"
if (( time_diff < 3 )); then
local psi_type="$(grep -Eo "(CPU|MEM|IO) PSI event" <<< "${line}" | grep -Eo "CPU|MEM|IO")"
if [[ -n "${psi_type}" ]]; then
secs+=(${psi_type} ${now})
@ -314,6 +314,7 @@ while true; do
fi
fi
fi
fi
sleep 1
done
#set +x