From b79edc7df6a54337830684d9b53d61716d2a8330 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sat, 14 Jan 2023 09:59:56 +0100 Subject: [PATCH] Glances 3.3.1 release --- NEWS.rst | 56 +- conf/glances.conf | 1 + docker-compose/glances.conf | 8 +- docs/api.rst | 754 +++++++++++------------ docs/man/glances.1 | 88 +-- glances/__init__.py | 2 +- glances/outputs/static/package-lock.json | 12 +- glances/plugins/glances_network.py | 42 +- glances/processes.py | 21 +- 9 files changed, 481 insertions(+), 503 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index d876a860f9..314bbdf69b 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -6,7 +6,61 @@ Version 3.3.1 =============== - Under development, see milestone https://github.com/nicolargo/glances/milestone/61 +Enhancements: + + * Minor change on the help screen + * Refactor some loop in the processes function + * Replace json by ujson #2201 + +Bug corrected: + + * Unable to see docker related information #2180 + * CSV export dependent on sort order for docker container cpu #2156 + * Error when process list is displayed in Programs mode #2209 + * Console formatting permanently messed up when other text printed #2211 + * API GET uptime returns formatted string, not seconds as the doc says #2158 + * Glances UI is breaking for multiline commands #2189 + +Documentation and CI: + + * Add unitary test for memory profiling + * Update memory profile chart + * Add run-docker-ubuntu-* in Makefile + * The open-web-browser option was missing dashes #2219 + * Correct regexp in glances.conf file example + * What is CW from network #2222 (related to discussion #2221) + * Change Glances repology URL + * Add example for the date format + * Correct Flake8 configuration file + * Drop UT for Python 3.5 and 3.6 (no more available in Ubuntu 22.04) + * Correct unitary test with Python 3.5 + * Update Makefile with comments + * Update Python minimal requirement for py3nvlm + * Update security policy (user can open private issue directly in Github) + * Add a simple run script. Entry point for IDE debuger + +Cyber security update: + + * Security alert on ujson < 5.4 + * Merge pull request #2243 from nicolargo/renovate/nvidia-cuda-12.x + * Merge pull request #2244 from nicolargo/renovate/crazy-max-ghaction-docker-meta-4.x + * Merge pull request #2228 from nicolargo/renovate/zeroconf-0.x + * Merge pull request #2242 from nicolargo/renovate/crazy-max-ghaction-docker-meta-4.x + * Merge pull request #2239 from mfridge/action-command-split + * Merge pull request #2165 from nicolargo/renovate/zeroconf-0.x + * Merge pull request #2199 from nicolargo/renovate/alpine-3.x + * Merge pull request #2202 from chncaption/oscs_fix_cdr0ts8au51t49so8c6g + * Bump loader-utils from 2.0.0 to 2.0.3 in /glances/outputs/static #2187 - Update Web lib + +Contributors for this version: + + * Nicolargo + * renovate[bot] + * chncaption + * fkwong + * *mfridge + +And also a big thanks to @RazCrimson (https://github.com/RazCrimson) for the support to the Glances community ! =============== Version 3.3.0.4 diff --git a/conf/glances.conf b/conf/glances.conf index e56ad73bc1..835b84d98a 100644 --- a/conf/glances.conf +++ b/conf/glances.conf @@ -307,6 +307,7 @@ battery_critical=95 #core 0_fans_speed_alias=CPU Core 0 fan #or #core 0_alias=CPU Core 0 +#core 1_alias=CPU Core 1 [processcount] disable=False diff --git a/docker-compose/glances.conf b/docker-compose/glances.conf index 6f6e418051..0ee06cbd59 100644 --- a/docker-compose/glances.conf +++ b/docker-compose/glances.conf @@ -10,8 +10,10 @@ refresh=2 # Does Glances should check if a newer version is available on PyPI ? check_update=false # History size (maximum number of values) -# Default is 3600 seconds (1 hour) -history_size=3600 +# Default is 1200 values (~1h with the default refresh rate) +history_size=1200 +# Set the way Glances should display the date (default is %Y-%m-%d %H:%M:%S %Z) +#strftime_format="%Y-%m-%d %H:%M:%S %Z" ############################################################################## # User interface @@ -212,7 +214,7 @@ critical=-85 disable=False # Define the list of hidden disks (comma-separated regexp) #hide=sda2,sda5,loop.* -hide=loop.*,/dev/loop* +hide=loop.*,/dev/loop.* # Define the list of disks to be show (comma-separated) #show=sda.* # Alias for sda1 diff --git a/docs/api.rst b/docs/api.rst index 590b3a1e78..d60c548fac 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.8624663352966309}, + "timer": 0.8425271511077881}, {"count": 0, "countmax": 20.0, "countmin": None, @@ -83,7 +83,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.8622386455535889}] + "timer": 0.8423657417297363}] 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.8624663352966309}]} + "timer": 0.8425271511077881}]} GET core -------- @@ -131,19 +131,19 @@ Get plugin stats:: "ctx_switches": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 47.0, + "idle": 58.6, "interrupts": 0, - "iowait": 2.2, + "iowait": 0.0, "irq": 0.0, "nice": 0.0, "soft_interrupts": 0, - "softirq": 1.0, + "softirq": 0.0, "steal": 0.0, "syscalls": 0, - "system": 8.0, + "system": 6.7, "time_since_update": 1, - "total": 48.0, - "user": 41.8} + "total": 38.2, + "user": 34.7} Fields descriptions: @@ -166,7 +166,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/cpu/total - {"total": 48.0} + {"total": 38.2} GET diskio ---------- @@ -215,7 +215,7 @@ Get plugin stats:: "Id": "3abd51c615968482d9ccff5afc629f267f6dda113ed68b75b432615fae3b49fb", "Image": ["portainer/portainer-ce:2.9.3"], "Status": "running", - "Uptime": "3 days", + "Uptime": "36 mins", "cpu": {"total": 0.0}, "cpu_percent": 0.0, "io": {}, @@ -242,9 +242,9 @@ Get plugin stats:: "Os": "linux"}, "Name": "Engine", "Version": "20.10.22"}, - {"Details": {"GitCommit": "78f51771157abb6c9ed224c22013cdf09962315d"}, + {"Details": {"GitCommit": "5b842e528e99d4d4c1686467debf2bd4b88ecd86"}, "Name": "containerd", - "Version": "1.6.13"}, + "Version": "1.6.15"}, {"Details": {"GitCommit": "v1.1.4-0-g5fd4c4d"}, "Name": "runc", "Version": "1.1.4"}, @@ -266,13 +266,13 @@ Get plugin stats:: # curl http://localhost:61208/api/3/fs [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 54919016448, + "free": 50442330112, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 76.2, + "percent": 78.2, "size": 243334156288, - "used": 176027684864}, + "used": 180504371200}, {"device_name": "zsfpool", "free": 41811968, "fs_type": "zfs", @@ -291,13 +291,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": 54919016448, + "free": 50442330112, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 76.2, + "percent": 78.2, "size": 243334156288, - "used": 176027684864}]} + "used": 180504371200}]} GET ip ------ @@ -305,11 +305,11 @@ GET ip Get plugin stats:: # curl http://localhost:61208/api/3/ip - {"address": "192.168.1.12", + {"address": "192.168.1.14", "gateway": "192.168.1.1", "mask": "255.255.255.0", "mask_cidr": 24, - "public_address": "90.8.134.236", + "public_address": "109.210.93.150", "public_info_human": ""} Get a specific field:: @@ -323,7 +323,7 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/3/load - {"cpucore": 4, "min1": 2.5703125, "min15": 2.0634765625, "min5": 2.2353515625} + {"cpucore": 4, "min1": 1.31591796875, "min15": 1.9091796875, "min5": 1.6796875} Fields descriptions: @@ -335,7 +335,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/load/min1 - {"min1": 2.5703125} + {"min1": 1.31591796875} GET mem ------- @@ -343,16 +343,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/3/mem - {"active": 3018625024, - "available": 2375323648, - "buffers": 97480704, - "cached": 2774757376, - "free": 2375323648, - "inactive": 3403993088, - "percent": 69.7, - "shared": 623783936, + {"active": 2804523008, + "available": 2706178048, + "buffers": 264335360, + "cached": 3114909696, + "free": 2706178048, + "inactive": 3516907520, + "percent": 65.5, + "shared": 591532032, "total": 7836188672, - "used": 5460865024} + "used": 5130010624} Fields descriptions: @@ -379,13 +379,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/3/memswap - {"free": 5943132160, - "percent": 26.5, - "sin": 1293230080, - "sout": 3734319104, + {"free": 2626473984, + "percent": 67.5, + "sin": 4755005440, + "sout": 11063549952, "time_since_update": 1, "total": 8082419712, - "used": 2139287552} + "used": 5455945728} Fields descriptions: @@ -409,29 +409,29 @@ Get plugin stats:: # curl http://localhost:61208/api/3/network [{"alias": None, - "cumulative_cx": 90372412, - "cumulative_rx": 45186206, - "cumulative_tx": 45186206, - "cx": 23560, + "cumulative_cx": 398215554, + "cumulative_rx": 199107777, + "cumulative_tx": 199107777, + "cx": 3314, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 11780, + "rx": 1657, "speed": 0, "time_since_update": 1, - "tx": 11780}, + "tx": 1657}, {"alias": None, - "cumulative_cx": 5545979740, - "cumulative_rx": 5412582465, - "cumulative_tx": 133397275, - "cx": 11955338, + "cumulative_cx": 39497892918, + "cumulative_rx": 38949809930, + "cumulative_tx": 548082988, + "cx": 27720, "interface_name": "wlp2s0", "is_up": True, "key": "interface_name", - "rx": 11833811, + "rx": 21708, "speed": 0, "time_since_update": 1, - "tx": 121527}] + "tx": 6012}] Fields descriptions: @@ -458,23 +458,23 @@ Get a specific field:: "br_grafana", "mpqemubr0", "tap-1e376645a40", - "veth7ad1596"]} + "veth57bdacb"]} 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": 90372412, - "cumulative_rx": 45186206, - "cumulative_tx": 45186206, - "cx": 23560, + "cumulative_cx": 398215554, + "cumulative_rx": 199107777, + "cumulative_tx": 199107777, + "cx": 3314, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 11780, + "rx": 1657, "speed": 0, "time_since_update": 1, - "tx": 11780}]} + "tx": 1657}]} GET now ------- @@ -482,7 +482,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/3/now - "2022-12-21 13:50:24 CET" + "2023-01-14 09:45:44 CET" GET percpu ---------- @@ -493,29 +493,29 @@ Get plugin stats:: [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 40.0, - "iowait": 4.0, + "idle": 56.1, + "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 7.0, - "total": 60.0, - "user": 48.0}, + "system": 4.7, + "total": 43.9, + "user": 39.3}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 49.0, + "idle": 28.2, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 4.0, - "total": 51.0, - "user": 46.0}] + "system": 3.9, + "total": 71.8, + "user": 68.0}] Get a specific field:: @@ -534,7 +534,7 @@ Get plugin stats:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.011101, + "status": 0.007094, "timeout": 3}] Get a specific field:: @@ -551,7 +551,7 @@ Get a specific item when field matchs the given value:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.011101, + "status": 0.007094, "timeout": 3}]} GET processcount @@ -560,12 +560,12 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/3/processcount - {"pid_max": 0, "running": 1, "sleeping": 314, "thread": 1698, "total": 441} + {"pid_max": 0, "running": 2, "sleeping": 334, "thread": 1765, "total": 403} Get a specific field:: # curl http://localhost:61208/api/3/processcount/total - {"total": 441} + {"total": 403} GET processlist --------------- @@ -573,7 +573,22 @@ GET processlist Get plugin stats:: # curl http://localhost:61208/api/3/processlist - [{"cmdline": ["/snap/firefox/2154/usr/lib/firefox/firefox", + [{"cmdline": ["/snap/firefox/2154/usr/lib/firefox/firefox"], + "cpu_percent": 0.0, + "cpu_times": [8504.75, 2803.93, 8401.36, 1489.57, 0.0], + "gids": [1000, 1000, 1000], + "io_counters": [6360911872, 11858505728, 0, 0, 0], + "key": "pid", + "memory_info": [484036608, 22242152448, 100323328, 659456, 0, 1409527808, 0], + "memory_percent": 6.176939176178121, + "name": "firefox", + "nice": 0, + "num_threads": 187, + "pid": 4674, + "status": "S", + "time_since_update": 1, + "username": "nicolargo"}, + {"cmdline": ["/snap/firefox/2154/usr/lib/firefox/firefox", "-contentproc", "-childID", "1", @@ -593,249 +608,251 @@ Get plugin stats:: "true", "tab"], "cpu_percent": 0.0, - "cpu_times": [544.28, 96.68, 0.0, 0.0, 0.0], + "cpu_times": [1878.88, 294.96, 0.0, 0.0, 0.0], "gids": [1000, 1000, 1000], - "io_counters": [131830784, 0, 0, 0, 0], + "io_counters": [446676992, 0, 0, 0, 0], "key": "pid", - "memory_info": [465154048, 3321061376, 73093120, 659456, 0, 731664384, 0], - "memory_percent": 5.935973053610519, + "memory_info": [379330560, 3766951936, 44253184, 659456, 0, 1161146368, 0], + "memory_percent": 4.840753277871052, "name": "WebExtensions", "nice": 0, - "num_threads": 22, + "num_threads": 20, "pid": 4980, "status": "S", "time_since_update": 1, - "username": "nicolargo"}, - {"cmdline": ["/snap/firefox/2154/usr/lib/firefox/firefox"], - "cpu_percent": 0.0, - "cpu_times": [4509.1, 1511.09, 3792.22, 791.2, 0.0], - "gids": [1000, 1000, 1000], - "io_counters": [1919733760, 4714143744, 0, 0, 0], - "key": "pid", - "memory_info": [456572928, 30645571584, 117829632, 659456, 0, 1229160448, 0], - "memory_percent": 5.826466757129147, - "name": "firefox", - "nice": 0, - "num_threads": 178, - "pid": 4674, - "status": "S", - "time_since_update": 1, "username": "nicolargo"}] Get a specific field:: # curl http://localhost:61208/api/3/processlist/pid - {"pid": [4980, - 4674, - 5464, + {"pid": [4674, + 4980, 5110, - 87895, - 87518, - 93773, + 527830, + 173709, 3699, + 5464, + 431554, + 495017, 5113, - 87474, - 10499, - 10094, + 173765, + 174093, + 87518, 10140, - 56113, - 50931, - 87407, - 65742, + 93773, 5000, - 87546, - 99360, - 87753, - 87995, - 87994, - 99579, - 99462, - 99838, - 51406, - 51412, - 51549, - 10551, - 87616, - 94497, + 173645, + 534445, + 511174, + 173751, + 534543, 9953, - 87853, - 94498, - 87445, + 534732, + 535113, + 284680, + 128927, + 173679, + 535159, + 4050, 3586, - 87570, - 100353, - 2510, - 48450, 4426, - 67307, - 5690, - 87454, - 1653, + 173949, + 493657, + 511164, + 2510, + 3351, + 173688, + 173781, + 496818, + 496817, + 408152, + 493678, 4206, - 87779, + 511549, 427, - 17411, - 4050, - 87412, - 4903, - 87413, - 5691, - 2702, + 173973, 3820, - 3512, 5730, - 4008, 17316, - 10649, - 1777, + 174051, + 1616, + 3512, + 493683, + 1, + 5690, 3903, + 4008, + 165775, 3792, - 1616, + 174314, + 493699, + 94498, + 2702, + 1662, + 1641, + 87895, + 87994, + 4158, + 87995, + 174313, 4433, - 10381, - 67618, - 3902, - 10082, - 98474, - 3829, - 10318, + 87753, 3897, - 99871, - 10319, + 5691, + 4458, + 87853, + 94497, + 4903, + 3902, 17315, - 64241, - 66633, - 2209, - 1, - 3351, - 3783, - 3676, - 4005, - 1662, - 4158, - 1641, - 1838, - 3910, - 3730, - 98475, - 2626, - 1636, + 3829, + 173649, + 87454, 3273, + 1838, + 3676, + 3783, 3695, - 64274, - 3915, - 10048, - 2688, - 4049, - 10032, + 10499, + 87474, 3907, + 2209, + 3730, + 3486, + 3915, 3901, - 4458, + 3910, + 10649, + 533610, + 10551, + 511526, + 10082, + 87412, + 1615, + 173650, + 4005, 3904, - 3898, - 3805, + 10318, + 165937, + 1663, + 1777, 2417, - 3486, + 2626, + 10319, + 3805, + 10094, + 3956, 1837, - 1868, - 87663, + 17467, + 1636, + 2688, + 4049, + 4089, + 3521, + 87413, + 87779, + 3861, 1416, - 10033, + 102131, + 10032, 1782, 1598, - 3970, - 1663, - 3591, - 3743, - 17467, - 1615, - 3956, + 115869, 17484, - 9974, - 4170, - 3527, - 3909, - 1642, - 3861, - 3521, + 3970, 1659, - 3908, + 3524, + 465, 2159, - 3697, - 3717, + 3898, + 3527, + 3802, + 5024, + 3743, 1626, + 10033, + 3908, 4036, - 3900, - 4089, - 1660, - 3524, + 3697, + 4170, + 10048, + 1642, 3906, 1654, - 3891, - 3781, - 3802, + 3717, + 173849, + 3591, 3896, + 3726, + 3909, + 3722, + 3900, + 3781, 3994, + 10381, 3748, - 465, - 3722, - 5769, - 3726, - 3905, - 3508, + 87429, 3584, - 3533, + 3905, + 1868, 1612, - 1648, + 3891, + 112675, + 1607, + 1660, + 3533, 3510, - 3664, + 98474, + 10372, + 3508, + 1648, 1652, - 1607, 3706, - 2680, - 1999, - 1419, + 3664, 1629, + 1999, 1614, 1415, - 2681, - 10372, - 5024, + 535105, + 1419, 1666, - 3354, 4187, - 17364, - 100324, + 2680, + 173665, 1432, - 67596, + 17364, + 2681, 1430, - 87429, - 4620, 2428, - 98346, - 98353, + 3354, + 142951, 1609, - 67550, - 67574, - 3487, - 67558, - 4546, - 87415, - 67580, + 98475, 1599, - 99855, - 100352, + 535158, + 5769, 10035, + 173652, + 87415, 3895, 2483, + 511483, 3572, - 98485, + 511504, + 191811, + 98353, + 98484, + 511512, + 532452, + 98346, + 511490, + 4546, + 3487, 2430, - 2465, 2492, - 1669, + 2465, 1431, - 98484, + 1669, 2, 3, 4, @@ -962,8 +979,6 @@ Get a specific field:: 1087, 1088, 1089, - 2188, - 2190, 2491, 2527, 2539, @@ -976,136 +991,65 @@ Get a specific field:: 2599, 2606, 3780, + 4620, 10063, - 75477, - 87199, - 93508, - 93821, - 93822, - 93824, - 95614, - 96086, - 96234, - 96378, - 96637, - 96797, - 97087, - 97324, - 97895, - 98051, - 98052, - 98553, - 99561, - 99632, - 99639, - 99684, - 99738, - 99739, - 99740, - 99741, - 99742, - 99743, - 99744, - 99745, - 99746, - 99747, - 99748, - 99749, - 99750, - 99751, - 99752, - 99753, - 99754, - 99755, - 99756, - 99757, - 99758, - 99759, - 99760, - 99761, - 99762, - 99763, - 99764, - 99765, - 99766, - 99767, - 99768, - 99769, - 99770, - 99771, - 99772, - 99773, - 99774, - 99775, - 99776, - 99777, - 99778, - 99779, - 99780, - 99781, - 99782, - 99783, - 99784, - 99785, - 99786, - 99787, - 99788, - 99789, - 99790, - 99791, - 99792, - 99793, - 99794, - 99795, - 99796, - 99797, - 99798, - 99799, - 99800, - 99801, - 99802, - 99804, - 100030]} + 87445, + 282372, + 284747, + 284755, + 284756, + 284759, + 284760, + 445439, + 445440, + 445441, + 491085, + 493353, + 493435, + 493436, + 493437, + 493438, + 493440, + 493488, + 525438, + 526723, + 527334, + 529501, + 532606, + 532692, + 532694, + 532700, + 532986, + 533409, + 533601, + 533685, + 533744, + 533796, + 533986, + 534098, + 534679]} Get a specific item when field matchs the given value:: - # curl http://localhost:61208/api/3/processlist/pid/4980 - {"4980": [{"cmdline": ["/snap/firefox/2154/usr/lib/firefox/firefox", - "-contentproc", - "-childID", - "1", - "-isForBrowser", - "-prefsLen", - "31799", - "-prefMapSize", - "234979", - "-jsInitLen", - "246704", - "-parentBuildID", - "20221128185858", - "-appDir", - "/snap/firefox/2154/usr/lib/firefox/browser", - "{8ed7e0e9-5dcf-4c35-9523-65d5178968f5}", - "4674", - "true", - "tab"], + # curl http://localhost:61208/api/3/processlist/pid/4674 + {"4674": [{"cmdline": ["/snap/firefox/2154/usr/lib/firefox/firefox"], "cpu_percent": 0.0, - "cpu_times": [544.28, 96.68, 0.0, 0.0, 0.0], + "cpu_times": [8504.75, 2803.93, 8401.36, 1489.57, 0.0], "gids": [1000, 1000, 1000], - "io_counters": [131830784, 0, 0, 0, 0], + "io_counters": [6360911872, 11858505728, 0, 0, 0], "key": "pid", - "memory_info": [465154048, - 3321061376, - 73093120, + "memory_info": [484036608, + 22242152448, + 100323328, 659456, 0, - 731664384, + 1409527808, 0], - "memory_percent": 5.935973053610519, - "name": "WebExtensions", + "memory_percent": 6.176939176178121, + "name": "firefox", "nice": 0, - "num_threads": 22, - "pid": 4980, + "num_threads": 187, + "pid": 4674, "status": "S", "time_since_update": 1, "username": "nicolargo"}]} @@ -1124,69 +1068,69 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/3/quicklook - {"cpu": 48.0, - "cpu_hz": 3000000000.0, - "cpu_hz_current": 2765088250.0, + {"cpu": 38.2, + "cpu_hz": 2025000000.0, + "cpu_hz_current": 1247640750.0, "cpu_name": "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz", - "mem": 69.7, + "mem": 65.5, "percpu": [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 40.0, - "iowait": 4.0, + "idle": 56.1, + "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 7.0, - "total": 60.0, - "user": 48.0}, + "system": 4.7, + "total": 43.9, + "user": 39.3}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 49.0, + "idle": 28.2, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 4.0, - "total": 51.0, - "user": 46.0}, + "system": 3.9, + "total": 71.8, + "user": 68.0}, {"cpu_number": 2, "guest": 0.0, "guest_nice": 0.0, - "idle": 48.0, - "iowait": 2.0, + "idle": 82.4, + "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 5.9, - "total": 52.0, - "user": 44.1}, + "system": 2.9, + "total": 17.6, + "user": 14.7}, {"cpu_number": 3, "guest": 0.0, "guest_nice": 0.0, - "idle": 61.8, - "iowait": 2.0, + "idle": 80.4, + "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, - "softirq": 2.9, + "softirq": 0.0, "steal": 0.0, - "system": 6.9, - "total": 38.2, - "user": 26.5}], - "swap": 26.5} + "system": 4.9, + "total": 19.6, + "user": 14.7}], + "swap": 67.5} Get a specific field:: # curl http://localhost:61208/api/3/quicklook/cpu - {"cpu": 48.0} + {"cpu": 38.2} GET sensors ----------- @@ -1257,7 +1201,7 @@ GET uptime Get plugin stats:: # curl http://localhost:61208/api/3/uptime - "9 days, 3:34:59" + "32 days, 23:30:09" GET all stats ------------- @@ -1273,33 +1217,33 @@ GET stats history History of a plugin:: # curl http://localhost:61208/api/3/cpu/history - {"system": [["2022-12-21T13:50:25.001548", 8.0], - ["2022-12-21T13:50:26.107518", 8.0], - ["2022-12-21T13:50:27.259558", 8.0]], - "user": [["2022-12-21T13:50:25.001537", 41.8], - ["2022-12-21T13:50:26.107513", 41.8], - ["2022-12-21T13:50:27.259553", 44.0]]} + {"system": [["2023-01-14T09:45:45.821873", 6.7], + ["2023-01-14T09:45:46.919905", 6.7], + ["2023-01-14T09:45:48.110702", 4.8]], + "user": [["2023-01-14T09:45:45.821864", 34.7], + ["2023-01-14T09:45:46.919895", 34.7], + ["2023-01-14T09:45:48.110694", 12.4]]} Limit history to last 2 values:: # curl http://localhost:61208/api/3/cpu/history/2 - {"system": [["2022-12-21T13:50:26.107518", 8.0], - ["2022-12-21T13:50:27.259558", 8.0]], - "user": [["2022-12-21T13:50:26.107513", 41.8], - ["2022-12-21T13:50:27.259553", 44.0]]} + {"system": [["2023-01-14T09:45:46.919905", 6.7], + ["2023-01-14T09:45:48.110702", 4.8]], + "user": [["2023-01-14T09:45:46.919895", 34.7], + ["2023-01-14T09:45:48.110694", 12.4]]} History for a specific field:: # curl http://localhost:61208/api/3/cpu/system/history - {"system": [["2022-12-21T13:50:25.001548", 8.0], - ["2022-12-21T13:50:26.107518", 8.0], - ["2022-12-21T13:50:27.259558", 8.0]]} + {"system": [["2023-01-14T09:45:45.821873", 6.7], + ["2023-01-14T09:45:46.919905", 6.7], + ["2023-01-14T09:45:48.110702", 4.8]]} Limit history for a specific field to last 2 values:: # curl http://localhost:61208/api/3/cpu/system/history - {"system": [["2022-12-21T13:50:26.107518", 8.0], - ["2022-12-21T13:50:27.259558", 8.0]]} + {"system": [["2023-01-14T09:45:46.919905", 6.7], + ["2023-01-14T09:45:48.110702", 4.8]]} GET limits (used for thresholds) -------------------------------- diff --git a/docs/man/glances.1 b/docs/man/glances.1 index d433d6156c..4a07513fa5 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" "Dec 21, 2022" "3.3.1_beta1" "Glances" +.TH "GLANCES" "1" "Jan 14, 2023" "3.3.1" "Glances" .SH NAME glances \- An eye on your system .SH SYNOPSIS @@ -258,7 +258,7 @@ set the server cache time [default: 1 sec] .UNINDENT .INDENT 0.0 .TP -.B open\-web\-browser +.B \-\-open\-web\-browser try to open the Web UI in the default Web browser .UNINDENT .INDENT 0.0 @@ -732,60 +732,60 @@ format): .nf .ft C { - "version": 1, - "disable_existing_loggers": "False", - "root": { - "level": "INFO", - "handlers": ["file", "console"] + \(dqversion\(dq: 1, + \(dqdisable_existing_loggers\(dq: \(dqFalse\(dq, + \(dqroot\(dq: { + \(dqlevel\(dq: \(dqINFO\(dq, + \(dqhandlers\(dq: [\(dqfile\(dq, \(dqconsole\(dq] }, - "formatters": { - "standard": { - "format": "%(asctime)s \-\- %(levelname)s \-\- %(message)s" + \(dqformatters\(dq: { + \(dqstandard\(dq: { + \(dqformat\(dq: \(dq%(asctime)s \-\- %(levelname)s \-\- %(message)s\(dq }, - "short": { - "format": "%(levelname)s: %(message)s" + \(dqshort\(dq: { + \(dqformat\(dq: \(dq%(levelname)s: %(message)s\(dq }, - "free": { - "format": "%(message)s" + \(dqfree\(dq: { + \(dqformat\(dq: \(dq%(message)s\(dq } }, - "handlers": { - "file": { - "level": "DEBUG", - "class": "logging.handlers.RotatingFileHandler", - "formatter": "standard", - "filename": "/var/tmp/glances.log" + \(dqhandlers\(dq: { + \(dqfile\(dq: { + \(dqlevel\(dq: \(dqDEBUG\(dq, + \(dqclass\(dq: \(dqlogging.handlers.RotatingFileHandler\(dq, + \(dqformatter\(dq: \(dqstandard\(dq, + \(dqfilename\(dq: \(dq/var/tmp/glances.log\(dq }, - "console": { - "level": "CRITICAL", - "class": "logging.StreamHandler", - "formatter": "free" + \(dqconsole\(dq: { + \(dqlevel\(dq: \(dqCRITICAL\(dq, + \(dqclass\(dq: \(dqlogging.StreamHandler\(dq, + \(dqformatter\(dq: \(dqfree\(dq } }, - "loggers": { - "debug": { - "handlers": ["file", "console"], - "level": "DEBUG" + \(dqloggers\(dq: { + \(dqdebug\(dq: { + \(dqhandlers\(dq: [\(dqfile\(dq, \(dqconsole\(dq], + \(dqlevel\(dq: \(dqDEBUG\(dq }, - "verbose": { - "handlers": ["file", "console"], - "level": "INFO" + \(dqverbose\(dq: { + \(dqhandlers\(dq: [\(dqfile\(dq, \(dqconsole\(dq], + \(dqlevel\(dq: \(dqINFO\(dq }, - "standard": { - "handlers": ["file"], - "level": "INFO" + \(dqstandard\(dq: { + \(dqhandlers\(dq: [\(dqfile\(dq], + \(dqlevel\(dq: \(dqINFO\(dq }, - "requests": { - "handlers": ["file", "console"], - "level": "ERROR" + \(dqrequests\(dq: { + \(dqhandlers\(dq: [\(dqfile\(dq, \(dqconsole\(dq], + \(dqlevel\(dq: \(dqERROR\(dq }, - "elasticsearch": { - "handlers": ["file", "console"], - "level": "ERROR" + \(dqelasticsearch\(dq: { + \(dqhandlers\(dq: [\(dqfile\(dq, \(dqconsole\(dq], + \(dqlevel\(dq: \(dqERROR\(dq }, - "elasticsearch.trace": { - "handlers": ["file", "console"], - "level": "ERROR" + \(dqelasticsearch.trace\(dq: { + \(dqhandlers\(dq: [\(dqfile\(dq, \(dqconsole\(dq], + \(dqlevel\(dq: \(dqERROR\(dq } } } @@ -885,6 +885,6 @@ $ glances –browser .sp Nicolas Hennion aka Nicolargo <\fI\%contact@nicolargo.com\fP> .SH COPYRIGHT -2022, Nicolas Hennion +2023, Nicolas Hennion .\" Generated by docutils manpage writer. . diff --git a/glances/__init__.py b/glances/__init__.py index 4db6663fd1..038787d834 100644 --- a/glances/__init__.py +++ b/glances/__init__.py @@ -19,7 +19,7 @@ # Global name # Version should start and end with a numerical char # See https://packaging.python.org/specifications/core-metadata/#version -__version__ = '3.3.1_beta1' +__version__ = '3.3.1' __author__ = 'Nicolas Hennion ' __license__ = 'LGPLv3' diff --git a/glances/outputs/static/package-lock.json b/glances/outputs/static/package-lock.json index 060bb12e94..6359af4ba3 100644 --- a/glances/outputs/static/package-lock.json +++ b/glances/outputs/static/package-lock.json @@ -4527,9 +4527,9 @@ "peer": true }, "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "bin": { "json5": "lib/cli.js" @@ -11822,9 +11822,9 @@ "peer": true }, "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, "jsprim": { diff --git a/glances/plugins/glances_network.py b/glances/plugins/glances_network.py index 98061924dc..62715bd250 100644 --- a/glances/plugins/glances_network.py +++ b/glances/plugins/glances_network.py @@ -29,50 +29,26 @@ # 'key': 'interface_name'} # Fields description fields_description = { - 'interface_name': { - 'description': 'Interface name.', - 'unit': 'string' - }, - 'alias': { - 'description': 'Interface alias name (optional).', - 'unit': 'string' - }, - 'rx': { - 'description': 'The received/input rate (in bit per second).', - 'unit': 'bps' - }, - 'tx': { - 'description': 'The sent/output rate (in bit per second).', - 'unit': 'bps' - }, - 'cx': { - 'description': 'The cumulative received+sent rate (in bit per second).', - 'unit': 'bps' - }, + 'interface_name': {'description': 'Interface name.', 'unit': 'string'}, + 'alias': {'description': 'Interface alias name (optional).', 'unit': 'string'}, + 'rx': {'description': 'The received/input rate (in bit per second).', 'unit': 'bps'}, + 'tx': {'description': 'The sent/output rate (in bit per second).', 'unit': 'bps'}, + 'cx': {'description': 'The cumulative received+sent rate (in bit per second).', 'unit': 'bps'}, 'cumulative_rx': { 'description': 'The number of bytes received through the interface (cumulative).', 'unit': 'bytes', }, - 'cumulative_tx': { - 'description': 'The number of bytes sent through the interface (cumulative).', - 'unit': 'bytes' - }, + 'cumulative_tx': {'description': 'The number of bytes sent through the interface (cumulative).', 'unit': 'bytes'}, 'cumulative_cx': { 'description': 'The cumulative number of bytes reveived and sent through the interface (cumulative).', - 'unit': 'bytes' + 'unit': 'bytes', }, 'speed': { 'description': 'Maximum interface speed (in bit per second). Can return 0 on some operating-system.', 'unit': 'bps', }, - 'is_up': { - 'description': 'Is the interface up ?', - 'unit': 'bool' - }, - 'time_since_update': { - 'description': 'Number of seconds since last update.', - 'unit': 'seconds' - }, + 'is_up': {'description': 'Is the interface up ?', 'unit': 'bool'}, + 'time_since_update': {'description': 'Number of seconds since last update.', 'unit': 'seconds'}, } # SNMP OID diff --git a/glances/processes.py b/glances/processes.py index 0d41c5be12..09f52aa4b9 100644 --- a/glances/processes.py +++ b/glances/processes.py @@ -288,17 +288,19 @@ def update(self): # Build the processes stats list (it is why we need psutil>=5.3.0) # This is one of the main bottleneck of Glances (see flame graph) # Filter processes - self.processlist = list(filter(lambda p: not (BSD and p.info['name'] == 'idle') and - not (WINDOWS and p.info['name'] == 'System Idle Process') and - not (MACOS and p.info['name'] == 'kernel_task') and - not (self.no_kernel_threads and LINUX and p.info['gids'].real == 0), - psutil.process_iter(attrs=sorted_attrs, ad_value=None))) + self.processlist = list( + filter( + lambda p: not (BSD and p.info['name'] == 'idle') + and not (WINDOWS and p.info['name'] == 'System Idle Process') + and not (MACOS and p.info['name'] == 'kernel_task') + and not (self.no_kernel_threads and LINUX and p.info['gids'].real == 0), + psutil.process_iter(attrs=sorted_attrs, ad_value=None), + ) + ) # Only get the info key self.processlist = [p.info for p in self.processlist] # Sort the processes list by the current sort_key - self.processlist = sort_stats(self.processlist, - sorted_by=self.sort_key, - reverse=True) + self.processlist = sort_stats(self.processlist, sorted_by=self.sort_key, reverse=True) # Update the processcount self.update_processcount(self.processlist) @@ -409,8 +411,7 @@ def update(self): self.processlist_cache[proc['pid']] = {cached: proc[cached] for cached in cached_attrs} # Apply user filter - self.processlist = list(filter(lambda p: not self._filter.is_filtered(p), - self.processlist)) + self.processlist = list(filter(lambda p: not self._filter.is_filtered(p), self.processlist)) # Compute the maximum value for keys in self._max_values_list: CPU, MEM # Useful to highlight the processes with maximum values