nicolargo / glances

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
http://nicolargo.github.io/glances/
Other
26.37k stars 1.5k forks source link

Document FS plugin behaviour in Docker environment #2897

Open pczhang opened 1 month ago

pczhang commented 1 month ago

Check the bug Before filling this bug report, please search if a similar issue already exists. In this case, just add a comment on this existing issue.

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Start Glances with the following options '...'
  2. Press the key '....'
  3. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environement (please complete the following information)

Additional context Add any other context about the problem here.

You can also pastebin:

pczhang commented 1 month ago

api/4/fs returns the following:

[{"device_name":"/dev/nvme0n1p5","fs_type":"ext4","mnt_point":"/etc/resolv.conf","size":3821550878720,"used":3090866900992,"free":536483299328,"percent":85.2,"key":"mnt_point"},{"device_name":"/dev/nvme0n1p5","fs_type":"ext4","mnt_point":"/etc/hostname","size":3821550878720,"used":3090866900992,"free":536483299328,"percent":85.2,"key":"mnt_point"},{"device_name":"/dev/nvme0n1p5","fs_type":"ext4","mnt_point":"/etc/hosts","size":3821550878720,"used":3090866900992,"free":536483299328,"percent":85.2,"key":"mnt_point"}]

RazCrimson commented 1 month ago

@pczhang Could you give us more info on you host system?

Also could i get the output of this?

python -c "import psutil; print(psutil.disk_partitions())"

Please replace python with python3 or whatever works for your system

pczhang commented 1 month ago

I installed it through docker. The host system is debian, which doesn't have python installed. I assume you want me to run the command inside the docker container.

sudo docker exec -ti bcc5a9f5161e /bin/sh /app # python -c "import psutil; print(psutil.disk_partitions())" [sdiskpart(device='/dev/nvme0n1p5', mountpoint='/etc/resolv.conf', fstype='ext4', opts='rw,relatime,errors=remount-ro'), sdiskpart(device='/dev/nvme0n1p5', mountpoint='/etc/hostname', fstype='ext4', opts='rw,relatime,errors=remount-ro'), sdiskpart(device='/dev/nvme0n1p5', mountpoint='/etc/hosts', fstype='ext4', opts='rw,relatime,errors=remount-ro')]

pczhang commented 1 month ago

same command run on the host system has no issue.

sdiskpart(device='/dev/nvme0n1p5', mountpoint='/', fstype='ext4', opts='rw,relatime,errors=remount-ro', maxfile=255, maxpath=4096)

RazCrimson commented 1 month ago

@pczhang

The current output that you have received is normal since docker automatically mounts those files in all containers. Getting the exact same result as the host is not possible due to docker's layer of virtualization.

If you are just interested in the disk usage, you can go ahead and use one of those entries. They all represent the same disk values. They are not hidden by default as you are able to get host disk info through them.

If you want to hide them (or just a portion of them) you can edit config file's fs plugin section (example)

I'll go ahead and close the issue if you don't face any other problems.

Please fill the issue template completely next time as it would make investigating such cases faster.