Skip to content

Notifications

Nota can tell you when something starts to need you and when it is over. Today that works through ntfy and webhooks.

Notification targets are part of the configuration. A target is ntfy or webhook; min_status says from where it wants to be told (warn or crit).

{
"notify": [
{"id": "phone", "type": "ntfy", "url": "https://ntfy.example.org/${NOTA_NTFY_TOPIC}", "token": "${NOTA_NTFY_TOKEN}", "min_status": "crit"},
{"id": "ops-hook", "type": "webhook", "url": "https://hooks.example.org/attention", "secret": "${NOTA_HOOK_SECRET}"}
]
}

${ENV_VAR} is expanded in URLs, secrets and tokens, so no secret has to stand in the file. The template is templates/conf.d/notify.json.example in the source.

What merely follows from another problem notifies nobody: the dead host does, the service on it does not.

On request Nota sends one sentence once a day: “All clear” or “2 things need you” — with the worst of them, how many more follow from it, and how many come due this week.

{
"digest": {"at": "07:30", "tz": "Europe/Berlin"}
}

It goes to every notification target, whatever its level. It is the one message that also says all is well.

Outbound webhooks carry two headers so the receiver can check where they come from:

  • X-Nota-Timestamp
  • X-Nota-Signature: sha256=hex(HMAC-SHA256(secret, "<timestamp>.<body>"))

A core that is down cannot notify. A second probe on another machine can watch the core and notify by itself through ntfy or a webhook when it cannot reach it.