lakestatus
What it is for
Section titled “What it is for”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.
What the screen shows
Section titled “What the screen shows”| 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 |
Use it
Section titled “Use it”lakestatus # one picture, then exitlakestatus --watch # redraw every 5 seconds until Ctrl-Clakestatus --plain # ASCII only, no colour (logs, e-mail, old terminals)lakestatus --json # the raw numbers instead of the picturelakestatus --demo # made-up numbers: try the layout anywhere, no server neededThe exit code is 0 when every service is healthy and 1 when something needs attention, so it works in cron or a monitoring check:
lakestatus --plain || echo "lake needs attention" | mail -s "lake" ops@example.comWhere it lives
Section titled “Where it lives”| 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.
Install and test
Section titled “Install and test”bash infra/deploy.sh # your machinebash /opt/lake/scripts/install-all.sh 17 # the serverpython -m unittest discover -s infra/lakestatus # tests (22), no server neededThe 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.
Not yet verified on the server itself
Section titled “Not yet verified on the server itself”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.