alert: BlackboxHttpStatusNotOk
expr: probe_http_status_code{job=~"blackbox.*"} > 0
and (probe_http_status_code{job=~"blackbox.*"} < 200 or probe_http_status_code{job=~"blackbox.*"} >= 300)
for: 5m
severity: warning
Alert message: {{ $labels.instance }} returns non-2xx
The final HTTP status of the response (after redirects) has been outside the 2xx range for 5 minutes. A zero status (no connection was made) is handled by the BlackboxProbeFailed alert.
5xx — an application or proxy error; 4xx — routes or authorisation changed, or the wrong URL is being probed; 3xx at the end of the chain — a redirect loop or a redirect to a page outside 2xx.
curl -sS -I -L -m 10 https://example.com
curl -sS -m 10 -o /dev/null -w '%{http_code} %{redirect_url}\n' https://example.com
Look at the web server and application logs for that time (journalctl -u nginx -n 100 --no-pager, docker logs --tail 100 <name>).
Fix the application/configuration error. If the service deliberately returns a non-2xx status (for example 401 for a protected page), list the allowed codes in valid_status_codes of the blackbox module.
If the address deliberately responds with non-2xx, it is better to fix the probe module than to silence the alert.
The full pack of 44 tested rules + Alertmanager → Telegram: 790 ₽ (≈ $9, card payment in rubles)
Open in Telegram · Free Monitoring Lite kit · All runbook alerts