Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document FS plugin behaviour in Docker environment #2897

Open
pczhang opened this issue Jul 26, 2024 · 6 comments
Open

Document FS plugin behaviour in Docker environment #2897

pczhang opened this issue Jul 26, 2024 · 6 comments

Comments

@pczhang
Copy link

pczhang commented Jul 26, 2024

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)

  • Operating System (lsb_release -a or OS name/version): To be completed with result of: lsb_release -a

  • Glances & psutil versions: Glances version: 4.1.2
    Glances API version: 4
    PsUtil version: 6.0.0
    Log file: /tmp/glances-root.log

  • How do you install Glances (Pypi package, script, package manager, source): docker

  • Glances test: fs [OK] 0.00077s key=mnt_point
    [{'device_name': '/dev/nvme0n1p5',
    'free': 536221671424,
    'fs_type': 'ext4',
    'key': 'mnt_point',
    'mnt_point': '/etc/resolv.conf',
    'percent': 85.2,
    'size': 3821550878720,
    'used': 3091128528896}, ...]

Additional context
Add any other context about the problem here.

You can also pastebin:

@pczhang
Copy link
Author

pczhang commented Jul 26, 2024

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
Copy link
Collaborator

@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

@RazCrimson RazCrimson changed the title wrong mnt_point Plugin FS: Invalid mnt_points are included Jul 30, 2024
@pczhang
Copy link
Author

pczhang commented Jul 30, 2024

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
Copy link
Author

pczhang commented Aug 1, 2024

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
Copy link
Collaborator

RazCrimson commented Aug 7, 2024

@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.

@RazCrimson RazCrimson changed the title Plugin FS: Invalid mnt_points are included Document FS plugin behaviour in Docker environment Aug 7, 2024
Copy link

github-actions bot commented Nov 6, 2024

This issue is stale because it has been open for 3 months with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants