Skip to content

The probe

The probe is for everything that has to be fetched rather than sent. It is part of the same program: nota serve runs it in the same process when a probe.json lies beside it, and nota probe runs it alone on a second machine.

One JSON file configures it. nota init writes a first one; templates/probe.json.example in the source shows everything.

{
"name": "probe-b",
"core": { "url": "https://nota.example.org", "token": "${NOTA_TOKEN}" },
"host": { "thing": "web-1" },
"checks": [],
"lists": []
}

The token is an ingest token of the core. ${ENV_VAR} is expanded, so it need not stand in the file.

"host": { "thing": "web-1" }

reports how full the disks are, how much memory is available and the load, with the metric names the rules that ship expect — and it promises to report again, so a machine that falls silent is noticed. The rules that nota init writes warn at a disk 80 % full and turn critical at 92 %.

It is the small way to watch a server. The Vector templates in the agent/ folder of the source do the same and more, for those who run Vector anyway.

http, tcp and tls. A certificate’s expiry becomes a due date, so it shows up under “coming due” before it becomes a problem.

"checks": [
{ "thing": "shop", "check": "http", "type": "http", "url": "https://shop.example.org/health", "interval_s": 60 },
{ "thing": "shop", "check": "tls", "type": "tls", "address": "shop.example.org:443", "interval_s": 3600, "warn_days": 21, "crit_days": 7 },
{ "thing": "db", "check": "port", "type": "tcp", "address": "db.example.org:5432" }
]

An http check accepts the status codes 200–399 unless you say otherwise, and can require a text in the body with contains.

"hetzner": [
{ "name": "production", "token": "${HCLOUD_TOKEN}", "interval_s": 300 }
]

reads a Hetzner Cloud project and reports its resources — servers, volumes, IPs — as things with their list prices. Give it a read-only token; the probe only reads.

Hetzner Cloud is one source among several, and the only cloud provider with a collector today. Nota is not affiliated with Hetzner Online GmbH.

Files a person keeps: lists, plans, and todo.txt, Taskwarrior and Beancount.

A probe on the same machine as the core cannot see that the machine is unreachable. On a second small machine, nota probe checks from outside and watches the first:

Terminal window
./nota probe probe.json

Its watchdog tells a person, through ntfy or a webhook, when the core itself has been unreachable for a while — the one case the core cannot report:

"watchdog": {
"after_s": 180,
"notify": { "type": "ntfy", "url": "https://ntfy.example.org/ops", "token": "${NTFY_TOKEN}" }
}

When two probes report the same check and only one sees a failure, the result is a warning, not an alarm.

Terminal window
./nota probe -check probe.json

validates the file.

Terminal window
./nota probe -once probe.json

runs everything once and prints what it would report.

It reads files and asks addresses. It starts no other programs, changes nothing where it looks, and searches no logs.