diff --git a/NEWS.rst b/NEWS.rst index 9b416b6b..d7caa6b8 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -2,11 +2,56 @@ Glances changelog ============================================================================== +=============== +Version 3.3.0 +=============== + + Version under development: see roadmap here https://github.com/nicolargo/glances/milestone/60 + =============== Version 3.2.7 =============== - Under development: see roadmap here https://github.com/nicolargo/glances/milestone/59 +Enhancements: + + * Config to disable all plugins by default (or enable an exclusive list) #2089 + * Keybind(s) for modifying nice level #2081 + * [WEBUI] Reorganize help screen #2037 + * Add a Json stdout option #2060 + * Improve error message when export error occures + * Improve error message when MQTT error occures + * Change the way core are displayed + * Remove unused key in the process list + * Refactor top menu of the curse interface + * Improve Irix display for the load plugin + +Bug corrected: + + * In the sensor plugin thresholds in the configuration file should overwrite system ones #2058 + * Drive names truncated in Web UI #2055 + * Correct issue with CPU label + +Documentation and CI: + + * Improve makefile help #2078 + * Add quote to the update command line (already ok for the installation). Related to #2073 + * Make Glances (almost) compliant with REUSE #2042 + * Update README for Debian package users + * Update documentation for Docker + * Update docs for new shortcut + * Disable Pyright on the Git actions pipeline + * Refactor comments + * Except datutil import error + * Another dep issue solved in the Alpine Docker + issue in the outdated method + +Contributors for this version: + + * Nicolargo + * Sylvain MOUQUET + * FastThenLeft + * Jiajie Chen + * dbrennand + * ewuerger =============== Version 3.2.6 diff --git a/README.rst b/README.rst index 6631013c..2d66d466 100644 --- a/README.rst +++ b/README.rst @@ -21,18 +21,21 @@ Glances - An eye on your system :target: https://github.com/nicolargo/glances/actions :alt: Linux tests (GitHub Actions) -.. image:: https://img.shields.io/appveyor/ci/nicolargo/glances/master.svg?maxAge=3600&label=Windows - :target: https://ci.appveyor.com/project/nicolargo/glances - :alt: Windows tests (Appveyor) +.. image:: https://img.shields.io/github/contributors/nicolargo/glances + :target: https://github.com/nicolargo/glances/issues?q=is%3Aissue+is%3Aopen+label%3A%22needs+contributor%22 + :alt: Contibutors .. image:: https://scrutinizer-ci.com/g/nicolargo/glances/badges/quality-score.png?b=develop :target: https://scrutinizer-ci.com/g/nicolargo/glances/?branch=develop + :alt: Code quality -.. image:: https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&link=https://github.com/sponsors/nicolargo +.. image:: https://img.shields.io/github/sponsors/nicolargo :target: https://github.com/sponsors/nicolargo + :alt: Sponsors .. image:: https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40nicolargo :target: https://twitter.com/nicolargo + :alt: @nicolargo Summary ======= @@ -132,8 +135,14 @@ For Windows, just install psutil from the binary installation file. *Note 2 (for the Wifi plugin)*: If you want to use the Wifi plugin, you need to install the *wireless-tools* package on your system. -You can also install the following libraries in order to use optional -features (like the Web interface, exports modules...): +By default, Glances is installed without the Web interface dependencies. +To install it, use the following command: + +.. code-block:: console + + pip install --user 'glances[web]' + +For a full installation (with all features: .. code-block:: console @@ -144,29 +153,14 @@ To upgrade Glances to the latest version: .. code-block:: console pip install --user --upgrade glances - pip install --user --upgrade 'glances[...]'' -If you need to install Glances in a specific user location, use: - -.. code-block:: console - - export PYTHONUSERBASE=~/mylocalpath - pip install --user glances - -If you are administrator and want to install Glances for all users: - -.. code-block:: console - - sudo pip install glances - -The current develop branch is also published to the test.pypi.org package index. -If you want to test the develop version, enter: +The current develop branch is published to the test.pypi.org package index. +If you want to test the develop version (could be instable), enter: .. code-block:: console pip install --user -i https://test.pypi.org/simple/ Glances - Glances Auto Install script: the easy way ----------------------------------------- @@ -205,7 +199,7 @@ Available versions on the Docker Hub repository: - *nicolargo/glances:latest-full* for a full Debian Glances image version with all dependencies - *nicolargo/glances:alpine-latest-full* for a full Alpine Glances image version with all dependencies -You can also specify a version by replacing latest by 3.2.6.3 (for example). +You can also specify a version by replacing latest by 3.2.6.4 (for example). Run last version of Glances container in *console mode*: @@ -246,6 +240,10 @@ able to install it using your favorite package manager. Be aware that when you use this method the operating system `package`_ for `Glances` may not be the latest version. +Note: The Debian package (and all other Debian-based distributions) do +not include anymore the JS statics files used by the Web interface +(see ``issue2021``). + FreeBSD ------- @@ -472,3 +470,4 @@ Glances is distributed under the LGPL version 3 license. See ``COPYING`` for mor .. _wiki: https://github.com/nicolargo/glances/wiki/How-to-contribute-to-Glances-%3F .. _package: https://repology.org/metapackage/glances/packages .. _sponsors: https://github.com/sponsors/nicolargo +.. _issue2021: https://github.com/nicolargo/glances/issues/2021#issuecomment-1197831157 \ No newline at end of file diff --git a/docker-compose/glances.conf b/docker-compose/glances.conf index ab4a30e7..efcb0e95 100644 --- a/docker-compose/glances.conf +++ b/docker-compose/glances.conf @@ -524,6 +524,7 @@ port=8125 # Configuration for the --export elasticsearch option # Data are available via the ES RESTful API. ex: URL//cpu # https://www.elastic.co +scheme=http host=localhost port=9200 index=glances @@ -547,7 +548,7 @@ queue=glances_queue # Configuration for the --export mqtt option host=localhost port=8883 -tls=true +tls=false user=guest password=guest topic=glances diff --git a/docker-files/alpine.Dockerfile b/docker-files/alpine.Dockerfile index 01052fd0..048c7fb4 100644 --- a/docker-files/alpine.Dockerfile +++ b/docker-files/alpine.Dockerfile @@ -54,6 +54,8 @@ RUN CASS_DRIVER_NO_CYTHON=1 pip3 install --no-cache-dir --user -r optional-requi FROM build as dev ARG PYTHON_VERSION +COPY --from=remoteInstall /root/.local/bin /usr/local/bin/ +COPY --from=remoteInstall /root/.local/lib/python${PYTHON_VERSION}/site-packages /usr/lib/python${PYTHON_VERSION}/site-packages/ COPY --from=additional-packages /root/.local/lib/python${PYTHON_VERSION}/site-packages /usr/lib/python${PYTHON_VERSION}/site-packages/ COPY . /glances COPY ./docker-compose/glances.conf /etc/glances.conf @@ -85,8 +87,8 @@ COPY --from=remoteInstall /root/.local/bin /usr/local/bin/ COPY --from=remoteInstall /root/.local/lib/python${PYTHON_VERSION}/site-packages /usr/lib/python${PYTHON_VERSION}/site-packages/ COPY ./docker-compose/glances.conf /etc/glances.conf -# EXPOSE PORT (XMLRPC / WebUI) -EXPOSE 61209 61208 +# EXPOSE PORT (XMLRPC) +EXPOSE 61209 # Define default command. CMD python3 -m glances -C /etc/glances.conf $GLANCES_OPT @@ -100,3 +102,9 @@ ARG PYTHON_VERSION COPY --from=additional-packages /root/.local/lib/python${PYTHON_VERSION}/site-packages /usr/lib/python${PYTHON_VERSION}/site-packages/ COPY ./docker-compose/glances.conf /etc/glances.conf + +# EXPOSE PORT (XMLRPC / WebUI) +EXPOSE 61209 61208 + +# Define default command. +CMD python3 -m glances -C /etc/glances.conf $GLANCES_OPT diff --git a/docker-files/debian.Dockerfile b/docker-files/debian.Dockerfile index ef8f963e..35163854 100644 --- a/docker-files/debian.Dockerfile +++ b/docker-files/debian.Dockerfile @@ -51,6 +51,8 @@ RUN CASS_DRIVER_NO_CYTHON=1 pip3 install --no-cache-dir --user -r optional-requi FROM build as dev ARG PYTHON_VERSION +COPY --from=remoteInstall /root/.local/bin /usr/local/bin/ +COPY --from=remoteInstall /root/.local/lib/python${PYTHON_VERSION}/site-packages /usr/local/lib/python${PYTHON_VERSION}/site-packages/ COPY --from=additional-packages /root/.local/lib/python${PYTHON_VERSION}/site-packages /usr/local/lib/python${PYTHON_VERSION}/site-packages/ COPY . /glances COPY ./docker-compose/glances.conf /etc/glances.conf @@ -84,8 +86,8 @@ COPY --from=remoteInstall /root/.local/bin /usr/local/bin/ COPY --from=remoteInstall /root/.local/lib/python${PYTHON_VERSION}/site-packages /usr/local/lib/python${PYTHON_VERSION}/site-packages/ COPY ./docker-compose/glances.conf /etc/glances.conf -# EXPOSE PORT (XMLRPC / WebUI) -EXPOSE 61209 61208 +# EXPOSE PORT (XMLRPC) +EXPOSE 61209 # Define default command. CMD python3 -m glances -C /etc/glances.conf $GLANCES_OPT @@ -99,3 +101,9 @@ ARG PYTHON_VERSION COPY --from=additional-packages /root/.local/lib/python${PYTHON_VERSION}/site-packages /usr/local/lib/python${PYTHON_VERSION}/site-packages/ COPY ./docker-compose/glances.conf /etc/glances.conf + +# EXPOSE PORT (XMLRPC / WebUI) +EXPOSE 61209 61208 + +# Define default command. +CMD python3 -m glances -C /etc/glances.conf $GLANCES_OPT diff --git a/docs/_static/glances-flame.svg b/docs/_static/glances-flame.svg index 7093e1ee..58209284 100644 --- a/docs/_static/glances-flame.svg +++ b/docs/_static/glances-flame.svg @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/docs/api.rst b/docs/api.rst index 5f2a32c7..734c8a25 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -74,7 +74,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.8538804054260254}, + "timer": 1.025280237197876}, {"count": 0, "countmax": 20.0, "countmin": None, @@ -83,7 +83,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.8537874221801758}] + "timer": 1.025184154510498}] Get a specific field:: @@ -101,7 +101,7 @@ Get a specific item when field matchs the given value:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.8538804054260254}]} + "timer": 1.025280237197876}]} GET core -------- @@ -131,19 +131,19 @@ Get plugin stats:: "ctx_switches": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 73.3, + "idle": 72.3, "interrupts": 0, "iowait": 0.0, "irq": 0.0, "nice": 0.0, "soft_interrupts": 0, - "softirq": 0.0, + "softirq": 0.2, "steal": 0.0, "syscalls": 0, - "system": 3.0, + "system": 2.2, "time_since_update": 1, - "total": 27.2, - "user": 23.7} + "total": 28.3, + "user": 25.5} Fields descriptions: @@ -165,7 +165,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/cpu/total - {"total": 27.2} + {"total": 28.3} GET diskio ---------- @@ -211,13 +211,13 @@ Get plugin stats:: # curl http://localhost:61208/api/3/fs [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 110062321664, + "free": 89835802624, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 52.4, - "size": 243396149248, - "used": 120946372608}] + "percent": 61.1, + "size": 243334156288, + "used": 141110898688}] Get a specific field:: @@ -228,13 +228,13 @@ Get a specific item when field matchs the given value:: # curl http://localhost:61208/api/3/fs/mnt_point// {"/": [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 110062321664, + "free": 89835802624, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 52.4, - "size": 243396149248, - "used": 120946372608}]} + "percent": 61.1, + "size": 243334156288, + "used": 141110898688}]} GET ip ------ @@ -242,16 +242,16 @@ GET ip Get plugin stats:: # curl http://localhost:61208/api/3/ip - {"address": "192.168.0.48", + {"address": "192.168.0.32", "gateway": "192.168.0.254", "mask": "255.255.255.0", "mask_cidr": 24, - "public_address": "82.66.169.82"} + "public_address": "91.166.228.228"} Get a specific field:: # curl http://localhost:61208/api/3/ip/address - {"address": "192.168.0.48"} + {"address": "192.168.0.32"} GET load -------- @@ -259,7 +259,7 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/3/load - {"cpucore": 4, "min1": 1.40771484375, "min15": 1.4169921875, "min5": 1.484375} + {"cpucore": 4, "min1": 0.89306640625, "min15": 0.623046875, "min5": 0.892578125} Fields descriptions: @@ -271,7 +271,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/load/min1 - {"min1": 1.40771484375} + {"min1": 0.89306640625} GET mem ------- @@ -279,16 +279,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/3/mem - {"active": 2461896704, - "available": 3079487488, - "buffers": 486854656, - "cached": 3247910912, - "free": 3079487488, - "inactive": 4266680320, - "percent": 60.7, - "shared": 539095040, - "total": 7837974528, - "used": 4758487040} + {"active": 1748742144, + "available": 3150409728, + "buffers": 661204992, + "cached": 3056963584, + "free": 3150409728, + "inactive": 4735377408, + "percent": 59.8, + "shared": 604377088, + "total": 7837962240, + "used": 4687552512} Fields descriptions: @@ -307,7 +307,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/mem/total - {"total": 7837974528} + {"total": 7837962240} GET memswap ----------- @@ -315,13 +315,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/3/memswap - {"free": 7600726016, - "percent": 6.0, - "sin": 48836608, - "sout": 519880704, + {"free": 7923298304, + "percent": 2.0, + "sin": 6930432, + "sout": 161832960, "time_since_update": 1, "total": 8082419712, - "used": 481693696} + "used": 159121408} Fields descriptions: @@ -345,29 +345,29 @@ Get plugin stats:: # curl http://localhost:61208/api/3/network [{"alias": None, - "cumulative_cx": 47984606, - "cumulative_rx": 23992303, - "cumulative_tx": 23992303, - "cx": 2492, + "cumulative_cx": 63263372, + "cumulative_rx": 31631686, + "cumulative_tx": 31631686, + "cx": 2240, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 1246, + "rx": 1120, "speed": 0, "time_since_update": 1, - "tx": 1246}, + "tx": 1120}, {"alias": None, - "cumulative_cx": 1734453000, - "cumulative_rx": 1610954683, - "cumulative_tx": 123498317, - "cx": 31305, + "cumulative_cx": 6121583802, + "cumulative_rx": 5987015590, + "cumulative_tx": 134568212, + "cx": 11733, "interface_name": "wlp2s0", "is_up": True, "key": "interface_name", - "rx": 25086, + "rx": 8809, "speed": 0, "time_since_update": 1, - "tx": 6219}] + "tx": 2924}] Fields descriptions: @@ -387,26 +387,26 @@ Get a specific field:: {"interface_name": ["lo", "wlp2s0", "br-119e6ee04e05", - "docker0", "br-87386b77b676", "br_grafana", + "docker0", "mpqemubr0"]} Get a specific item when field matchs the given value:: # curl http://localhost:61208/api/3/network/interface_name/lo {"lo": [{"alias": None, - "cumulative_cx": 47984606, - "cumulative_rx": 23992303, - "cumulative_tx": 23992303, - "cx": 2492, + "cumulative_cx": 63263372, + "cumulative_rx": 31631686, + "cumulative_tx": 31631686, + "cx": 2240, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 1246, + "rx": 1120, "speed": 0, "time_since_update": 1, - "tx": 1246}]} + "tx": 1120}]} GET now ------- @@ -414,7 +414,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/3/now - "2022-07-24 10:33:51 CEST" + "2022-07-28 17:47:36 CEST" GET percpu ---------- @@ -425,29 +425,29 @@ Get plugin stats:: [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 90.0, + "idle": 90.1, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, - "softirq": 1.0, + "softirq": 0.0, "steal": 0.0, - "system": 0.0, - "total": 10.0, - "user": 4.0}, + "system": 2.7, + "total": 9.9, + "user": 7.2}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 90.0, + "idle": 95.5, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, - "softirq": 1.0, + "softirq": 0.0, "steal": 0.0, - "system": 3.0, - "total": 10.0, - "user": 3.0}] + "system": 0.9, + "total": 4.5, + "user": 3.6}] Get a specific field:: @@ -466,7 +466,7 @@ Get plugin stats:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.003645, + "status": 0.003491, "timeout": 3}] Get a specific field:: @@ -483,7 +483,7 @@ Get a specific item when field matchs the given value:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.003645, + "status": 0.003491, "timeout": 3}]} GET processcount @@ -492,12 +492,12 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/3/processcount - {"pid_max": 0, "running": 1, "sleeping": 233, "thread": 1256, "total": 299} + {"pid_max": 0, "running": 1, "sleeping": 230, "thread": 1172, "total": 296} Get a specific field:: # curl http://localhost:61208/api/3/processcount/total - {"total": 299} + {"total": 296} GET processlist --------------- @@ -505,50 +505,50 @@ GET processlist Get plugin stats:: # curl http://localhost:61208/api/3/processlist - [{"cmdline": ["/snap/firefox/1443/usr/lib/firefox/firefox"], + [{"cmdline": ["/snap/firefox/1551/usr/lib/firefox/firefox"], "cpu_percent": 0.0, - "cpu_times": pcputimes(user=2687.47, system=1037.45, children_user=2125.3, children_system=344.64, iowait=0.0), + "cpu_times": pcputimes(user=1010.67, system=364.61, children_user=355.1, children_system=90.0, iowait=0.0), "gids": pgids(real=1000, effective=1000, saved=1000), - "io_counters": [982852608, 2811539456, 0, 0, 0], + "io_counters": [800161792, 7131361280, 0, 0, 0], "key": "pid", - "memory_info": pmem(rss=521953280, vms=13237006336, shared=174477312, text=741376, lib=0, data=1154760704, dirty=0), - "memory_percent": 6.659287780732119, + "memory_info": pmem(rss=644706304, vms=13331173376, shared=158920704, text=630784, lib=0, data=1310646272, dirty=0), + "memory_percent": 8.225432634898736, "name": "firefox", "nice": 0, - "num_threads": 164, - "pid": 4236, + "num_threads": 146, + "pid": 3866, "status": "S", "time_since_update": 1, "username": "nicolargo"}, - {"cmdline": ["/snap/firefox/1443/usr/lib/firefox/firefox", + {"cmdline": ["/snap/firefox/1551/usr/lib/firefox/firefox", "-contentproc", "-childID", - "3", + "1", "-isForBrowser", "-prefsLen", - "13098", + "35771", "-prefMapSize", - "255747", + "226281", "-jsInitLen", - "277128", + "277276", "-parentBuildID", - "20220609070438", + "20220707183149", "-appDir", - "/snap/firefox/1443/usr/lib/firefox/browser", - "4236", + "/snap/firefox/1551/usr/lib/firefox/browser", + "3866", "true", "tab"], "cpu_percent": 0.0, - "cpu_times": pcputimes(user=421.23, system=83.44, children_user=0.0, children_system=0.0, iowait=0.0), + "cpu_times": pcputimes(user=138.84, system=31.43, children_user=0.0, children_system=0.0, iowait=0.0), "gids": pgids(real=1000, effective=1000, saved=1000), - "io_counters": [11130880, 0, 0, 0, 0], + "io_counters": [8065024, 0, 0, 0, 0], "key": "pid", - "memory_info": pmem(rss=459653120, vms=3240546304, shared=89395200, text=741376, lib=0, data=649822208, dirty=0), - "memory_percent": 5.864437532400207, + "memory_info": pmem(rss=433627136, vms=3162419200, shared=83726336, text=630784, lib=0, data=573640704, dirty=0), + "memory_percent": 5.532396338770829, "name": "WebExtensions", "nice": 0, "num_threads": 20, - "pid": 5262, + "pid": 4232, "status": "S", "time_since_update": 1, "username": "nicolargo"}] @@ -556,175 +556,173 @@ Get plugin stats:: Get a specific field:: # curl http://localhost:61208/api/3/processlist/pid - {"pid": [4236, - 5262, - 9730, - 9861, - 4450, - 9695, - 3561, - 42242, - 52578, - 75296, - 50530, - 73809, - 76244, - 4417, - 9729, - 9628, - 5492, - 4088, - 76136, - 76002, - 76285, - 9663, - 1980, - 2040, - 76402, - 9796, - 3457, - 2243, - 9761, - 3870, - 9955, - 41978, - 3680, - 73036, - 4095, - 5779, - 1284, - 41980, - 3962, - 1450, - 4391, - 3651, - 3370, - 1433, - 9682, - 3768, - 3844, - 3690, - 3759, - 3766, - 4465, - 347, - 5870, - 58878, - 4126, - 50975, - 1246, - 1264, - 3782, - 58882, - 3765, - 3607, - 1784, - 3643, - 9632, - 3538, - 3033, - 1, - 1293, - 58865, - 51015, - 9633, - 1093, - 1449, - 3761, + {"pid": [3866, + 4232, + 4291, + 12527, + 3558, + 3173, + 13334, + 12643, + 12475, + 4255, + 12512, + 12406, + 12443, + 3996, + 6101, + 52860, + 52993, + 53135, + 53134, + 53215, + 1952, + 2029, + 12583, + 4007, + 12544, + 3084, + 53348, + 5463, + 2234, + 12723, + 3288, 3456, - 3938, - 3767, - 3880, - 1271, - 3359, - 1295, - 1400, - 3774, - 51035, - 3616, - 3586, - 3234, - 3769, - 58880, - 3661, - 36696, - 1290, - 1454, - 3779, - 1754, - 36676, - 3846, - 3028, - 3706, - 3592, - 1289, - 1228, - 3386, - 3382, - 58881, - 3950, - 3559, - 3923, - 3763, - 1272, - 3775, - 3753, - 393, - 3837, - 3853, - 1253, - 1101, - 3843, - 54916, - 3603, - 1245, - 1286, - 3770, - 3658, - 3623, - 3597, - 3771, - 3379, - 3758, - 3451, - 3391, - 1282, - 9827, - 1281, - 1241, - 3526, - 5562, - 3367, - 9854, - 3640, + 1377, + 8852, + 12462, + 1273, + 343, + 1374, + 1446, + 4105, + 3256, + 3638, + 2977, + 3319, + 4311, + 3213, + 2160, + 1236, + 3370, + 1251, + 3247, + 3369, + 3523, + 5576, + 2195, + 3364, + 1772, + 12412, + 9801, + 3378, + 1284, 3368, - 3568, - 1237, - 1259, - 42042, - 3360, - 1086, - 1244, - 1596, - 76386, - 1139, - 1300, - 73241, - 9648, - 1135, - 1996, - 3959, - 1240, - 4203, - 3433, + 2865, + 1955, + 1432, + 12413, + 3150, + 9884, + 4033, + 1077, + 3605, + 1, + 3383, + 3365, + 3064, + 1257, + 3522, + 3372, + 6775, + 3184, + 1369, + 2768, + 3222, + 9895, + 2966, + 2868, + 1429, + 3375, + 1285, + 2190, + 1282, + 3422, + 14980, + 3272, + 15002, + 1742, + 1280, + 3377, + 1218, + 6122, + 3309, + 2996, + 2191, + 3194, + 1235, + 389, + 3174, + 12681, + 3366, + 3376, + 3570, + 1258, + 3529, + 2991, + 3414, + 3519, + 3615, + 3348, + 1243, + 3207, + 52896, + 2988, + 1276, + 3265, + 1265, + 3373, + 3374, + 3227, + 3363, + 3199, + 3005, + 3061, + 1079, + 1271, + 2974, + 2975, + 3245, + 1231, + 3139, + 3181, + 1227, + 6177, + 2967, + 1588, + 1245, + 1076, + 1234, + 3804, + 1290, + 3632, + 1089, + 53333, + 1088, + 1974, + 12429, 1229, - 2006, - 76401, - 3757, - 1307, - 2049, - 2038, - 2036, + 4224, + 3047, + 1219, + 53347, + 1976, + 3360, + 1294, + 2021, + 1978, + 1962, + 12415, 2, 3, 4, @@ -776,16 +774,16 @@ Get a specific field:: 105, 107, 110, - 111, - 116, + 112, 117, 118, - 128, - 131, - 137, - 160, + 119, + 129, + 132, + 138, 187, - 190, + 188, + 195, 196, 197, 198, @@ -794,89 +792,88 @@ Get a specific field:: 201, 202, 203, + 209, 210, - 211, - 216, + 215, 217, 234, - 287, - 288, - 362, + 282, + 283, 363, - 385, - 463, - 499, - 565, - 567, - 568, + 364, + 390, + 498, + 534, 569, - 788, - 789, - 790, - 791, - 792, - 793, - 794, - 795, - 796, - 797, - 798, - 799, - 2051, - 2057, - 2071, - 2150, - 2151, - 2152, - 2153, - 2154, - 2155, - 2156, - 2157, - 3617, - 9635, - 40332, - 43168, - 50836, - 68803, - 69770, - 69963, - 72076, - 72077, - 72167, - 72180, - 74547, - 74770, - 74850, - 75055, - 75272, - 75639, - 75640, - 75991, - 76173, - 76385]} + 576, + 577, + 578, + 800, + 801, + 802, + 803, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 815, + 2006, + 2048, + 2072, + 2127, + 2128, + 2131, + 2132, + 2133, + 2134, + 2136, + 2138, + 3244, + 9667, + 12922, + 19063, + 49473, + 49810, + 50045, + 50203, + 50501, + 50684, + 51522, + 51523, + 51717, + 51914, + 52048, + 52159, + 52947, + 52970, + 53065, + 53329, + 53330]} Get a specific item when field matchs the given value:: - # curl http://localhost:61208/api/3/processlist/pid/4236 - {"4236": [{"cmdline": ["/snap/firefox/1443/usr/lib/firefox/firefox"], + # curl http://localhost:61208/api/3/processlist/pid/3866 + {"3866": [{"cmdline": ["/snap/firefox/1551/usr/lib/firefox/firefox"], "cpu_percent": 0.0, - "cpu_times": [2687.47, 1037.45, 2125.3, 344.64, 0.0], + "cpu_times": [1010.67, 364.61, 355.1, 90.0, 0.0], "gids": [1000, 1000, 1000], - "io_counters": [982852608, 2811539456, 0, 0, 0], + "io_counters": [800161792, 7131361280, 0, 0, 0], "key": "pid", - "memory_info": [521953280, - 13237006336, - 174477312, - 741376, + "memory_info": [644706304, + 13331173376, + 158920704, + 630784, 0, - 1154760704, + 1310646272, 0], - "memory_percent": 6.659287780732119, + "memory_percent": 8.225432634898736, "name": "firefox", "nice": 0, - "num_threads": 164, - "pid": 4236, + "num_threads": 146, + "pid": 3866, "status": "S", "time_since_update": 1, "username": "nicolargo"}]} @@ -895,69 +892,69 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/3/quicklook - {"cpu": 27.2, + {"cpu": 28.3, "cpu_hz": 3000000000.0, - "cpu_hz_current": 1605066500.0, + "cpu_hz_current": 1605956000.0000002, "cpu_name": "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz", - "mem": 60.7, + "mem": 59.8, "percpu": [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 90.0, + "idle": 90.1, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, - "softirq": 1.0, + "softirq": 0.0, "steal": 0.0, - "system": 0.0, - "total": 10.0, - "user": 4.0}, + "system": 2.7, + "total": 9.9, + "user": 7.2}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 90.0, + "idle": 95.5, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, - "softirq": 1.0, + "softirq": 0.0, "steal": 0.0, - "system": 3.0, - "total": 10.0, - "user": 3.0}, + "system": 0.9, + "total": 4.5, + "user": 3.6}, {"cpu_number": 2, "guest": 0.0, "guest_nice": 0.0, - "idle": 31.0, + "idle": 23.2, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 1.0, - "total": 69.0, - "user": 63.0}, + "system": 3.6, + "total": 76.8, + "user": 73.2}, {"cpu_number": 3, "guest": 0.0, "guest_nice": 0.0, - "idle": 65.0, + "idle": 77.5, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 3.0, - "total": 35.0, - "user": 26.0}], - "swap": 6.0} + "system": 0.9, + "total": 22.5, + "user": 21.6}], + "swap": 2.0} Get a specific field:: # curl http://localhost:61208/api/3/quicklook/cpu - {"cpu": 27.2} + {"cpu": 28.3} GET sensors ----------- @@ -1014,7 +1011,7 @@ Get plugin stats:: "hr_name": "Ubuntu 22.04 64bit", "linux_distro": "Ubuntu 22.04", "os_name": "Linux", - "os_version": "5.15.0-40-generic", + "os_version": "5.15.0-41-generic", "platform": "64bit"} Get a specific field:: @@ -1028,7 +1025,7 @@ GET uptime Get plugin stats:: # curl http://localhost:61208/api/3/uptime - {"seconds": 692162} + {"seconds": 81023} GET all stats ------------- @@ -1044,33 +1041,33 @@ GET stats history History of a plugin:: # curl http://localhost:61208/api/3/cpu/history - {"system": [["2022-07-24T10:33:52.103080", 3.0], - ["2022-07-24T10:33:53.131720", 3.0], - ["2022-07-24T10:33:54.206957", 0.6]], - "user": [["2022-07-24T10:33:52.103074", 23.7], - ["2022-07-24T10:33:53.131716", 23.7], - ["2022-07-24T10:33:54.206953", 1.8]]} + {"system": [["2022-07-28T17:47:37.780462", 2.2], + ["2022-07-28T17:47:38.809590", 2.2], + ["2022-07-28T17:47:39.883006", 0.4]], + "user": [["2022-07-28T17:47:37.780457", 25.5], + ["2022-07-28T17:47:38.809586", 25.5], + ["2022-07-28T17:47:39.883002", 1.7]]} Limit history to last 2 values:: # curl http://localhost:61208/api/3/cpu/history/2 - {"system": [["2022-07-24T10:33:53.131720", 3.0], - ["2022-07-24T10:33:54.206957", 0.6]], - "user": [["2022-07-24T10:33:53.131716", 23.7], - ["2022-07-24T10:33:54.206953", 1.8]]} + {"system": [["2022-07-28T17:47:38.809590", 2.2], + ["2022-07-28T17:47:39.883006", 0.4]], + "user": [["2022-07-28T17:47:38.809586", 25.5], + ["2022-07-28T17:47:39.883002", 1.7]]} History for a specific field:: # curl http://localhost:61208/api/3/cpu/system/history - {"system": [["2022-07-24T10:33:52.103080", 3.0], - ["2022-07-24T10:33:53.131720", 3.0], - ["2022-07-24T10:33:54.206957", 0.6]]} + {"system": [["2022-07-28T17:47:37.780462", 2.2], + ["2022-07-28T17:47:38.809590", 2.2], + ["2022-07-28T17:47:39.883006", 0.4]]} Limit history for a specific field to last 2 values:: # curl http://localhost:61208/api/3/cpu/system/history - {"system": [["2022-07-24T10:33:53.131720", 3.0], - ["2022-07-24T10:33:54.206957", 0.6]]} + {"system": [["2022-07-28T17:47:38.809590", 2.2], + ["2022-07-28T17:47:39.883006", 0.4]]} GET limits (used for thresholds) -------------------------------- diff --git a/docs/man/glances.1 b/docs/man/glances.1 index 29cdff72..053fc902 100644 --- a/docs/man/glances.1 +++ b/docs/man/glances.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "GLANCES" "1" "Jul 24, 2022" "3.2.7_beta01" "Glances" +.TH "GLANCES" "1" "Jul 28, 2022" "3.2.7" "Glances" .SH NAME glances \- An eye on your system .SH SYNOPSIS diff --git a/glances/__init__.py b/glances/__init__.py index da847c17..d6432214 100644 --- a/glances/__init__.py +++ b/glances/__init__.py @@ -19,7 +19,7 @@ import sys # Global name # Version should start and end with a numerical char # See https://packaging.python.org/specifications/core-metadata/#version -__version__ = '3.2.7_beta01' +__version__ = '3.3.0_beta1' __author__ = 'Nicolas Hennion ' __license__ = 'LGPLv3' diff --git a/glances/compat.py b/glances/compat.py index 0a4d6477..f0c5c519 100644 --- a/glances/compat.py +++ b/glances/compat.py @@ -242,17 +242,17 @@ def pretty_date(time=False): if second_diff < 10: return "just now" if second_diff < 60: - return str(second_diff) + " seconds" + return str(second_diff) + " secs" if second_diff < 120: - return "a minute" + return "a min" if second_diff < 3600: - return str(second_diff // 60) + " minutes" + return str(second_diff // 60) + " mins" if second_diff < 7200: return "an hour" if second_diff < 86400: return str(second_diff // 3600) + " hours" if day_diff == 1: - return "Yesterday" + return "yesterday" if day_diff < 7: return str(day_diff) + " days" if day_diff < 31: diff --git a/glances/outputs/static/package-lock.json b/glances/outputs/static/package-lock.json index 6cc92444..76c82bde 100644 --- a/glances/outputs/static/package-lock.json +++ b/glances/outputs/static/package-lock.json @@ -86,6 +86,55 @@ "integrity": "sha512-6nFkfkmSeV/rqSaS4oWHgmpnYw194f6hmWF5is6b0J1naJZoiD0NTc9AiUwPHvWsowkjuHErCZT1wa0jg+BLIA==", "dev": true }, + "@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, + "@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", + "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -570,8 +619,7 @@ "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" }, "camel-case": { "version": "4.1.2", @@ -3121,8 +3169,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "source-map-js": { "version": "0.6.2", @@ -3278,13 +3325,14 @@ } }, "terser": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz", - "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==", + "version": "5.14.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz", + "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==", "dev": true, "requires": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", "source-map-support": "~0.5.20" }, "dependencies": { @@ -3293,12 +3341,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true - }, - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true } } }, @@ -3318,8 +3360,7 @@ "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, "schema-utils": { "version": "3.1.1", @@ -3345,30 +3386,10 @@ "version": "0.5.20", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", - "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } - }, - "terser": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz", - "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==", - "dev": true, - "requires": { - "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.20" - }, - "dependencies": { - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true - } - } } } }, diff --git a/glances/plugins/cpu/model.py b/glances/plugins/cpu/model.py index 33fb1189..f40fbdb7 100644 --- a/glances/plugins/cpu/model.py +++ b/glances/plugins/cpu/model.py @@ -80,10 +80,16 @@ another while ensuring that the tasks do not conflict.', 'unit': 'number', 'rate': True, 'min_symbol': 'K', - 'short_name': 'sw_int', + 'short_name': 'sys_call', + }, + 'cpucore': { + 'description': 'Total number of CPU core.', + 'unit': 'number' + }, + 'time_since_update': { + 'description': 'Number of seconds since last update.', + 'unit': 'seconds' }, - 'cpucore': {'description': 'Total number of CPU core.', 'unit': 'number'}, - 'time_since_update': {'description': 'Number of seconds since last update.', 'unit': 'seconds'}, } # SNMP OID diff --git a/glances/plugins/glances_docker/model.py b/glances/plugins/glances_docker/model.py index 5165ba51..a4bb7c09 100644 --- a/glances/plugins/glances_docker/model.py +++ b/glances/plugins/glances_docker/model.py @@ -26,7 +26,7 @@ from glances.timer import getTimeSinceLastUpdate # https://github.com/docker/docker-py try: import docker - from dateutil import parser + from dateutil import parser, tz except Exception as e: import_error_tag = True # Display debug message if import KeyError @@ -281,7 +281,8 @@ class PluginModel(GlancesPluginModel): container_stats['network_tx'] = container_stats['network'].get('tx', None) # Uptime container_stats['Uptime'] = pretty_date( - parser.parse(container.attrs['State']['StartedAt']).replace(tzinfo=None) + # parser.parse(container.attrs['State']['StartedAt']).replace(tzinfo=None) + parser.parse(container.attrs['State']['StartedAt']).astimezone(tz.tzlocal()).replace(tzinfo=None) ) else: container_stats['cpu'] = {}