Issues with Glances exporting to InfluxDB2 on Docker Compose #3508
Replies: 2 comments
|
It looks like Glances is ignoring those variables because the InfluxDB2 exporter expects a specific prefix to map them correctly. When the exporter can't find its config, it defaults to Since you're avoiding a The fix is to update your environment section like this: environment:
- GLANCES_OPT=-q --export influxdb2 --time 10
- GLANCES_INFLUXDB2_HOST=192.168.1.2
- GLANCES_INFLUXDB2_PORT=8060
- GLANCES_INFLUXDB2_PROTOCOL=http
- GLANCES_INFLUXDB2_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxx
- GLANCES_INFLUXDB2_ORG=xxxxxxxxxxxxxxxxxxxxxxx
- GLANCES_INFLUXDB2_BUCKET=dataserverGlancesI believe |
|
I'm having the exact same issue on Truenas Scale 25.10.3.1 when trying to use the influx2 exporter option. The App even doesn't come up. Am i missing something? Removing all influx related options glances just works fine. |
Uh oh!
There was an error while loading. Please reload this page.
Hi, I'm trying to connect Glances to InfluxDB2 to export data through docker compose and I first tried:
services: glances: container_name: glances environment: - GLANCES_OPT=-q --export influxdb2 --time 10 - INFLUXDB_HOST=192.168.1.2 - INFLUXDB_PORT=8060 - INFLUXDB_PROTOCOL=http - INFLUXDB_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxx - INFLUXDB_ORG=xxxxxxxxxxxxxxxxxxxxxxx - INFLUXDB_BUCKET=dataserverGlances image: nicolargo/glances:latest-full network_mode: bridge pid: host privileged: True restart: unless-stopped volumes: - /var/run/docker.sock:/var/run/docker.sock:roIn this case the compose logs has nothing, it seems the app is not running.
Then I tried the dev image:
services: glances: container_name: glances environment: - GLANCES_OPT=-q --export influxdb2 --time 10 - INFLUXDB_HOST=192.168.1.2 - INFLUXDB_PORT=8060 - INFLUXDB_PROTOCOL=http - INFLUXDB_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxx - INFLUXDB_ORG=xxxxxxxxxxxxxxxxxxxxxxx - INFLUXDB_BUCKET=dataserverGlances image: nicolargo/glances:dev network_mode: bridge pid: host privileged: True restart: unless-stopped volumes: - /var/run/docker.sock:/var/run/docker.sock:roIn this second try I have some activity in log but at the same time an error:
glances | 2026-04-01 04:47:50,539 -- INFO -- Start Glances 4.5.4_dev1 glances | 2026-04-01 04:47:50,539 -- INFO -- CPython 3.12.12 (/venv/bin/python3.12) and psutil 7.2.2 detected glances | 2026-04-01 04:47:50,544 -- INFO -- Read configuration file '/etc/glances/glances.conf' glances | 2026-04-01 04:47:50,760 -- INFO -- Start GlancesStandalone mode glances | 2026-04-01 04:47:51,156 -- INFO -- Followings processes stats will not be displayed: cpu_num glances | 2026-04-01 04:47:51,339 -- INFO -- Connected to InfluxDB server version None (HTTPConnection(host='localhost', port=8086): Failed to establish a new connection: [Errno 111] Connection refused) glances | 2026-04-01 04:47:51,675 -- INFO -- Quiet mode is ON, nothing will be displayedIt seems the app is almost working now, it is trying to export but it is ignoring the environment variables.
There is another "catch", I'm running the container on a TrueNAS server, so accessing the volume (and config file) may be a little complicated, so I'm avoiding map it on the volumes.
What am I doing wrong?
All reactions