Run the Glances Service¶
This tutorial walks through running the Glances microservice end to end: a
dockerized Glances server as the data source, a running ToloMEO Edge agent, and
tlm_glances bridging the two.
What you will do
Run the Glances service against a dockerized Glances server and a running
ToloMEO Edge agent, and watch CPU metrics arrive on events.data.
Prerequisites
- Python ≥ 3.11
uvinstalled- Docker
- A working instance of the ToloMEO Edge agent
- tlm-services installed:
uv sync
1. Start a Glances server¶
The service polls a running Glances instance over HTTP; it does not start
one for you. Run the official Glances image with its web/API server exposed
on port 61208:
Note
See the Glances documentation
for setting up and configuring the server itself. By default the service
reaches the API at http://localhost:61208; set hostname/port under
[plugins.glances_stats] to point at a server elsewhere.
2. Configure the service¶
Create tlm_glances.toml:
3. Run the service¶
4. Observe the output¶
In another terminal, subscribe to the agent's NATS subject to see the metrics arrive:
Every interval_s seconds you should see a SenML record with CPU fields
namespaced under glances_stats:cpu::
[{"bn": "urn:cpt:device:sn:test001:", "n": "glances_stats:cpu:total", "v": 12.4, "t": 1700000010.0}]