Skip to content

lakestatus

lakestatus is a command on the server that prints one screen: are all services healthy, how loaded is the machine, and what is in the lake. It only reads; it changes nothing. It is written in Python with the standard library only, so it needs no installation beyond one file.

Section Content
SERVICES The systemd state of each service plus a real probe of its port, with a green, yellow or red dot. PostgREST is marked “old” and not counted
MACHINE CPU load, memory and disks as bars
DATA Counts of vendors, projects, folders and files; files by status with a bar; a 14-day upload sparkline; the last upload; views and live APIs; data-API and vendor-push calls in the last 24 hours
Terminal window
lakestatus # one picture, then exit
lakestatus --watch # redraw every 5 seconds until Ctrl-C
lakestatus --plain # ASCII only, no colour (logs, e-mail, old terminals)
lakestatus --json # the raw numbers instead of the picture
lakestatus --demo # made-up numbers: try the layout anywhere, no server needed

The exit code is 0 when every service is healthy and 1 when something needs attention, so it works in cron or a monitoring check:

Terminal window
lakestatus --plain || echo "lake needs attention" | mail -s "lake" ops@example.com
Command /usr/local/bin/lakestatus (step 17 copies lakestatus.py there)
Source infra/lakestatus/lakestatus.py, tests in test_lakestatus.py
Reads /opt/lake/cluster.env (role hosts and the registry password), the registry through psql, /proc, systemctl

The user running it must be able to read cluster.env (the admin user can; see step 19) and psql must be installed.

Terminal window
bash infra/deploy.sh # your machine
bash /opt/lake/scripts/install-all.sh 17 # the server
python -m unittest discover -s infra/lakestatus # tests (22), no server needed

The tests cover the drawing helpers (including the display width of emoji), settings parsing, probes against a local test server, the health rules, and rendering with an unreadable registry or an empty lake.

The systemd checks, /proc memory and uptime, psql as a subprocess, the Keycloak health port 9180 and the emoji rendering in every terminal were checked through the tunnel or in tests but not run on the server. Use --plain if your terminal draws the dots badly.