fix(zulip-monitor): stream alert body carries real content; WARN on delivery failure #68
@@ -0,0 +1,2 @@
|
|||||||
|
<!-- Points Claude at AGENTS.md via import; edit AGENTS.md, not this file. -->
|
||||||
|
@AGENTS.md
|
||||||
@@ -162,7 +162,7 @@ Companion shell scripts that contracts delegate to.
|
|||||||
|---|---|
|
|---|---|
|
||||||
| `daily-infra-report.py` | Generates the daily infrastructure dashboard (HTML email to jerome@sysloggh.com). |
|
| `daily-infra-report.py` | Generates the daily infrastructure dashboard (HTML email to jerome@sysloggh.com). |
|
||||||
| `pm2-self-heal.sh` | Shell companion to the pm2-self-heal contract — restarts crashed PM2 processes (runs every 5 min). |
|
| `pm2-self-heal.sh` | Shell companion to the pm2-self-heal contract — restarts crashed PM2 processes (runs every 5 min). |
|
||||||
| `agent-health-check.py` | Consolidated agent health: LiteLLM key validation + GPU port conflict + streaming checks (every 10 min). Replaced zulip-monitor.sh. |
|
| `agent-health-check.py` | Consolidated agent health: LiteLLM key validation + GPU port conflict + streaming checks (every 10 min). |
|
||||||
|
|
||||||
## Contract Structure
|
## Contract Structure
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# /root/scripts/zulip-monitor.sh — Zulip Mesh Health Monitor
|
# /root/scripts/zulip-monitor.sh — Zulip Mesh Health Monitor
|
||||||
# Implements zulip-health.prose.md v2
|
# Implements zulip-health.prose.md v2
|
||||||
# Runs every 15 min via cron. Alerts via Telegram.
|
# Runs every 15 min via cron. Alerts: Zulip private DM to the owner plus a stream post to #agent-hub on topic 'zulip-health'.
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
ZULIP_SITE="https://chat.sysloggh.net"
|
ZULIP_SITE="https://chat.sysloggh.net"
|
||||||
@@ -29,8 +29,9 @@ notify() {
|
|||||||
local stream_content="${severity} Zulip Monitor: ${msg}"
|
local stream_content="${severity} Zulip Monitor: ${msg}"
|
||||||
curl -sf -X POST "${ZULIP_SITE}/api/v1/messages" \
|
curl -sf -X POST "${ZULIP_SITE}/api/v1/messages" \
|
||||||
-u "${ZULIP_EMAIL}:${ZULIP_KEY}" \
|
-u "${ZULIP_EMAIL}:${ZULIP_KEY}" \
|
||||||
-d "type=stream\&to=%5B7%5D\&topic=zulip-health\&content=$(python3 -c "import urllib.parse; print(urllib.parse.quote(str()))")" \
|
-d "type=stream&to=%5B7%5D&topic=zulip-health&content=$(printf '%s' "${stream_content}" | python3 -c "import sys,urllib.parse; print(urllib.parse.quote_from_bytes(sys.stdin.buffer.read()))")" \
|
||||||
> /dev/null 2>&1 || true
|
> /dev/null 2>&1 \
|
||||||
|
|| echo " WARN: stream alert to #agent-hub (zulip-health) delivery failed (curl exit $?)" >> "$LOG"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ── Global: Zulip Server ──
|
# ── Global: Zulip Server ──
|
||||||
|
|||||||
Reference in New Issue
Block a user