EN /HU | Login

Monitor BBS

Grafana's dashboards on a telnet line: the network's servers, boards and callers as charts, stats, tables and logs, on a modern terminal or on a Commodore 64.

Only through TTG Gate BBS (teletypegames.org:2399), for the accounts with the grafana role. Its port (2336) is not published, and it is not on bbsweb.

How to get in

  1. Call the gate: telnet teletypegames.org 2399 (or its card on bbsweb).
  2. Log in on the Profile tab (YOU on a C64) with an account that has the grafana role.
  3. Monitor BBS shows at the end of Own Servers (on a modern terminal through the gate stands for its address, on a C64 GATE for its port). RETURN or its number dials it; the gate hands the call on signed in.

The gate's list is role-dependent for this board only: its entry in the gate's config/boards.yml has role: grafana, and the list is asked again on every screen, so the row appears as soon as the caller logs in, and a guest or an account without the role never sees it. Every other board is on the list for every caller. The board checks the role again: a call without it is told so and ends.

A sysop gives the role on the gate: Profile › SysOp › Accounts, G grant, grafana (or bin/account grant NAME grafana in the container).

What it shows

It knows nothing of our dashboards in particular: it reads whatever Grafana's token sees, through Grafana's HTTP API, and draws each panel by what it is and what its data looks like.

  • Dashboards, grouped by folder or by the word before the colon of the title (VPS: Host is under VPS); / finds by title, tag or group.
  • A dashboard: its rows, each panel with what it shows now in one line (a sparkline and the highest series, a stat's values in their colours, a table's size and first row, a log's newest line, the alerts firing), and the chosen panel drawn in full under the list on a tall enough terminal. It refreshes itself as often as the dashboard says (at least every 60 s, at most every 15 s).
  • A panel on the whole screen: lines over time on a grid of braille dots (half blocks on a C64) with the value axis, the times and the legend's figures; stats as tiles with sparklines; gauges, bar gauges, pies and bar charts as bars; tables with their column colours and value mappings; logs with their level colours; state timelines as coloured strips; the alert rules with their state; text panels as text. S shows one series at a time, I the description.
  • Variables (V): query, custom, interval, constant and text box variables, All, several values, chained variables, put into the queries as Grafana's front end does.
  • The time range (T, SHIFT-T): the dashboard's own, then 5m … 30d.

Grafana's data model is read, not our dashboards: field config defaults and overrides, units, decimals, thresholds, value mappings, colour modes, the reducers of stats and legends, Prometheus's and Loki's table format, and the common transformations. A panel type it does not know is drawn by the shape of its data.

It reads Grafana with a service account's token of the Viewer role: it can only see what a viewer sees, and changes nothing.

Configuration

Variable Default
MONITOR_BBS_GRAFANA_URL http://grafana:3000 Grafana on the interstack network
MONITOR_BBS_GRAFANA_TOKEN — a Grafana service account's token (Viewer), in /srv/stacks/ttg-bbs/.env on the server
TTG_GATE_BBS_LOCAL_HOST 127.0.0.1 (on the gate) where it dials the boards that are not published

The token is made in Grafana's UI (Administration › Service accounts): Grafana signs in through Gitea only and has no admin API for it. At most 6 questions go to Grafana at once over every caller; a dashboard's list and JSON are kept 60 s, a panel's data 15 s.

Under the hood

It runs as boards/monitor of bbs/ttg-bbs, in the shared ttg-bbs container, with at most 10 callers at once. private: true in boards.yml keeps it out of the badges (Globetrotter counts the other boards only) and its port out of compose.yaml; the gate, in the same container, dials 127.0.0.1:2336. A push to master deploys it from Woodpecker (ci-deploy ttg-bbs). Its log lines are in docker logs ttg-bbs, with "board":"monitor-bbs".

Both faces run the same pages (lib/ui/pages), drawn as lines of coloured runs: UI::Modern writes them as 256-colour ANSI, UI::Petscii on a 40×25 PETSCII canvas. lib/domain/grafana is Grafana's API and data model (client, time range, interpolator, units, colours, reducers, transformations, variables); it knows nothing of telnet.