From 7432e06f58e667a489627b0f21d47d2c03e66d62 Mon Sep 17 00:00:00 2001 From: Trey Blancher Date: Sat, 19 Aug 2023 13:35:48 -0400 Subject: [PATCH] Added journalctl --lines/-n parameter to only post the last 3 lines, not 10 --- psi-alerts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psi-alerts.sh b/psi-alerts.sh index 17b8fc4..f48594b 100755 --- a/psi-alerts.sh +++ b/psi-alerts.sh @@ -228,7 +228,7 @@ typeset -A notice_sent typeset -A secs integer last_dunst_id=-1 -journalctl -b 0 -fu "${svc}" | \ +journalctl -b 0 -fn 3 -u "${svc}" | \ while read line; do local psi_type="$(grep -Eo "(CPU|MEM|IO) PSI event" <<< "${line}" | grep -Eo "CPU|MEM|IO")" if [[ -n "${psi_type}" ]]; then