Environment:42 evey Hermes plugins ntfy
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Alerting, Observability |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
ntfy notification service for push alerts and alert polling, accessed via REST API with the evey-alerts topic.
Description
This environment provides access to an ntfy server instance for two purposes: push alerts (watchdog sends alerts when the agent goes silent during work hours) and alert polling (digest reads the last 24h of alerts from the evey-alerts topic). The ntfy API is accessed via plain HTTP POST to {NTFY_URL}/evey-alerts for sending and {NTFY_URL}/evey-alerts/json?poll=1&since=24h for polling. No authentication is required by default (ntfy supports optional auth tokens).
Usage
Use this environment for morning digest alert aggregation (daily_digest polls the last 24h of alerts) and watchdog silence alerts (watchdog sends alerts when the agent is silent for 2+ hours during work hours). If NTFY_URL is not set, alerts are silently skipped and the digest returns zero alerts.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Any (HTTP client) | Uses urllib.request from stdlib
|
| Hardware | Network access to ntfy server | Self-hosted or public ntfy.sh |
| Network | HTTP/HTTPS to ntfy server | 5-10 second timeout |
| Python | 3.10+ | urllib.request from stdlib
|
Dependencies
System Packages
- None — uses only Python stdlib
Python Packages
- Python stdlib only:
urllib.request,json,time
External Services
- ntfy server (self-hosted or
ntfy.sh) accessible via HTTP/HTTPS
Credentials
The following environment variable must be set:
NTFY_URL: Base URL of the ntfy server (e.g.,http://localhost:8090orhttps://ntfy.sh)
No authentication token is required by the plugin code; ntfy access control is configured server-side.
Quick Install
# Self-host ntfy (Docker):
docker run -d --name ntfy -p 8090:80 \
binwiederhier/ntfy serve
# Set the environment variable:
export NTFY_URL="http://localhost:8090"
# Test:
curl -d "Test alert" "$NTFY_URL/evey-alerts"
curl "$NTFY_URL/evey-alerts/json?poll=1&since=24h"
Code Evidence
Alert sending from evey-watchdog/__init__.py:87-104:
def _send_ntfy_alert(message):
"""Send alert to ntfy evey-alerts topic."""
if not NTFY_URL:
logger.info("Watchdog alert skipped: NTFY_URL not set")
return False
try:
data = message.encode()
req = urllib.request.Request(
f"{NTFY_URL}/evey-alerts",
data=data,
headers={"Title": "Hermes Watchdog Alert", "Priority": "high", "Tags": "warning"},
)
urllib.request.urlopen(req, timeout=5)
logger.info(f"Watchdog alert sent: {message[:60]}")
return True
except Exception as e:
logger.error(f"Watchdog alert failed: {e}")
return False
Alert polling from evey-digest/__init__.py:144-162:
def _get_alerts():
"""Check ntfy for alerts in last 24h."""
try:
url = f"{NTFY_URL}/evey-alerts/json?poll=1&since=24h"
req = urllib.request.Request(url)
with urllib.request.urlopen(req, timeout=HTTP_TIMEOUT) as resp:
raw = resp.read().decode()
# ntfy returns newline-delimited JSON
alerts = []
for line in raw.strip().split("\n"):
if line.strip():
msg = json.loads(line)
if msg.get("event") == "message":
alerts.append(msg.get("message", ""))
return {"count": len(alerts), "latest": alerts[:3]}
except Exception:
return {"count": 0, "latest": []}
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
Watchdog alert skipped: NTFY_URL not set |
NTFY_URL env var empty |
Set NTFY_URL in the agent's environment
|
Watchdog alert failed: URLError |
ntfy server unreachable | Check ntfy container is running and URL is correct |
| Digest shows 0 alerts | Polling failed or no alerts in 24h | Verify NTFY_URL is set and ntfy is accessible
|
Compatibility Notes
- Self-hosted vs public: Works with both self-hosted ntfy and the public
ntfy.shservice. - No auth: The plugin does not send auth tokens; ntfy access control must be configured server-side if needed.
- Topic name: Hardcoded to
evey-alerts— all plugins use the same topic. - Newline-delimited JSON: ntfy's
json?poll=1endpoint returns newline-delimited JSON, not a JSON array.