Closed matthabjan closed 6 months ago
Hi @matthabjan
depending of what you want to do..
If you want to display the Glances curses interface from your docker-compose, please add the following option to the Glances Docker service:
stdin_open: true
tty: true
But if you only want to export stats to InfluxDB, just use the --quiet option.
In future version (Glances 4), the exception will be catched and Glances will start the export even if a terminal is not found.
Done on the develop branch.
I have just tested with your new dev release (4.0.0.0_beta01). I think it now works as expected. My docker file (without the --quiet flag):
version: "3.5"
services:
glances:
image: nicolargo/glances:dev
container_name: glances
pid: host
network_mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /var/lib/docker/glances/glances.conf:/etc/glances.conf
environment:
- GLANCES_OPT=--export influxdb2
- TZ=Europe/Berlin
restart: unless-stopped
The ouput of my glances docker log:
2023-10-29 13:25:06,774 -- INFO -- Start Glances 4.0.0_beta01
2023-10-29 13:25:06,775 -- INFO -- CPython 3.11.6 (/venv/bin/python3) and psutil 5.9.6 detected
2023-10-29 13:25:06,785 -- INFO -- Read configuration file '/etc/glances.conf'
2023-10-29 13:25:06,934 -- INFO -- Start GlancesStandalone mode
2023-10-29 13:25:07,854 -- ERROR -- containers (Podman) plugin - Can't connect to Podman (http://%2Frun%2Fuser%2F1000%2Fpodman%2Fpodman.sock/v4.7.0/libpod/_ping (HEAD operation failed))
2023-10-29 13:25:09,580 -- INFO -- Connected to InfluxDB server version v2.7.3 (ready for queries and writes)
2023-10-29 13:25:10,894 -- INFO -- Cannot init the curses library, quiet mode on and export.
That's fantastic. Thank you for the quick solution!
I am running glances (either dev, but I have also tried latest-full) in docker mode on a Raspberry Pi4 (Debian 11 as OS). I use it to export glances output into InfluxDB2, also running in the same docker stack.
Glances is running and keeps exporting data. However, when the containers are running I get the following "error" messages on every refresh:
I am using the following docker compose file:
My glances.conf file looks like this:
This error message can be muted by adding "--quiet" to GLANCES_OPT in the docker-compose file, but not sure if this is the expected behavior? Especially since I am seeing considerable spiking of the CPU load on every refresh.