From 1e5475247823fde5a136673057156aaaff2a316c Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sun, 7 Jun 2026 09:39:16 -0400 Subject: [PATCH] Fix digest falsely counting = style state entries as system watchdog strikes grep -v ':0$' was picking up kernel_oops_count=00, mdstat_errors=0, and watchdog_cycle as active strikes. Restrict to : separator lines only. --- Monitors/weekly_health_digest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Monitors/weekly_health_digest.sh b/Monitors/weekly_health_digest.sh index 9f6e419..d273563 100755 --- a/Monitors/weekly_health_digest.sh +++ b/Monitors/weekly_health_digest.sh @@ -242,9 +242,9 @@ fi # ── System Watchdog Strikes ─────────────────────────────────────────────────────────────────── if [[ -f "$SYS_WATCHDOG_STATE_FILE" ]]; then - SYS_STRIKES=$(grep -v ":0$" "$SYS_WATCHDOG_STATE_FILE" 2>/dev/null | grep -c ".") + SYS_STRIKES=$(grep "^[^=]*:" "$SYS_WATCHDOG_STATE_FILE" 2>/dev/null | grep -cv -E "(:0$|:false$)") if [[ "$SYS_STRIKES" -gt 0 ]]; then - SYS_STRIKE_LIST=$(grep -v ":0$" "$SYS_WATCHDOG_STATE_FILE" 2>/dev/null | tr '\n' ' ') + SYS_STRIKE_LIST=$(grep "^[^=]*:" "$SYS_WATCHDOG_STATE_FILE" 2>/dev/null | grep -v -E "(:0$|:false$)" | tr '\n' ' ') DIGEST_LINES+=("$ICON_REBOOT_SMART System strikes: $SYS_STRIKES active — $SYS_STRIKE_LIST") FINDINGS+=("System watchdog: $SYS_STRIKES active strikes") [[ "$DIGEST_SMART_ON_WATCHDOG" == true ]] && SHOULD_SEND=true