Aggiunge monitoraggio ops: health check, log scanner, dashboard e notifiche.
Introduce incidenti con dedup, job Sidekiq ogni 3 min, scan log cron, /up/deep, dashboard /admin/ops e push ntfy; include Sentry opzionale e fix test suite. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
18
infra/scripts/cron/scan_ops_logs.sh
Normal file
18
infra/scripts/cron/scan_ops_logs.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
# Scansiona log Docker recenti e invia pattern sospetti a Rails ops:ingest_logs.
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="${MATCHLIVETV_INFRA:-/opt/matchlivetv/infra}"
|
||||
SINCE="${OPS_LOG_SCAN_SINCE:-10m}"
|
||||
TMP="$(mktemp)"
|
||||
trap 'rm -f "$TMP"' EXIT
|
||||
|
||||
cd "$ROOT"
|
||||
|
||||
docker compose -f docker-compose.prod.yml logs --since "$SINCE" rails sidekiq mediamtx 2>/dev/null > "$TMP" || true
|
||||
|
||||
if [[ ! -s "$TMP" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
"${ROOT}/scripts/cron/run_rails_task.sh" ops:ingest_logs["$TMP"]
|
||||
Reference in New Issue
Block a user