Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
The quick answer
curl -o /dev/null -s -w '%{http_code} %{time_total}s\n' https://www.example.com/
docker run -d --name uptime-kuma --restart unless-stopped -p 127.0.0.1:3001:3001 -v uptime-kuma:/app/data louislam/uptime-kuma:2Then open the UI (through a reverse proxy with TLS), add a monitor HTTP(s) – Keyword, interval 60 s, and a notification.
Step by step
- Run the checker somewhere else — another cloud, another provider, or a small VPS. Never on the server you watch.
- Start Uptime Kuma (quick answer) — listen on localhost only and put Nginx with TLS in front; create the admin account at the first visit.
- Add good monitors:
- HTTP(s) – Keyword: URL
https://www.example.com/, keyword that only a working page has (for example the footer text). A 200 error page then still counts as down. - Certificate expiry notification: on, 14 days.
- TCP port for non-web services (SMTP 587, SSH 22 from the allowed IP).
- DNS monitor for the domain's A record.
- HTTP(s) – Keyword: URL
- Avoid false alarms — interval 60 s, retries 2 before "down", timeout 10–20 s.
- Send alerts where people act — Slack, Teams, Telegram or mail; one test notification per channel.
- Status page — a public page with the monitors you choose, so users see "we know" during an outage.
- With Prometheus: blackbox exporter — a module and a scrape job:
modules:
http_2xx:
prober: http
timeout: 10s
http:
fail_if_not_ssl: true
fail_if_body_not_matches_regexp: ["Example Ltd"] - job_name: blackbox
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets: ["https://www.example.com/"]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9115Alert on probe_success == 0 for 2 minutes, and on probe_ssl_earliest_cert_expiry - time() < 14 * 86400.
Check that it worked
Test the blackbox module by hand: curl -s 'http://127.0.0.1:9115/probe?target=https://www.example.com/&module=http_2xx' | grep probe_success shows probe_success 1. In Uptime Kuma the monitor is green; change the keyword to a wrong word and an alert arrives after the retries.
Common problems
| Problem | Cause | Fix |
|---|---|---|
| Alerts at night that nobody can confirm | One failed check counts as down. | Retries 2–3; check from two places. |
| Site down but monitor green | Only the status code is checked; an error page returns 200. | Keyword check / fail_if_body_not_matches_regexp. |
| Monitor down, site fine | WAF or rate limit blocks the checker. | Allow the checker's IP; slower interval. |
| No alert when the checker itself dies | Nobody watches the watcher. | A push/heartbeat monitor from a second system, or a paid outside check. |
| Certificate expired without warning | Expiry not monitored. | Certificate expiry alert at 14 days. |
| Uptime Kuma UI open to the internet | Port 3001 published on all addresses. | Bind to 127.0.0.1; reverse proxy with TLS and a strong admin password. |
Go further
- Command pages: curl, promtool, docker.
- Next how-tos: Check when a TLS certificate expires, Monitor TLS certificates with Prometheus, Send alerts to Slack or email, Test an HTTP endpoint with curl.
- Learn it: Observability tools at work — alerts, Observability services — Prometheus. Full guides: Uptime Kuma, Prometheus.
1Why must an uptime check run outside the server it watches?
If the server or its network is down, a check on the same server is down too and cannot send an alert.
2Why check for a keyword and not only the status code?
Many broken sites still return 200 with an error page; a keyword proves the real page loaded.