Reference notify
Location¶
/home/justinwieb/forge/scripts/notify.sh
Usage¶
Priorities: info (file only), warning (file + ntfy + n8n), critical (all channels)
Channels¶
Configured via environment variables:
- FORGE_NTFY_TOPIC — ntfy.sh topic for push notifications
- FORGE_NTFY_SERVER — ntfy server (defaults to https://ntfy.sh)
- FORGE_N8N_WEBHOOK — n8n webhook URL for email relay
- FORGE_DISCORD_WEBHOOK — Discord webhook
- FORGE_SLACK_WEBHOOK — Slack webhook
Output¶
- Always writes to
forge/notifications/latest.md(overwritten each time) - Always appends to
forge/notifications/history.log
Message standard (2026-07-11)¶
All producers follow feedback_alerts_plain_english: plain-English what/impact/fix, machine detail last as Details:, dedup + all-clear, self-heal before paging where safe. Homebase check in forge_tmux_socket_sweep.sh now auto-restarts the anchor (hourly cooldown, state in data/homebase-sweep-state) and pages at most every 6h. Grafana telegram contact point sends only summary annotations (no raw values); rules carry noDataState: OK.
OnFailure wrapper for systemd units¶
scripts/forge_unit_failure_notify.sh <unit> is the OnFailure handler wired into [email protected]. Builds a self-triaging alert: pulls the journal tail for the failing unit, strips systemd lifecycle noise (Started/Stopped/Deactivated/etc), and prepends the last code=exited, status=N/REASON line. Falls back to a 7-day window grepped for error|fail|traceback|exception when the recent tail is clean. Means future "Forge unit failed" Telegram alerts contain the actual error, no journalctl round-trip needed. Added 2026-05-01 after the forge-context-prefetch SIGPIPE flap revealed the original "go run journalctl yourself" alert was useless.