Skip to content

16SystemsPython 3.10+ · requests · JSON-lines history

Health Checker

An uptime monitor in one file: polls a list of URLs on a schedule, records status codes and response times to a JSON-lines history, and calls out the moment something goes down.

Open source on GitHub

RakSAMP backendstationary player · 0.3.7RakNet UDPSA-MP serverstdio bridgecurses TUIchat · /commands · !locals · dialogs as modalsF2 players · F5 reconnect · F8 auto-OK · PgUp/PgDn scrollNO GTA PROCESS · NO RENDERER · PATCHED FROM ONE PINNED COMMITcapture pending
fig. 11 · polling endpoints and logging each check as one JSON line

Uptime, from scratch

Uptime monitoring is one of the three pillars of observability alongside metrics and logs. health-checker builds the polling-and-recording layer that production systems like the Prometheus Blackbox Exporter provide, using only the requests library.

You hand it URLs directly or via a file, choose an interval and timeout, and it keeps a running history of status codes and response times — and tells you the moment a target stops answering instead of waiting for a sweep to finish.

A history that reads like a stream

Each check appends one JSON line to the output file, so the history stays parseable, tailable and friendly to whatever wraps it. A command that fails gets a null status and latency plus the connection error, so a down service is visible in the data, not just in the terminal.

What makes it technically interesting

  • Polls any number of URLs from the CLI or a per-line URL file (lines starting with # are ignored) at a set --interval (default 30s)
  • Per-request --timeout keeps a hung endpoint from stalling the cycle; failed requests record null status/latency with the connection error
  • Every check is one JSON line: url, timestamp, status_code, response_time_ms, healthy, error — a history file any tool can tail
  • --count bounds the run (0 loops until Ctrl+C), and a failure is printed to the terminal immediately rather than buried in the log
GitHub Get in touch