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

Bug In the Web-UI, Timestamps for "Warning or critical alerts" are showing incorrect month #3023

Closed
Hackashaq666 opened this issue Nov 18, 2024 · 3 comments
Labels
Milestone

Comments

@Hackashaq666
Copy link

Check the bug
There are no open issues for this bug

Describe the bug
I have noticed for at least the past few weeks that with the docker container nicolargo/glances:ubuntu-latest-full, I am seeing a bug in the Web-UI Timestamps for :"Warning or critical alerts". The month is showing as the previous month, for example, for November it shows 10 instead of 11.

To Reproduce
Steps to reproduce the behavior:

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

Expected behavior
The months in the "Warning or critical alerts" section should be correct :)
See below screenshot of Warnings in November, the days are correct, but the month is off by -1
Screenshots
{7B8675F3-919D-41B1-ADB1-E71E62E1D8FB}

Environement (please complete the following information)

  • Operating System: docker container nicolargo/glances:ubuntu-latest-full

  • Glances & psutil versions:
    Glances version: 4.2.1
    PsUtil version: 6.1.0

  • How do you install Glances (Pypi package, script, package manager, source): docker container nicolargo/glances:ubuntu-latest-full

  • Glances test: To be completed with result of: glances --issue: ===============================================================================
    Glances 4.2.1 (/app/glances/init.py)
    Python 3.12.3 (/venv/bin/python3)
    PsUtil 6.1.0 (/venv/lib/python3.12/site-packages/psutil/init.py)
    ===============================================================================
    alert [OK] 0.00004s
    []
    amps [OK] 0.00064s key=name
    [{'count': 0,
    'countmax': None,
    'countmin': 1.0,
    'key': 'name',
    'name': 'Dropbox',
    'refresh': 3.0,
    'regex': True,
    'result': None,
    'timer': 2.598470687866211}, ...]
    cloud [NA]
    connections [NA]
    containers [OK] 0.36387s key=name
    [{'command': '/init',
    'cpu_percent': 68.40888888888888,
    'created': '2024-11-16T17:56:35.987958375Z',
    'engine': 'docker',
    'id': 'REDACTED',
    'image': ('ghcr.io/blakeblackshear/frigate:0.15.0-beta1',),
    'io_rx': None,
    'io_wx': None,
    'key': 'name',
    'memory_percent': None,
    'memory_usage': 8142106624,
    'name': 'frigate',
    'network_rx': None,
    'network_tx': None,
    'status': 'running',
    'uptime': '19 hours'}, ...]
    core [OK] 0.00054s
    {'log': 8, 'phys': 4}
    cpu [OK] 0.00038s
    {'cpucore': 8,
    'ctx_switches': 0,
    'ctx_switches_gauge': 1684430939,
    'guest': 0.0,
    'idle': 76.9,
    'interrupts': 0,
    'interrupts_gauge': 452272994,
    'iowait': 0.1,
    'irq': 0.0,
    'nice': 0.0,
    'soft_interrupts': 0,
    'soft_interrupts_gauge': 523344588,
    'steal': 0.0,
    'syscalls': 0,
    'syscalls_gauge': 0,
    'system': 6.9,
    'time_since_update': 2.402170419692993,
    'total': 23.1,
    'user': 15.7}
    diskio [OK] 0.00118s key=disk_name
    [{'disk_name': 'sda',
    'key': 'disk_name',
    'read_bytes': 0,
    'read_bytes_gauge': 9459962880,
    'read_count': 0,
    'read_count_gauge': 256950,
    'time_since_update': 2.5933470726013184,
    'write_bytes': 0,
    'write_bytes_gauge': 9907377152,
    'write_count': 0,
    'write_count_gauge': 412784}, ...]
    folders [OK] 0.00003s
    []
    fs [OK] 0.00118s key=mnt_point
    [{'device_name': '/dev/sda5',
    'free': 217110851584,
    'fs_type': 'ext4',
    'key': 'mnt_point',
    'mnt_point': '/usr/lib/os-release',
    'percent': 14.9,
    'size': 268839260160,
    'used': 37997568000}, ...]
    gpu [OK] 0.00171s key=gpu_id
    [{'fan_speed': 24,
    'gpu_id': 'nvidia0',
    'key': 'gpu_id',
    'mem': 22.333780924479168,
    'name': 'NVIDIA GeForce GTX 1660 Ti',
    'proc': 2,
    'temperature': 38}, ...]
    help [OK] 0.00000s
    None
    ip [OK] 0.00063s
    {'address': '',
    'gateway': '
    ',
    'mask': '',
    'mask_cidr': '
    ',
    'public_address': '',
    'public_info_human': '
    '}
    irq [NA]
    load [OK] 0.00003s
    {'cpucore': 8, 'min1': 1.8916015625, 'min15': 1.69921875, 'min5': 1.7744140625}
    mem [OK] 0.00014s
    {'active': 9067991040,
    'available': 13947965440,
    'buffers': 230301696,
    'cached': 13448298496,
    'free': 13947965440,
    'inactive': 12043702272,
    'percent': 44.5,
    'shared': 1144909824,
    'total': 25142771712,
    'used': 11194806272}
    memswap [OK] 0.00023s
    {'free': 6178729984,
    'percent': 15.5,
    'sin': 1758367744,
    'sout': 4061995008,
    'time_since_update': 2.7897627353668213,
    'total': 7309094912,
    'used': 1130364928}
    network [OK] 0.00227s key=interface_name
    [{'alias': None,
    'bytes_all': 770552,
    'bytes_all_gauge': 43153202326,
    'bytes_all_rate_per_sec': 324279.0,
    'bytes_recv': 385276,
    'bytes_recv_gauge': 21576601163,
    'bytes_recv_rate_per_sec': 162139.0,
    'bytes_sent': 385276,
    'bytes_sent_gauge': 21576601163,
    'bytes_sent_rate_per_sec': 162139.0,
    'interface_name': 'lo',
    'key': 'interface_name',
    'speed': 0,
    'time_since_update': 2.3761956691741943}, ...]
    now [OK] 0.00003s
    {'custom': '2024-11-18 14:13:36 EST', 'iso': '2024-11-18T14:13:36-05:00'}
    percpu [OK] 0.00044s key=cpu_number
    [{'cpu_number': 0,
    'dpc': None,
    'guest': 0.0,
    'guest_nice': 0.0,
    'idle': 75.7,
    'interrupt': None,
    'iowait': 0.0,
    'irq': 0.0,
    'key': 'cpu_number',
    'nice': 0.0,
    'softirq': 0.4,
    'steal': 0.0,
    'system': 7.6,
    'total': 24.3,
    'user': 16.3}, ...]
    ports [OK] 0.00001s key=indice
    [{'description': 'DefaultGateway',
    'host': '192.168.1.1',
    'indice': 'port_0',
    'key': 'indice',
    'port': 0,
    'refresh': 30,
    'rtt_warning': None,
    'status': None,
    'timeout': 3}, ...]
    processcount [OK] 0.12327s
    {'pid_max': 0, 'running': 1, 'sleeping': 489, 'thread': 2763, 'total': 580}
    processlist [OK] 0.00027s
    []
    psutilversion [OK] 0.00002s
    '6.1.0'
    quicklook [OK] 0.00029s
    {'cpu': 23.1,
    'cpu_hz': 4000000000.0,
    'cpu_hz_current': 2865726375.0,
    'cpu_log_core': 8,
    'cpu_name': 'Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz',
    'cpu_phys_core': 4,
    'load': 21.2,
    'mem': 44.5,
    'percpu': [{...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}],
    'swap': 15.5}
    raid [NA]
    sensors [OK] 0.00000s key=label
    [{'critical': None,
    'key': 'label',
    'label': 'CPU',
    'type': <SensorType.CPU_TEMP: 'temperature_core'>,
    'unit': 'C',
    'value': 32,
    'warning': None}, ...]
    smart [NA]
    system [OK] 0.00000s
    {'hostname': 'Dell-XPS-8900',
    'hr_name': 'Debian GNU/Linux 12 64bit / Linux 6.9.7+bpo-amd64',
    'linux_distro': 'Debian GNU/Linux 12',
    'os_name': 'Linux',
    'os_version': '6.9.7+bpo-amd64',
    'platform': '64bit'}
    uptime [OK] 0.00009s
    {'seconds': 71517}
    version [OK] 0.00002s
    '4.2.1'
    vms [OK] 0.00005s
    []
    wifi [NA]
    ===============================================================================
    Total time to update all stats: 0.50188s
    ===============================================================================
    `

Additional context
Add any other context about the problem here.

You can also pastebin:

@nicolargo nicolargo added the bug label Nov 19, 2024
@nicolargo nicolargo added this to the Glances 4.3.0 milestone Nov 19, 2024
@nicolargo
Copy link
Owner

nicolargo commented Nov 19, 2024

Confirmed... It's why i hate JS...

const ts = Date.now()
now = new Date(ts)
console.log(now)
console.log(now.getMonth())
console.log(now.getMonth()+1) // Fucking JS

Result:

Tue Nov 19 2024 11:42:09 GMT+0100 (Central European Standard Time)
10
11 // Fucking JS

Should be patched:

@nicolargo
Copy link
Owner

Alarm is displayed in two lines:

image

nicolargo added a commit that referenced this issue Nov 20, 2024
@nicolargo
Copy link
Owner

Corrected and merged into the develop branch.

Will be released in future Glances version.

Thanks a lot for the complete issue report @Hackashaq666

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

No branches or pull requests

2 participants