diff --git a/scripts/monitor-erik.sh b/scripts/monitor-erik.sh index 72a882b..43b27f3 100755 --- a/scripts/monitor-erik.sh +++ b/scripts/monitor-erik.sh @@ -24,9 +24,9 @@ set -euo pipefail # ── Config ─────────────────────────────────────────────────────────────────── -TIP_API="${TIP_API:-https://tip.fichtmueller.org/api/health}" +TIP_API="${TIP_API:-https://transceiver-db.context-x.org/api/health}" NTFY_TOPIC="${NTFY_TOPIC:-}" # e.g. "tip-erik-alerts" -SSH_TARGET="${SSH_TARGET:-erik-cf}" # SSH alias for Erik +SSH_TARGET="${SSH_TARGET:-root@82.165.222.127}" # Erik IONOS direct (Claudi key authorized) LOAD_WARN="${LOAD_WARN:-4.0}" # 1m load warning threshold DISK_WARN="${DISK_WARN:-85}" # disk % warning threshold MEM_WARN="${MEM_WARN:-90}" # memory % warning threshold @@ -119,7 +119,7 @@ if ssh -o ConnectTimeout=10 -o BatchMode=yes "$SSH_TARGET" true 2>/dev/null; the # Check restart counts (> 5 in the last run = likely crashing) HIGH_RESTARTS=$(ssh -o ConnectTimeout=10 "$SSH_TARGET" \ - "pm2 list --no-color 2>/dev/null | awk '{if(\$16 > 5) print \$2, \"restarts:\", \$16}'" \ + "pm2 list --no-color 2>/dev/null | awk 'NR>3 && \$16~/^[0-9]+$/ && \$16+0 > 5 {print \$2, \"restarts:\", \$16}'" \ 2>/dev/null || echo "") if [[ -n "$HIGH_RESTARTS" ]]; then