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

hide_zero=True option not working in the WebUI #2987

Open
sector1209 opened this issue Oct 23, 2024 · 6 comments
Open

hide_zero=True option not working in the WebUI #2987

sector1209 opened this issue Oct 23, 2024 · 6 comments

Comments

@sector1209
Copy link

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

Setting hide_zero=True option under [network] or [diskio] in glances.conf does not, infact, hide network interfaces with 0 I/O.

To Reproduce

Add hide_zero=True option to network settings (as here: #2929 (comment))

[network]
...
hide_zero=True

Restart glances with glances webpage (glances -w --config /etc/glances.conf) with the [network] section

Expected behavior
I expected network interfaces with 0 Rx/s and 0 Tx/s to no longer be shown in the list after restarting glances.

Screenshots

**Environement **

Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04
noble

  • Glances & psutil versions
    Glances version: 4.2.0
    Glances API version: 4
    PsUtil version: 6.1.0
    Log file: /home/.../.local/share/glances/glances.log

  • How do you install Glances (Pypi package, script, package manager, source)
    pipx install glances

  • Glances test
    ===============================================================================
    Glances 4.2.0 (/home/.../.local/pipx/venvs/glances/lib/python3.12/site-packages/glances/init.py)
    Python 3.12.3 (/home/.../.local/pipx/venvs/glances/bin/python)
    PsUtil 6.1.0 (/home/.../.local/pipx/venvs/glances/lib/python3.12/site-packages/psutil/init.py)
    ===============================================================================
    alert [OK] 0.00004s
    [{'avg': 99.99961852990964,
    'begin': 1729646620,
    'count': 1,
    'desc': '',
    'end': -1,
    'global_msg': 'EVENTS history',
    'max': 99.99961852990964,
    'min': 99.99961852990964,
    'sort': 'memory_percent',
    'state': 'CRITICAL',
    'sum': 99.99961852990964,
    'top': [],
    'type': 'MEMSWAP'}]
    amps [OK] 0.00009s key=name
    [{'count': 0,
    'countmax': None,
    'countmin': 1.0,
    'key': 'name',
    'name': 'Dropbox',
    'refresh': 3.0,
    'regex': True,
    'result': None,
    'timer': 2.5515472888946533}, ...]
    cloud [NA]
    connections [NA]
    containers [OK] 0.17024s key=name
    [{'command': '/init',
    'cpu_percent': 2.8425181598062954,
    'created': '2024-10-22T11:57:35.882903807Z',
    'engine': 'docker',
    'id': '606a4fa19a481b239efcc2215462408367474724b19a770b97302f8817a60ecb',
    'image': ('lscr.io/linuxserver/deluge:latest',),
    'io_rx': None,
    'io_wx': None,
    'key': 'name',
    'memory_percent': None,
    'memory_usage': 3621842944,
    'name': 'deluge',
    'network_rx': None,
    'network_tx': None,
    'status': 'running',
    'uptime': '13 hours'}, ...]
    core [OK] 0.00028s
    {'log': 4, 'phys': 4}
    cpu [OK] 0.00025s
    {'cpucore': 4,
    'ctx_switches': 0,
    'ctx_switches_gauge': 1108347474,
    'guest': 0.0,
    'idle': 73.7,
    'interrupts': 0,
    'interrupts_gauge': 634165265,
    'iowait': 2.6,
    'irq': 0.0,
    'nice': 0.0,
    'soft_interrupts': 0,
    'soft_interrupts_gauge': 136957047,
    'steal': 0.1,
    'syscalls': 0,
    'syscalls_gauge': 0,
    'system': 6.4,
    'time_since_update': 2.510575294494629,
    'total': 23.7,
    'user': 16.2}
    diskio [OK] 0.00044s key=disk_name
    [{'disk_name': 'sda',
    'key': 'disk_name',
    'read_bytes': 0,
    'read_bytes_gauge': 47929383424,
    'read_count': 0,
    'read_count_gauge': 1885801,
    'time_since_update': 2.6581125259399414,
    'write_bytes': 0,
    'write_bytes_gauge': 14499464192,
    'write_count': 0,
    'write_count_gauge': 741041}, ...]
    folders [OK] 0.00002s
    []
    fs [OK] 0.00087s key=mnt_point
    [{'device_name': '/dev/mapper/ubuntu--vg-ubuntu--lv',
    'free': 142235725824,
    'fs_type': 'ext4',
    'key': 'mnt_point',
    'mnt_point': '/',
    'percent': 76.5,
    'size': 631676928000,
    'used': 463215857664}, ...]
    gpu [OK] 0.00002s
    []
    help [OK] 0.00000s
    None
    ip [OK] 0.00184s
    {'address': '',
    'gateway': '
    ',
    'mask': '',
    'mask_cidr': '
    ',
    'public_address': '',
    'public_info_human': '
    '}
    irq [NA]
    load [OK] 0.00003s
    {'cpucore': 4, 'min1': 1.33154296875, 'min15': 1.025390625, 'min5': 1.12158203125}
    mem [OK] 0.00011s
    {'active': 5609205760,
    'available': 5054054400,
    'buffers': 38420480,
    'cached': 5193334784,
    'free': 5054054400,
    'inactive': 5696495616,
    'percent': 59.7,
    'shared': 208162816,
    'total': 12542377984,
    'used': 7488323584}
    memswap [OK] 0.00015s
    {'free': 16384,
    'percent': 100.0,
    'sin': 3714834432,
    'sout': 7442563072,
    'time_since_update': 2.6623005867004395,
    'total': 4294963200,
    'used': 4294946816}
    network [OK] 0.00746s key=interface_name
    [{'alias': None,
    'bytes_all': 9975922,
    'bytes_all_gauge': 50584798304,
    'bytes_all_rate_per_sec': 4568578.0,
    'bytes_recv': 317563,
    'bytes_recv_gauge': 4516331375,
    'bytes_recv_rate_per_sec': 145431.0,
    'bytes_sent': 9658359,
    'bytes_sent_gauge': 46068466929,
    'bytes_sent_rate_per_sec': 4423146.0,
    'interface_name': 'ens18',
    'key': 'interface_name',
    'speed': 0,
    'time_since_update': 2.1835944652557373}, ...]
    now [OK] 0.00003s
    {'custom': '2024-10-23 02:23:42 BST', 'iso': '2024-10-23T02:23:42+01:00'}
    percpu [OK] 0.00019s key=cpu_number
    [{'cpu_number': 0,
    'dpc': None,
    'guest': 0.0,
    'guest_nice': 0.0,
    'idle': 72.5,
    'interrupt': None,
    'iowait': 3.1,
    'irq': 0.0,
    'key': 'cpu_number',
    'nice': 0.0,
    'softirq': 1.1,
    'steal': 0.0,
    'system': 8.4,
    'total': 27.5,
    'user': 14.9}, ...]
    ports [OK] 0.00001s key=indice
    [{'description': 'DefaultGateway',
    'host': '...',
    'indice': 'port_0',
    'key': 'indice',
    'port': 0,
    'refresh': 30,
    'rtt_warning': None,
    'status': 0.002867,
    'timeout': 3}, ...]
    processcount [OK] 0.09098s
    {'pid_max': 0, 'running': 1, 'sleeping': 428, 'thread': 2334, 'total': 502}
    processlist [OK] 0.00024s
    []
    psutilversion [OK] 0.00002s
    '6.1.0'
    quicklook [OK] 0.00027s
    {'cpu': 23.7,
    'cpu_hz': 0.0,
    'cpu_hz_current': 3000006000.0,
    'cpu_log_core': 4,
    'cpu_name': 'Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz',
    'cpu_phys_core': 4,
    'load': 25.6,
    'mem': 59.7,
    'percpu': [{...}, {...}, {...}, {...}],
    'swap': 100.0}
    raid [NA]
    sensors [OK] 0.00001s
    []
    smart [NA]
    system [OK] 0.00001s
    {'hostname': '...',
    'hr_name': 'Ubuntu 24.04 64bit / Linux 6.8.0-47-generic',
    'linux_distro': 'Ubuntu 24.04',
    'os_name': 'Linux',
    'os_version': '6.8.0-47-generic',
    'platform': '64bit'}
    uptime [OK] 0.00007s
    {'seconds': 47088}
    version [OK] 0.00001s
    '4.2.0'
    vms [OK] 0.00005s
    []
    wifi [OK] 0.00011s
    []
    ===============================================================================
    Total time to update all stats: 0.27634s
    ===============================================================================

Additional context
This is my first github issue so please let me know if I've made an unforgivable formatting error.

@nicolargo
Copy link
Owner

Hi @sector1209

your configuration key is ok but are you sure that Glances is ran with the "good" configuration file ?

Force the use of the modified configuration file with:

glances -C /your/path/to/glances.conf -w

Nicolas

@sector1209
Copy link
Author

Hi @sector1209

your configuration key is ok but are you sure that Glances is ran with the "good" configuration file ?

Force the use of the modified configuration file with:

glances -C /your/path/to/glances.conf -w

Nicolas

Tried it, still no luck

@sector1209
Copy link
Author

I've also since tried in an Alpine Linux VM (installed with pipx again) and got the same result

@nicolargo
Copy link
Owner

Correct @sector1209

also reproduced on my side in the WebUI.
TUI works perfectly.

Will have a look as soon as possible.

Thanks for the head up @sector1209 !

@nicolargo nicolargo changed the title hide_zero=True option not hiding zero hide_zero=True option not working in the WebUI Oct 26, 2024
@nicolargo nicolargo added this to the Glances 4.3.0 milestone Oct 26, 2024
@nicolargo
Copy link
Owner

Should be corrected in the develop branch.

Please can you test it ?

@sector1209
Copy link
Author

Should be corrected in the develop branch.

Please can you test it ?

Like I said this is a new one for me so please bear with me :)

I cloned the develop branch in an ubuntu docker container and ran make run after editing the config file in conf/glances.config to include hide_zero=True for both [network] and [diskio].

There's one network under [networks] that always has 0Rx/s / 0Tx/s, this always seems to show whether hide_zero is T or F
Under [diskio] was a similar story:

  1. hide_zero=False, #hide_threshold_bytes=0
    glances diskio -hzfalse-nominthresh

  2. hide_zero=True, #hide_threshold_bytes=0
    glances diskio -hztrue-nominthresh

  3. hide_zero=True, hide_threshold_bytes=0
    glances diskio -hztrue-yesminthresh

It seems to me like maybe hide_zero=True hides disks with 0 r/w initially, but fails to remove them if they do something then go back to zero again.

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