glances
glances copied to clipboard
docker glances container only shows root disk space
I'm using glances docker image, as documented in README.md:
docker pull nicolargo/glances
docker run -d --restart="always" -p 61208-61209:61208-61209 -e GLANCES_OPT="-w" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host docker.io/nicolargo/glances
This is what I read in the FILE SYS panel:
FILE SYS Used Total
_olv.conf (/dev/sda2) 3.53G 31.2G
_hostname (/dev/sda2) 3.53G 31.2G
_tc/hosts (/dev/sda2) 3.53G 31.2G
The 31.2G disk is my root mountpoint on the host running docker. I have other mountpoints on /dev/md0 that are missing. I can see md0 in the DISK IO panel.
Hi, I've been struggling for the same reason and just found out that mounting the whole host fs in a read-only directory of the guest provides a reasonable workaround. In this way the docker mount information includes the host information as well.
This is how I start the docker container:
docker run -d --restart="always" -p 61208-61209:61208-61209 -e GLANCES_OPT="-w -t 10" -v /var/run/docker.sock:/var/run/docker.sock:ro -v /:/rootfs:ro --cpus=0.25 --name glances --pid host docker.io/nicolargo/glances
So that I get both the host and guest partitions information:
FILE SYS Used Total
/rootfs (/dev/nvme0n1p1) 16.4G 98.3G
_otfs/srv (/dev/nvme1n1) 451G 984G
_overlay2 (/dev/nvme1n1) 451G 984G
_/althome (/dev/nvme2n1p1) 23.1G 98.3G
_olv.conf (/dev/nvme1n1) 451G 984G
_hostname (/dev/nvme1n1) 451G 984G
_tc/hosts (/dev/nvme1n1) 451G 984G
Same issue, I'd love to just list my various /dev/sd* and nothing else.
So for anyone else that gets here, i added in readonly mounts of the drives i was interested in. how i configured it with docker was, in my docker-compose for glances:
monitoring_glances:
image: nicolargo/glances:latest-full
pid: host
network_mode: host
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./glances/glances.conf:/etc/glances.conf
- /mnt/fourteena/Movies:/fourteena:ro
- /mnt/toshix/Movies:/toshix:ro
- /mnt/tendra/Movies:/tendra:ro
- /mnt/stuff:/stuff:ro
then in my glances.conf file under fs i have
[fs]
disable=False
# Define the list of file system to hide (comma-separated regexp)
#hide=/boot.*,/snap.*,/usr.*
hide=loop.*,/dev/loop.*,/etc.*
which gives me the following