Compare commits

..

1166 Commits

Author SHA1 Message Date
nicolargo 17266144c8 Merge branch 'issue3400' into develop 2026-01-10 16:23:13 +01:00
nicolargo 7da3111b76 Process widget is broken in Homepage since a few dev release #3400 2026-01-10 16:23:01 +01:00
nicolargo 131d0aec8d Merge branch 'issue3127' into develop 2026-01-04 18:58:34 +01:00
nicolargo 3f060c684b Improve CPU name in Quicklook plugin for ARM prcessors #3127 2026-01-04 18:58:21 +01:00
nicolargo 37d2fe13d0 Make public IP address retreiving call async 2026-01-03 15:42:31 +01:00
nicolargo 0d8352c9c7 Update README 2026-01-03 15:21:24 +01:00
nicolargo ad9d52b5b0 Remove Netifaces2 from requirements file 2026-01-03 15:15:15 +01:00
nicolargo 22f7be01cb Merge branch 'issue3130' into develop 2026-01-03 15:14:20 +01:00
nicolargo 326c2fef51 Remove Netifaces dependency and use a pure Python to get Default Gateway.
Ip address and Net mask are now retreived thanks to PSutil.
2026-01-03 15:12:53 +01:00
nicolargo a3195463a0 Add system test for NATS exporter 2026-01-03 14:21:26 +01:00
nicolargo 84324615c5 Align conf file between default and the one used in Docker compose 2026-01-03 09:32:34 +01:00
nicolargo fa9bb2cdab Add Ruff formater in pre-hook 2026-01-03 09:25:27 +01:00
nicolargo d97c5cd5b9 Format and lint the code 2026-01-03 09:21:43 +01:00
nicolargo 420305a24a Merge branch 'issue3385' into develop 2026-01-03 09:18:45 +01:00
nicolargo 603f1ee8a4 Option to revert to using arrows to switch sorting? #3385 2026-01-03 09:18:25 +01:00
nicolargo 62e0b784bd Format/Lint code 2026-01-03 09:03:32 +01:00
nicolargo 1e25b4b130 Merge branch 'drake7707-develop' into develop 2026-01-03 09:00:39 +01:00
nicolargo 8b76cd458e Reduced cyclomatic complexity - Each function now does one thing
Better readability - Descriptive function names explain intent
Easier testing - Helper functions can be tested independently
Consistent style - f-strings used throughout
Removed code smells - No more pass statements in conditionals, no assert for validation
2026-01-03 09:00:05 +01:00
nicolargo 5cbbe91e1f Regenerate the WebUI and lint the code 2026-01-03 08:52:19 +01:00
Drakarah 862ac41b58 Merge branch 'develop' of https://github.com/nicolargo/glances into develop 2026-01-03 07:33:53 +00:00
Drakarah c8b2a90f3b Format the smart data in the web ui the same way as curses output 2026-01-03 07:33:09 +00:00
nicolargo 6e844f3c8b Update doc 2026-01-02 18:10:00 +01:00
nicolargo 91279b9144 Lint and format the code 2026-01-02 18:07:28 +01:00
nicolargo 7160cd8ae4 Merge branch 'issue3341-NATS' into develop 2026-01-02 18:00:30 +01:00
nicolargo 4bd36a34a1 Refactor NATS export to use async base class
Replace custom event loop threading implementation with GlancesExportAsyncio
base class. This simplifies the code by delegating async lifecycle management
to the parent class and using standardized _async_init(), _async_exit(), and
_async_export() methods instead of manual thread and event loop handling.
2026-01-02 17:28:52 +01:00
nicolargo 6cedd16753 Add test for NATS in the Makefile 2026-01-02 17:02:49 +01:00
nicolargo 12083f33fc Remove debug message 2026-01-02 09:42:03 +01:00
nicolargo b7c6cce373 First version ok. Log message should be removed. Code should be tested. 2025-12-30 19:04:07 +01:00
nicolargo ba932e72bd Read only container (with docker-compose) #3382 2025-12-30 10:40:36 +01:00
nicolargo 5d9593b393 Lint the code 2025-12-26 18:47:01 +01:00
nicolargo 5886321156 Lint code 2025-12-26 18:27:13 +01:00
nicolargo f72b3e226e Merge branch 'issue3387' into develop 2025-12-26 18:22:31 +01:00
nicolargo b9a89006a2 Sort by time do not work anymore #3387 2025-12-26 18:22:20 +01:00
nicolargo 1353b22445 Revert "Switch Docker Alpine based images to hardened"
This reverts commit f3b3b42e29.
2025-12-23 14:33:55 +01:00
nicolargo f058360b52 Merge branch 'issue3280' into develop 2025-12-23 14:15:16 +01:00
nicolargo f3b3b42e29 Switch Docker Alpine based images to hardened 2025-12-23 14:14:58 +01:00
nicolargo be199ef044 Merge branch 'issue3359_Improve_DockerFile' into develop 2025-12-22 10:58:30 +01:00
nicolargo 15d252a40b Some imporovement regarding Dockerfile - #3359 2025-12-22 10:58:09 +01:00
Drakarah 0b141ff92d update doc 2025-12-22 09:42:32 +00:00
Drakarah 60f304c313 auto unit on curses output 2025-12-22 09:38:14 +00:00
Drakarah 29d7a15dab Add a hide_attributes to well hide attributes 2025-12-22 09:17:20 +00:00
Drakarah f837614a69 Use proper labels instead of attribute keys (if possible) 2025-12-22 07:43:52 +00:00
Drakarah 3247b0dc33 Change proposed by @webdjoe (https://github.com/nicolargo/glances/pull/3355?notification_referrer_id=NT_kwDOAFGpVLMyMDY1Mjk5NjMyMTo1MzUxNzY0#issuecomment-3679451101) 2025-12-22 07:30:12 +00:00
Drakarah 507079491a Merge branch 'develop' of https://github.com/nicolargo/glances into develop 2025-12-22 07:27:41 +00:00
nicolargo d5ce8a7461 Lint code for Python 3.10 2025-12-21 14:40:39 +01:00
nicolargo f587b281c0 Catch error on ADM GPU plugin and Python 3.9 2025-12-20 15:33:17 +01:00
nicolargo e74dcc0060 Add comment for Git action tests 2025-12-20 15:19:58 +01:00
nicolargo 59d54b8e2b Correct issue with test on Python 3.9 2025-12-20 10:36:00 +01:00
nicolargo 184e490660 Bump to Python 3.10 as minimal version 2025-12-20 10:22:03 +01:00
nicolargo cd1f9348c2 Change load method name 2025-12-20 10:08:26 +01:00
nicolargo 68b5215e94 Lint quicklook 2025-12-20 10:01:01 +01:00
nicolargo 928e577d8c Update webUI 2025-12-20 09:53:29 +01:00
nicolargo 1b6d63fd2f Update deps 2025-12-20 09:44:49 +01:00
nicolargo fafdef615d Lint the code and correct issue with List (replaced by list) 2025-12-20 09:40:09 +01:00
nicolargo 8ab188bc04 Lint code 2025-12-20 09:33:01 +01:00
Nicolas Hennion cd9360f637
Merge pull request #3379 from okulev/cpu_freq_nomax
Fix quicklook in case psutil.cpu_freq().max=0.0
2025-12-20 09:22:22 +01:00
Nicolas Hennion be5a92c7e6
Merge pull request #3381 from ruben-arts/patch-1
Update license specification to SPDX format
2025-12-20 09:20:22 +01:00
Nicolas Hennion 9907e7242f
Merge pull request #3383 from kelvinvelasquez-SDE/fix/security-bandit
fix(security): resolve B701 (Jinja2) and B113 (timeout) vulnerabilities
2025-12-20 09:19:09 +01:00
Kelvin Velasquez 9b5cc01b06 fix(security): resolve B701 and B113 bandit issues (#3353)
Detailed changes:
- Enable autoescape=True for Jinja2 environment to prevent XSS (B701).
- Add timeout=15s to requests.get in nginx amp (B113).
- Add timeout=15s to post in restful export (B113).
2025-12-19 13:23:51 -06:00
Ruben Arts 89753198b3
Remove LGPL-3.0 license from pyproject.toml
License classifiers have been superseded by license expressions (see https://peps.python.org/pep-0639/).
2025-12-19 10:17:28 +01:00
Ruben Arts 8408a35100
Update license specification to SPDX format
Using the format specified in: https://spdx.org/licenses/
2025-12-19 10:04:07 +01:00
Ognyan Kulev bd246fe966 Fix quicklook in case psutil.cpu_freq().max=0.0 2025-12-16 20:57:46 +02:00
Nicolas Hennion 7b22761c75
Merge pull request #3377 from okulev/amdgpu_gtt
Include GTT to mem% for integrated AMD GPUs
2025-12-15 09:05:57 +01:00
Drakarah 9d4bc76304 Don't crash if any attribute fails to serialize 2025-12-15 08:03:08 +00:00
Drakarah 74771d0949 Merge branch 'develop' of https://github.com/nicolargo/glances into develop 2025-12-15 07:57:47 +00:00
Ognyan Kulev 2a508d7641 Use glob.glob also for device list 2025-12-14 23:57:41 +02:00
Ognyan Kulev 41db9c86f9 Include GTT to mem% for integrated AMD GPUs 2025-12-14 22:39:02 +02:00
nicolargo eb21408b72 Lint the code 2025-12-14 17:27:53 +01:00
Nicolas Hennion 4f48d33709
Merge pull request #3376 from okulev/amdgpu_ids
Get amdgpu name from `amdgpu.ids`
2025-12-14 17:24:33 +01:00
Ognyan Kulev 2800e81cb0 Add pci id files to tests-data 2025-12-14 14:19:18 +02:00
Ognyan Kulev bc629d12b2 Remove 'AMD' prefix and 'Graphics' suffix. 2025-12-14 12:44:30 +02:00
Ognyan Kulev ec11dff2cd Get amdgpu name from amdgpu.ids 2025-12-13 21:33:22 +02:00
nicolargo 71b0d4b606 Dependencies update 2025-12-06 17:55:24 +01:00
Drakarah d009335ba0 Merge branch 'develop' of https://github.com/nicolargo/glances into develop 2025-12-02 07:51:49 +00:00
nicolargo f84baaa8df Update requirements 2025-11-29 09:50:26 +01:00
Drakarah bbb733d6cb Fix output for curses 2025-11-23 10:47:10 +00:00
Drakarah 73f45dd9a8 remove old comment 2025-11-23 10:17:53 +00:00
Drakarah 394f94fb27 use pySMART instead of the old outdated pySMART.smartx 2025-11-23 10:15:53 +00:00
Drakarah 2146673841 Merge branch 'develop' of https://github.com/nicolargo/glances into develop 2025-11-23 10:09:11 +00:00
Drakarah fcc5061d8c smart nvme support 2025-11-23 10:05:55 +00:00
nicolargo f2641c80e2 Glances won't start when using snmp discovery with parameter -c #3354 2025-11-23 10:06:08 +01:00
nicolargo b9c451ce7a Merge branch 'issue3342-precommit_hooks' into develop 2025-11-22 19:08:00 +01:00
nicolargo ca2d729211 Add bandit in Makefile 2025-11-22 19:07:45 +01:00
nicolargo 50818213b1 What a sexy pre-commit config file ! 2025-11-22 18:48:13 +01:00
nicolargo 868aa0f4b1 Merge branch 'issue3352-fetch_client_server' into develop 2025-11-22 16:38:21 +01:00
nicolargo f7ab7efdd4 Fetch option is not compliant with client/server mode #3352 2025-11-22 16:37:03 +01:00
nicolargo 9797fc795e Correct lint issue 2025-11-21 18:36:50 +01:00
nicolargo fc2e2c71af Merge branch 'issue3350-jupiter-notebook' into develop 2025-11-21 18:32:36 +01:00
nicolargo 45bdcc92c7 Add a first and simple Jupyter notebook 2025-11-21 18:32:23 +01:00
nicolargo 1cf7683c1d Update Glances API documentation 2025-11-21 18:03:36 +01:00
nicolargo 1b3ee3e035 Update zero 2025-11-21 17:57:05 +01:00
nicolargo 3de1a25305 Revert some change on hide zero feature (need additional tests 2025-11-16 11:32:21 +01:00
nicolargo 1567c2db49 Update docs for PR #3346 2025-11-16 10:54:39 +01:00
nicolargo 1171d0b4d3 Merge branch 'ciherrera20-issue3345' into develop 2025-11-16 10:52:11 +01:00
nicolargo df684c64c2 Remove unuse parameter in split_esc 2025-11-16 10:51:49 +01:00
Chris Herrera c70321c3fb Formatting changes from running make format 2025-11-16 10:43:46 +01:00
Chris Herrera 93120b9779 Use split_esc in read_alias
Allows for ':' to be used in sensor names or alias names
2025-11-16 10:43:46 +01:00
Chris Herrera 89c8fc125c Add unit test for split_esc 2025-11-16 10:43:46 +01:00
Chris Herrera 11aac6ca4d Add split_esc function globals
Extends the functionality of str.split by adding an escape character. This allows ignoring separators preceded by the escape character.
2025-11-16 10:43:46 +01:00
nicolargo e7bd8d4768 Correct issue with hide on diskio 2025-11-16 10:41:35 +01:00
nicolargo e660520eb2 Correct typo in Makefile 2025-11-16 10:03:19 +01:00
nicolargo 0ae24bade0 Correct an issue with Wifi Alert following implementation of action for all plugins 2025-11-16 10:01:48 +01:00
nicolargo 728b36a8c9 Correct an issue with FS Alert following implementation of action for all plugins 2025-11-16 09:55:32 +01:00
nicolargo e2a1606479 Remove test from config file 2025-11-16 09:41:54 +01:00
Nicolas Hennion 8c9822ed26
Integrate ruff pre-commit hooks
Added ruff pre-commit hooks for linting and formatting.
2025-11-13 14:20:57 +01:00
Nicolas Hennion c4f6c04eb4
Refactor export options in README
Consolidate export options into categories for clarity.
2025-11-12 15:14:30 +01:00
nicolargo 7c13d53cb8 Make WebUI and Restful API SSL compliant #3340 2025-11-11 18:35:15 +01:00
nicolargo ccb00ec252 Make WebUI and Restful API SSL compliant #3340 2025-11-11 18:34:51 +01:00
nicolargo ab3b386e10 Improve Docker build pipeline#3336 2025-11-11 17:45:31 +01:00
nicolargo 5cbd9e030a Improve Docker build pipeline #3336 2025-11-11 17:45:16 +01:00
nicolargo c89effd602 Add a "focus" option for the processlist plugin #3293 2025-11-11 10:40:23 +01:00
nicolargo ab68fcbe28 Add a focus option for the processlist plugin #3293 2025-11-11 10:40:06 +01:00
nicolargo df4b312bec Update requirements files 2025-11-10 11:58:41 +01:00
nicolargo 25da171479 Add some fetch templates as an example 2025-11-10 11:45:33 +01:00
nicolargo 34c3c11725 Make unit test with Python 3.13 on Windows 2025-11-10 11:16:07 +01:00
nicolargo de0b1ef2da Make unit test with Python 3.14 on Windows and MacOS 2025-11-10 11:08:37 +01:00
nicolargo c0dad78189 Unittest now take into account the default glances.conf file 2025-11-10 10:53:52 +01:00
nicolargo d9abfca7fb Remove test because it breaks the CI test 2025-11-10 10:27:13 +01:00
nicolargo cb377055f2 Remove test because it breaks the CI test 2025-11-10 10:26:22 +01:00
nicolargo b2e3ea283d Remove test because it breaks the CI test 2025-11-10 07:48:03 +01:00
nicolargo a74b1867d7 Merge branch 'issue3324-log_and_alert_for_all' into develop 2025-11-09 17:28:42 +01:00
nicolargo afff3e2ba6 Add a simple unit test for get_alert 2025-11-09 17:27:00 +01:00
nicolargo fb17066692 Update docs 2025-11-09 13:05:07 +01:00
nicolargo e5e476d255 Ok for containers and folders 2025-11-09 13:02:59 +01:00
nicolargo ea10748e07 Fs is OK 2025-11-09 12:58:12 +01:00
nicolargo 7c19d01c21 DiskIO is OK 2025-11-09 12:54:29 +01:00
nicolargo 8bb2a8a91b Network IO is OK 2025-11-09 12:49:44 +01:00
nicolargo b75d1f24c3 Correct an issue with events type name (unattended _ in the name) 2025-11-08 19:34:31 +01:00
nicolargo 5efa3a01a3 Update docs 2025-11-08 19:22:49 +01:00
nicolargo e11cb80492 First issue corrected. It is now possible to generate alarm for plugins returning a list (tested only with sensors). To be done for all plugins (add header adn actions_keys) 2025-11-08 18:40:20 +01:00
nicolargo e2d37ee482 Change the way uv is installed #3338 2025-11-08 16:18:22 +01:00
nicolargo 930745b5f3 Package generation issue on Pypi because of README.rst #3337 2025-11-08 09:38:01 +01:00
nicolargo ba1b898a3e Add info in F.A.Q about free memory 2025-11-08 09:25:26 +01:00
nicolargo 9de127cce9 Update documentation for API 2025-11-08 09:16:16 +01:00
nicolargo 55ff04437f Update documentation for API 2025-11-08 08:58:19 +01:00
nicolargo ba6be768d0 Update documentation 2025-11-08 08:56:43 +01:00
nicolargo 4e669d0bc7 Merge branch 'develop' of github.com:nicolargo/glances into develop 2025-11-08 08:31:40 +01:00
Nicolas Hennion 3e7a49eb3b
Fix badge formatting in README.rst 2025-11-05 10:05:47 +01:00
nicolargo f1bd18a3a5 Update requirements file and add some tests 2025-11-04 21:41:15 +01:00
Nicolas Hennion ef5ef9eb8a
Replace logo and update README formatting
Updated logo image and modified title formatting.
2025-11-04 12:45:50 +01:00
Nicolas Hennion 89a10d9633
Enhance README with HTML and logo alignment
Added HTML formatting for logo and summary section.
2025-11-04 12:43:23 +01:00
Nicolas Hennion 6692e00a0e
Update README to include sponsors badge 2025-11-04 10:49:55 +01:00
Nicolas Hennion a1edfc735a
Fix twitter badge syntax in README.rst 2025-11-04 10:49:12 +01:00
Nicolas Hennion 5101512320
Update Twitter badge in README 2025-11-04 10:46:59 +01:00
Nicolas Hennion 244f13634f
Fix Reddit badge formatting in README
Updated badge formatting for Reddit in README.
2025-11-04 10:45:49 +01:00
Nicolas Hennion 7e3116a4e1
Update README with new social media badges
Added Reddit badge to README and updated Twitter badge.
2025-11-04 10:41:46 +01:00
nicolargo 579049cec5 Generate Snap for Glances 4.4.2_dev1 2025-11-03 15:32:11 +01:00
nicolargo 3646e011cf Generate Snap for Glances 4.4.1 2025-11-03 15:02:24 +01:00
nicolargo ff5e33d856 version 4.4.1 2025-11-03 14:47:16 +01:00
nicolargo de6fae584e Merge branch 'support/v4.4.x' 2025-11-03 14:44:57 +01:00
nicolargo 1c6a9e1412 Restful API issue after a while (stats are no more updated) #3333 2025-11-03 14:44:11 +01:00
nicolargo a7ba827cc5 On the road of Glances 4.4.1 2025-11-02 17:22:06 +01:00
nicolargo c523d20648 Merge branch 'master' into develop 2025-11-02 17:19:04 +01:00
nicolargo ef36eb9ab6 version 4.4.0 2025-11-02 17:07:24 +01:00
nicolargo f38ff27faa Merge branch 'develop' 2025-11-02 17:02:14 +01:00
nicolargo f87783689b Docs and requirements for Glances 4.4.0 2025-11-02 17:01:32 +01:00
nicolargo 28098f1555 Snap rplace architectures per platforms 2025-11-01 17:04:00 +01:00
nicolargo 0cec111764 Snap rplace architectures per platforms 2025-11-01 16:56:23 +01:00
nicolargo 54068209b3 Add limitation to TimescaleDB export for diskio, not working for the moment 2025-11-01 16:43:56 +01:00
nicolargo bdd66c56d3 Correct an issue when containers ports as no destination 2025-11-01 15:54:30 +01:00
nicolargo 10111cc7f6 Add check in pre-commit 2025-11-01 15:32:54 +01:00
nicolargo 02752f90ea Remove duplicate line at the end of file and update doc for Glances 4.4.0RC1 2025-11-01 15:29:34 +01:00
nicolargo d9d4507bd4 Merge branch 'issue2054' into develop 2025-11-01 10:27:50 +01:00
nicolargo 133f97efd8 Show used port in container section #2054 2025-11-01 10:27:34 +01:00
nicolargo c9fc7d4bb4 Resolve conflict 2025-11-01 09:50:47 +01:00
nicolargo 7f34578cea Show used port in container section - First try, ok for one port... #2054 2025-11-01 09:49:49 +01:00
nicolargo 7b827954e0 Update dep 2025-11-01 09:31:52 +01:00
nicolargo 3a3ae4eddb Solve issue with multiprocessing exception with Snap package 2025-10-31 19:15:06 +01:00
nicolargo aef78c3a10 Use develop branch for snap 2025-10-31 17:58:45 +01:00
nicolargo db13c8380b Update docs and add some system test for CPU consumption 2025-10-31 17:43:44 +01:00
nicolargo 7f2f69985c Update .gitignore 2025-10-24 19:24:03 +02:00
nicolargo 6361217258 Correct issue with 2 digit instead of one in Glances UI MEM 2025-10-24 19:22:57 +02:00
nicolargo 7edbab35d8 Highlight zero for proces CPU and RAM 2025-10-24 18:54:24 +02:00
nicolargo 067eb918ad Sensors plugin refresh by default every 10 seconds 2025-10-24 18:35:30 +02:00
nicolargo c8ed977c9d Add a test script for identify CPU consumption of sensor plugin 2025-10-23 11:47:54 +02:00
nicolargo 1ac760c55b Refactor port to take into account netifaces2 2025-10-23 11:43:22 +02:00
nicolargo c2e038d244 Optimize LRU caching for API requests with plugins list (ex: Homepage plugin) 2025-10-23 11:30:03 +02:00
nicolargo 02fe3aa12e Merge branch 'issue1553' into develop 2025-10-23 10:33:12 +02:00
nicolargo f3a76caa64 Show long command line with arrow key #1553 2025-10-23 10:33:01 +02:00
Nicolas Hennion 729532713f Quick and dirty patch for discussion - Last dev build broke Homepage API calls ? only 1 widget still working #3322 2025-10-20 13:21:18 +00:00
nicolargo 2b1d6f4309 Update memory profiling file 2025-10-19 17:47:16 +02:00
nicolargo 6dd33e3317 Correct issue with Chrome driver in WebUI unit test 2025-10-19 17:28:00 +02:00
nicolargo 1114a9ab87 Merge branch 'issue3033' into develop 2025-10-19 17:19:53 +02:00
nicolargo 4361df8f84 Do not call update if a call is done to a specific plugin through the API #3033 2025-10-19 17:19:34 +02:00
nicolargo 1bc8df0a13 Patch api to make fetch compliant with Windows 2025-10-18 16:12:02 +02:00
nicolargo 1b93758b65 [UI] Process virtual memory display can be disable by configuration #3299 2025-10-18 16:03:23 +02:00
nicolargo 8fa0677538 Update .pre-commit-config.yaml file #3300 2025-10-18 14:25:33 +02:00
nicolargo 074a01efc2 Update .pre-commit-config.yaml file #3300 2025-10-18 14:17:37 +02:00
nicolargo 227dedb41b Try to use Python 3.14 in the CI 2025-10-18 14:00:18 +02:00
nicolargo bcd48844b5 Support for Python 14 #3319 2025-10-18 13:51:15 +02:00
nicolargo f01008f430 Support for Python 14 #3319 2025-10-18 12:03:18 +02:00
nicolargo a41a67edf7 Cloud plugin always generate communication with 169.254.169.254, even if the plugin is disabled #3316 2025-10-18 10:52:18 +02:00
nicolargo 6fc887839e Cloud plugin always generate communication with 169.254.169.254, even if the plugin is disabled #3316 2025-10-18 09:38:17 +02:00
nicolargo 8c70a55488 API response delay (3+ minutes) when VMs are running due to 'virsh domstats' – Suggest adding '--nowait' option #3317 2025-10-18 09:30:55 +02:00
nicolargo 8a748d15e3 Upgrade export test with InfluxDB 1.12 2025-10-18 09:25:39 +02:00
nicolargo bcfb3675a6 Update dep 2025-10-18 09:06:24 +02:00
nicolargo e3b016e6f3 Update dep and change Fetch screenshot for documentation 2025-10-18 08:59:21 +02:00
Nicolas Hennion a64474f43f
Merge pull request #3314 from syohex/typo-option-document
Fix typo of --export-process-filter help message
2025-10-14 07:48:07 +02:00
Shohei YOSHIDA c2b59d0a74
Fix typo of --export-process-filter help message 2025-10-14 12:08:21 +09:00
Nicolas Hennion d6a820d2bb Remove unused lib 2025-10-13 11:54:33 +00:00
Nicolas Hennion ee50f4e8e2 In the outdated feature, catch error message is Pypi server not reachable 2025-10-13 11:49:19 +00:00
Nicolas Hennion eead34b0d0 Glances do not display CPU stat correctly #3155 2025-10-13 11:43:32 +00:00
Nicolas Hennion 29e3947577 Revert "[WINDOWS] Glances do not display CPU stat correctly #3155"
This reverts commit bb0116a198.
2025-10-13 11:38:17 +00:00
Nicolas Hennion bb0116a198 [WINDOWS] Glances do not display CPU stat correctly #3155 2025-10-13 11:11:53 +00:00
Nicolas Hennion 349c33fd27 Refactor Fetch template 2025-10-13 09:28:21 +00:00
Nicolas Hennion 52c5042e37 Add --no-emit-workspace in the Makefile 2025-10-13 09:25:31 +00:00
Nicolas Hennion 853b71998c Add --no-emit-workspace to the requirements exports tasks 2025-10-13 09:22:32 +00:00
nicolargo 03d4d6cf65 Add TOML conf file to Docker in order to build 2025-10-12 18:33:24 +02:00
nicolargo d02aed76a6 Remove hashes from requirements file because it causes some issue in Gitlab pipeline (with pip) 2025-10-12 17:24:04 +02:00
nicolargo 97ec09dfc3 Correct an issue when Netifaces is not installed on the system 2025-10-12 17:05:19 +02:00
nicolargo 0c2b9e5e8e Requirements files are now generated dynamically with the make requirements or requirements-upgrade target 2025-10-12 17:00:46 +02:00
nicolargo 0134487f5e Merge branch 'issue3025-uv' into develop 2025-10-12 15:20:34 +02:00
nicolargo f1328a84e9 Use uv instead of venv in Makefile #3304 2025-10-12 15:19:32 +02:00
Nicolas Hennion 547d98599a
Update README.rst 2025-10-10 11:59:59 +02:00
Nicolas Hennion 031d5d6485
Update README.rst 2025-10-08 18:09:40 +02:00
Nicolas Hennion 62c6c9df4e
Update README.rst
Add Brew as a standard installation method.
2025-10-07 09:47:39 +02:00
Nicolas Hennion 6302389073
Update find-duplicate-lines.sh
Make the code return an error code if a file ended with a duplicated line is founded.
2025-10-06 14:14:35 +02:00
Nicolas Hennion 83d5886a35
Update __init__.py
Remove dupliate line
2025-10-06 14:06:19 +02:00
nicolargo 350ed125d3 Store nothing is history is not enable. 2025-10-05 17:08:27 +02:00
nicolargo 7382089129 Disable history when history size is set to 0 by configuration. 2025-10-05 17:04:27 +02:00
nicolargo 2254f899b6 Add unit test for Prometheus exporter aand refactor the code to not use the API (not useful in this case because stats instance already exist) 2025-10-04 09:42:00 +02:00
nicolargo d03295a977 Merge branch 'develop' of github.com:nicolargo/glances into develop 2025-09-28 17:03:55 +02:00
nicolargo 9f1eb9496a Add unit test for auto_unit 2025-09-28 17:03:44 +02:00
Nicolas Hennion d28f3056a7
Merge pull request #3287 from nicolargo/renovate/macos-15.x
chore(deps): update dependency macos to v15
2025-09-28 16:40:10 +02:00
Nicolas Hennion e2c65c6687
Merge pull request #3278 from nicolargo/renovate/actions-stale-10.x
chore(deps): update actions/stale action to v10
2025-09-28 16:39:30 +02:00
Nicolas Hennion e721b66488
Merge pull request #3277 from nicolargo/renovate/actions-setup-python-6.x
chore(deps): update actions/setup-python action to v6
2025-09-28 16:39:25 +02:00
Nicolas Hennion 26a0c3ef87
Merge pull request #3276 from nicolargo/renovate/actions-setup-node-5.x
chore(deps): update actions/setup-node action to v5
2025-09-28 16:39:19 +02:00
nicolargo 0bf79775b6 Remove duplicate line at the end of files 2025-09-28 16:28:05 +02:00
nicolargo c970932e96 Set default timeout to 2 second 2025-09-28 16:10:07 +02:00
nicolargo 38c7bfccba Make the issue3290 compliant with non Linux OS 2025-09-28 15:09:19 +02:00
nicolargo 48674ee71f Clean unused decorator 2025-09-28 15:00:37 +02:00
Nicolas Hennion 6539979498
Merge pull request #3291 from nicolargo/issue3290-cleanup
Fix: Glances stalling on broken NFS connections
2025-09-28 14:17:24 +02:00
Nicolas Hennion 3652dc339f chg: plugin(fs) - use timeout wrappers for psutil calls
Why? Broken NFS connections can stall psutil calls indefinitely

Co-authored-by: Raz Crimson <52282402+razcrimson@users.noreply.github.com>
2025-09-28 05:55:56 +05:30
Nicolas Hennion da700c8cfc add: generic timeout wrappers
For use with blocking functions and utilities

Co-authored-by: Raz Crimson <52282402+razcrimson@users.noreply.github.com>
2025-09-28 05:55:34 +05:30
nicolargo 420cf2bdde Lint code 2025-09-27 16:02:48 +02:00
Nicolas Hennion ce27d795db
Merge pull request #3283 from DeepSpace2/fix-prometheus-export-format
Fix prometheus export format
2025-09-27 15:58:41 +02:00
Adi f53dbe748e getting object key dynamically instead of maintaining an hardcoded mapping 2025-09-27 12:34:40 +03:00
nicolargo 3931457495 Merge branch 'issue3288-mem-available' into develop 2025-09-25 22:20:38 +02:00
nicolargo d0137830c2 Choose between used or available in the mem plugin #3288 2025-09-25 22:20:23 +02:00
Nicolas Hennion 48296a5de9
Merge pull request #3289 from bkanuka/issue3979-zfs-cache
Issue #3279 zfs cache and memory math issues
2025-09-25 20:48:49 +02:00
Bennett Kanuka 6339393271 ruff format 2025-09-25 14:03:27 -04:00
Bennett Kanuka 2b59ad71fe fix zfs cache math 2025-09-25 13:49:08 -04:00
nicolargo ff6dcd5cb0 Update documentation 2025-09-25 13:49:06 -04:00
nicolargo b26dac4dd5 ZFS ARC/cache not reported as cache memory usage #3279 2025-09-25 13:48:43 -04:00
renovate[bot] b6db99cbb8
Update dependency macos to v15 2025-09-25 16:35:06 +00:00
renovate[bot] 86e198310d
Update actions/stale action to v10 2025-09-25 16:35:04 +00:00
renovate[bot] 55c3b9c0ab
Update actions/setup-python action to v6 2025-09-25 16:35:01 +00:00
renovate[bot] 9eaef1da36
Update actions/setup-node action to v5 2025-09-25 16:34:58 +00:00
Nicolas Hennion de9d46297c Merge pull request #3286 from jmwallach/patch-1
Label error in docs
2025-09-25 13:59:02 +02:00
jmwallach 36c9658912
Update network.rst
Fix labeling error
2025-09-24 16:40:09 -07:00
Adi afdd09d648 fix bug in construction of metric name 2025-09-23 22:27:33 +03:00
Adi c8e67d07c1 add missing metrics to labels mappings 2025-09-23 18:00:29 +03:00
Adi 63f0aacb7c add missing metrics to labels mappings 2025-09-23 13:19:11 +03:00
Adi 2c1abd666e spliting labels on the first ':' only as a label value might contain ':' 2025-09-23 12:51:54 +03:00
Adi 9834e204c4 fix nonetype is not iterable error 2025-09-23 12:50:37 +03:00
Adi 39c1b9e13c using object as label 2025-09-23 12:47:01 +03:00
nicolargo 6631b37d67 Revert "First version done. Need to be tested and documented."
This reverts commit 17eca1f6e6.
2025-09-21 16:44:28 +02:00
nicolargo 95620bf584 Merge branch 'issue3205-duckdb' into develop 2025-09-21 15:13:03 +02:00
nicolargo fcdd792722 Update docs for DuckDB export 2025-09-21 15:09:28 +02:00
nicolargo 3de48a4f56 First version done. Need to be tested and documented. 2025-09-21 15:08:25 +02:00
nicolargo 17eca1f6e6 First version done. Need to be tested and documented. 2025-09-21 15:08:25 +02:00
nicolargo 3db5f13d8c Correct duplicate line in plugin model 2025-09-21 15:00:59 +02:00
nicolargo 11bab0fb5e Udate readme file 2025-09-21 14:41:34 +02:00
nicolargo ef45c6def2 Merge branch 'issue3281-fetch' into develop 2025-09-21 14:37:35 +02:00
nicolargo 32e17004b6 Update readme file 2025-09-21 14:33:00 +02:00
nicolargo be29f069d6 First release ok, need to add some tests 2025-09-21 10:03:33 +02:00
nicolargo d5d38af356 First version of the (neo)fetch feature for OS 2025-09-20 19:38:33 +02:00
nicolargo 0abc39f7df First rush to make the top menu configurable 2025-09-16 19:05:38 +02:00
nicolargo 8f240afec1 Put WebUI conf generator in a dedicated script 2025-09-14 15:30:55 +02:00
nicolargo 8c8120fb90 Put WebUI conf generator in a dedicated script 2025-09-14 15:30:45 +02:00
nicolargo 54216c6580 Rafactor the Makefile to generate WebUI config file for all webui targets 2025-09-14 14:59:51 +02:00
nicolargo 605f3a9da3 Correct typo in comment 2025-09-14 14:55:49 +02:00
nicolargo 3ad154b4f8 Merge branch 'issue3100' into develop 2025-09-14 14:44:03 +02:00
nicolargo af082ee2e0 Glances not showing Processes on MacOS #3100 2025-09-14 14:43:42 +02:00
Nicolas Hennion ba68e3d8f4
Merge pull request #3275 from timrettop/sensors-docs-alias
Update sensors.rst
2025-08-30 08:49:12 +02:00
Nicolas Hennion 48641b5d1a
Merge pull request #3273 from lawrence-c/patch-1
Update docker compose env quote
2025-08-30 08:48:02 +02:00
Tim Potter fa82d8ed1c
Merge branch 'nicolargo:develop' into sensors-docs-alias 2025-08-28 13:46:57 -05:00
Tim Potter 81a16075bd
Update sensors.rst
Add alias example
2025-08-28 13:43:11 -05:00
Lawrence 05080765cc
Update docker env quote 2025-08-27 21:06:10 +01:00
nicolargo 580af978f4 [MACOS] Glances crashes when I try to filter #3266 2025-08-24 11:40:05 +02:00
nicolargo d99d3684c4 [MACOS] Glances crashes when I try to filter #3266 2025-08-23 18:24:33 +02:00
nicolargo 26a41d0c21 Display hash for Pypi release 2025-08-23 14:55:54 +02:00
nicolargo 435b250a84 Glances 4.4.0-dev2 2025-08-23 14:34:22 +02:00
nicolargo a31b60b1ab Glances crashes when I try to filter #3266 2025-08-23 10:06:23 +02:00
nicolargo cb8003c1df Update API doc generation 2025-08-23 09:52:02 +02:00
nicolargo 973dd8978e Update API docs 2025-08-17 18:34:31 +02:00
nicolargo 06c6f8408e Update README with nice icons #3236 2025-08-17 17:04:13 +02:00
nicolargo 948bc90b58 Merge branch 'develop' of github.com:nicolargo/glances into develop 2025-08-17 16:55:30 +02:00
nicolargo a7683caa71 Update README with nice icons #3236 2025-08-17 16:55:19 +02:00
Nicolas Hennion 3f5c1f478a
Merge pull request #3261 from nicolargo/renovate/major-github-artifact-actions
Update actions/download-artifact action to v5
2025-08-17 16:43:52 +02:00
Nicolas Hennion f65ae16ea2
Merge pull request #3263 from nicolargo/renovate/actions-checkout-5.x
Update actions/checkout action to v5
2025-08-17 16:43:27 +02:00
nicolargo e88f33ca05 Clear-text logging of sensitive information 2025-08-16 10:20:59 +02:00
nicolargo 2a3046796b Glances hang when killing process with muliple CTRL-C #3264 2025-08-15 18:53:03 +02:00
nicolargo 89e9ad1284 Merge branch 'issue1070' into develop 2025-08-13 21:36:09 +02:00
renovate[bot] dbba6e0673
Update actions/checkout action to v5 2025-08-11 18:55:38 +00:00
nicolargo 1daac0e6d0 Add Disk I/O Latency stats #1070 2025-08-10 19:08:02 +02:00
renovate[bot] f173c8d6b4
Update actions/download-artifact action to v5 2025-08-10 13:45:47 +00:00
nicolargo 5f3e1de01e Merge branch 'issue3248' into develop 2025-08-10 15:37:58 +02:00
nicolargo 9a58715a2f Issues after disabling system and processcount plugins #3248 2025-08-10 15:37:46 +02:00
nicolargo afaab7190b Merge branch 'issue3250' into develop 2025-08-10 15:00:42 +02:00
nicolargo c63f2404aa Headers missing from predefined fields in TUI browser machine list - Part 1 #3250 2025-08-03 16:53:51 +02:00
nicolargo ae31d29c75 Remove test in glances.conf 2025-08-01 17:54:51 +02:00
nicolargo 04fee963cc Merge branch 'issue3528' into develop 2025-08-01 17:20:08 +02:00
nicolargo f1ae3bb535 Filter fields to export #3258 2025-08-01 17:19:43 +02:00
nicolargo f5ec34cdf9 Add docuùentation for WebUI test 2025-07-28 17:52:26 +02:00
nicolargo 11890f31b1 Update docs 2025-07-27 16:18:30 +02:00
nicolargo c1c0d4038f Add another check for the famous Netifaces issue - Related to #3219 2025-07-27 15:57:05 +02:00
nicolargo 2cf92f93a9 Add another check for the famous Netifaces issue - Related to #3219 2025-07-27 15:41:15 +02:00
nicolargo 89118e53de Key error 'type' in server_list_static.py (load_server_list) #3247 2025-07-26 17:08:03 +02:00
Nicolas Hennion 1e8ea943ba
Merge pull request #3249 from korn3r/patch-1
Update docker-compose.yml
2025-07-26 16:41:24 +02:00
Nicolas Hennion 6ffcaf4a94
Merge pull request #3253 from Boris-Okassa/Dictkeys
remove `.keys()` from loops over dicts
2025-07-26 16:40:41 +02:00
Nicolas Hennion cba28407cb
Merge pull request #3252 from ariel-anieli/fix-python2-iterators
Remove iterator helpers
2025-07-26 16:39:08 +02:00
Boris Okassa 463d0af666 remove .keys() from loops over dicts
By default dict loops use keys.

Signed-off-by: Boris Okassa <borisokassa@yahoo.fr>
2025-07-23 23:16:20 +02:00
Ariel Otilibili 3eb09d7fc5
Remove iterator helpers
Related to #3181.

Co-authored-by: Jatin Singh <fithacker97@gmail.com>
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-22 23:46:39 +02:00
korn3r 202289599d
Update docker-compose.yml
added commented out by default mount point for /etc/os-release. without it Glances container shows distibution information from container itself and not host system.
2025-07-21 02:05:09 +03:00
nicolargo 3a1e188d58 Merge branch 'issue3237_GlancesAPI' into develop 2025-07-12 18:17:21 +02:00
nicolargo 3d263bc7d4 Create a Glances API in order to use Glances as a Python lib #3237 2025-07-12 18:16:43 +02:00
nicolargo 365a670c12 Processlist ok 2025-07-09 17:40:08 +02:00
nicolargo 660b94e99d First version of the API 2025-07-09 17:40:08 +02:00
nicolargo 65393b0771 First version of the API 2025-07-09 17:40:08 +02:00
nicolargo 45c3c489a0 On the road of Glances 4.4.0 (after 4.3.3) 2025-07-09 17:37:24 +02:00
nicolargo 73a01d4c52 version 4.3.3 2025-07-09 17:35:33 +02:00
nicolargo 218831ecb9 Align glances.conf file 2025-07-09 17:28:19 +02:00
nicolargo e3bbd0dc2a Something in 4.3.2 broke the home assistant add-on for Glances #3238 2025-07-09 17:26:54 +02:00
nicolargo b340b5fc30 Something in 4.3.2 broke the home assistant add-on for Glances #3238 2025-07-07 07:41:25 +02:00
nicolargo fca11995cb Revert "Something in 4.3.2 broke the home assistant add-on for Glances - Try 1 #3238"
This reverts commit 76b070f3de.
2025-07-06 22:47:52 +02:00
nicolargo 76b070f3de Something in 4.3.2 broke the home assistant add-on for Glances - Try 1 #3238 2025-07-06 22:06:56 +02:00
nicolargo 5b2b7325fc Update README 2025-07-05 18:17:18 +02:00
nicolargo 94ae566eb7 On the orad of Glances 4.4.0 2025-07-05 17:58:24 +02:00
nicolargo a9c3770851 On the orad of Glances 4.4.0 2025-07-05 17:57:05 +02:00
nicolargo 4c31611f2f version 4.3.2 - Update Snap 2025-07-05 10:44:29 +02:00
nicolargo e46a38f141 version 4.3.2 2025-07-05 10:43:46 +02:00
nicolargo c6a48bf424 Update docs and correct an issue with UTC import 2025-07-05 10:32:11 +02:00
nicolargo bf2c6d1bda Add unit test for time zone in history 2025-07-05 10:32:11 +02:00
nicolargo 455888e0fa API history endpoints shows times without timezone #3218 2025-07-05 10:32:11 +02:00
nicolargo 0db81b71c6 Correct a crash in client/server mode 2025-07-05 10:32:11 +02:00
nicolargo c1d67556c7 Make --stdout (csv and json) compliant with client/server mode #3235 2025-07-05 10:32:11 +02:00
nicolargo e46eb765ff Update documentation lint 2025-07-05 10:32:11 +02:00
nicolargo 82a829d0c4 Update documentation 2025-07-05 10:32:11 +02:00
nicolargo 155452e223 Glances 4.3.2_rc01 2025-07-05 10:32:11 +02:00
nicolargo 15a94f04da Improve Restful API documentation embeded in FastAPI #2632 2025-07-05 10:32:11 +02:00
nicolargo 813785ff82 Change the way Docker start Glances 2025-07-05 10:32:11 +02:00
nicolargo 28e82eb237 Lint Dockerfile 2025-07-05 10:32:11 +02:00
nicolargo 1268b58bbc Glances breaks if Podman container is started while it is running #3199 2025-07-05 10:32:11 +02:00
nicolargo 1434d3ad5c Avoid none in rate computation 2025-07-05 10:32:11 +02:00
nicolargo 28ae053e4b Glances Central Browser should use name instead of IP adress for redirection #3103 2025-07-05 10:32:11 +02:00
nicolargo cd71b45089 Add container inactive_file & limit to InfluxDB2 export #3206 2025-07-05 10:32:11 +02:00
nicolargo 1365d600a3 (postgre)SQL export support / TimeScaleDB #2814 2025-07-05 10:32:11 +02:00
nicolargo 7c13ae17fa Implement a basic memory cache with TTL for API call (set to ~1 second) #3202 2025-07-05 10:32:11 +02:00
nicolargo b888dc55e8 Correct key() by keys() 2025-07-05 10:32:11 +02:00
Boris Okassa ed2e1cdefb exports: outputs: Removed iterator helpers
Related to #3181
Signed-off-by: Boris Okassa <borisokassa@yahoo.fr>
2025-07-05 10:32:11 +02:00
renovate[bot] 505a90f8da fix(deps): update dependency pysnmp-lextudio to <6.3.1 2025-07-05 10:32:11 +02:00
snyk-bot cac2e0b884 fix: dev-requirements.txt to reduce vulnerabilities
The following vulnerabilities are fixed by pinning transitive dependencies:
- https://snyk.io/vuln/SNYK-PYTHON-H11-10293728
2025-07-05 10:32:11 +02:00
snyk-bot df93b5bf4c fix: optional-requirements.txt to reduce vulnerabilities
The following vulnerabilities are fixed by pinning transitive dependencies:
- https://snyk.io/vuln/SNYK-PYTHON-NUMPY-2321964
- https://snyk.io/vuln/SNYK-PYTHON-NUMPY-2321966
- https://snyk.io/vuln/SNYK-PYTHON-NUMPY-2321970
- https://snyk.io/vuln/SNYK-PYTHON-PYARROW-6052811
- https://snyk.io/vuln/SNYK-PYTHON-SETUPTOOLS-3180412
- https://snyk.io/vuln/SNYK-PYTHON-SETUPTOOLS-7448482
- https://snyk.io/vuln/SNYK-PYTHON-SETUPTOOLS-9964606
- https://snyk.io/vuln/SNYK-PYTHON-URLLIB3-7267250
2025-07-05 10:32:11 +02:00
nicolargo e277908118 Commit issue following #3186 - glances.js not found 2025-07-05 10:32:11 +02:00
fr4nc0is ea12008e10 Update plugin containers display and order #3186 2025-07-05 10:32:11 +02:00
ia74 bcf3d42097 Change "Pinned thread" to "Pinned task" and "Upin" to "Unpin" 2025-07-05 10:32:11 +02:00
Ariel Otilibili 0ffb08dd2a glances: Refactor _build_amps_list
Used a list comprehension. Moreover None and empty list are considered
as false values in Python.

Part-of: #2801
Link: https://docs.python.org/3/library/stdtypes.html#truth-value-testing
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-05 10:32:11 +02:00
Ariel Otilibili 75b7998185 glances: amps: remove iterator helpers
No more needed in Python 3.

Moreover in update(), the keys are not used: the call to items() is
replaced with values().

Related to #3181
2025-07-05 10:32:11 +02:00
nicolargo f45900b450 Add test for JSON export 2025-07-05 10:32:11 +02:00
nicolargo 96660cae16 Add Star history to Readme file 2025-07-05 10:32:11 +02:00
nicolargo 83a5847ff1 Add Star history to Readme file 2025-07-05 10:32:11 +02:00
renovate[bot] 51166fe1df chore(deps): update alpine docker tag to v3.22 2025-07-05 10:32:11 +02:00
Ariel Otilibili 1375573a46 glances: remove iterator helpers
No more needed in Python 3. Following commit 72e1511d ("globals: Fix a
race condition in namedtuple_to_dict"), the dynamic view on the keys is
as well transformed into a list.

Related to #3181
2025-07-05 10:32:11 +02:00
Ariel Otilibili 239d5f7db6 glances: Refactor
Instead of a loop, used a generator for the search.

Part-of: #2801
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-05 10:32:11 +02:00
Ariel Otilibili 81150246e5 glances: remove iterator helpers
No more needed in Python 3.

Related to #3181
2025-07-05 10:32:11 +02:00
Ariel Otilibili 39ac435218 plugins: containers: Refactor update()
Commit 445d20dc ("plugins: containers: Refactor") changed update() so
that, stats are added if any of is_key_in_container_and_not_hidden()
or is_key_absent_in_container() is true.

This could be replaced by the negation of is_key_in_container_and_hidden()

Part-of: #2801
Suggested-by: Jasmin Blackshaw <105jassen@gmail.com>
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-05 10:32:11 +02:00
Ariel Otilibili 016799cbfa outputs: glances_curses: Refactor
In catch_other_actions_maybe_return_to_browser(), replaced if-statements
by a dict. If no key is found, a null function is executed.

Part-of: #2801
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-05 10:32:11 +02:00
nicolargo 719094edf7 Update Glances dev version 2025-07-05 10:32:11 +02:00
nicolargo c343351072 Update Glances dev version 2025-07-05 10:32:11 +02:00
nicolargo d79c74df25 Update Glances dev version 2025-07-05 10:32:11 +02:00
Ariel Otilibili 3488760ae5 globals: Fix a race condition in namedtuple_to_dict
namedtuple_to_dict() loops over a dynamic view of the dict of processes;
other threads might be editing the same dict.

For instance in webserver mode, when a race condition happens, the
following error shows up in the console:

>   File "C:\Users\ryabtsev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\glances\processes.py", line 628, in update_list
>     return list_of_namedtuple_to_list_of_dict(processlist)
>   File "C:\Users\ryabtsev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\glances\globals.py", line 495, in list_of_namedtuple_to_list_of_dict
>     return [namedtuple_to_dict(d) for d in data]
>             ^^^^^^^^^^^^^^^^^^^^^
>   File "/app/glances/globals.py", line 490, in namedtuple_to_dict
>     return {k: (v._asdict() if hasattr(v, '_asdict') else v) for k, v in data.items()}
>                                                                          ^^^^^^^^^^^^
> RuntimeError: dictionary changed size during iteration

Instead of a dict view, namedtuple_to_dict() will use a list of tuples.

Performances are unchanged: on average, for 100 runs, namedtuple_to_dict()
completes in 0.2ms

GH issue: #3097
Link: https://docs.python.org/3/library/stdtypes.html#dictionary-view-objects
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-05 10:32:11 +02:00
nicolargo 7c0dee3a63 Add support for InfluxDB 3 Core #3182 2025-07-05 10:32:11 +02:00
Ariel Otilibili a5b2a97e6c podman: remove iterator helpers
No more needed in Python 3.

Related to #3181
2025-07-05 10:32:11 +02:00
Ariel Otilibili b57b26e1b5 docker: remove iterator helpers
No more needed in Python 3.

Related to #3181
2025-07-05 10:32:11 +02:00
nicolargo 31834a366f Related to iteritems, itervalues, and iterkeys are not more needed in Python 3 #3181 2025-07-05 10:32:11 +02:00
nicolargo aea1b67862 Related to iteritems, itervalues, and iterkeys are not more needed in Python 3 #3181 2025-07-05 10:32:11 +02:00
nicolargo e28bf6496f Add a new field in the process list to identifie Zombie process #3178 2025-07-05 10:32:11 +02:00
Ariel Otilibili a78e778b36 plugins: containers: Refactor
1. update()
Two branches share the same logic for updating stats. Moreover, intermediate
values where used in nested loops: for filtering keys, and for extending stats.

This could be done at once with chain.from_iterable().

Therefore four helpers are introduced:
- add_engine_into_container
- is_key_in_container_and_not_hidden
- is_key_absent_in_container
- get_containers_from_updated_watcher

A profiling shows the stats build time is the same after the refactor,

$ sudo make run-webserver 2>&1 | grep primitive
         31631 function calls (31566 primitive calls) in 0.028 seconds
         23537 function calls (23487 primitive calls) in 0.025 seconds
         23559 function calls (23509 primitive calls) in 0.014 seconds
         23549 function calls (23499 primitive calls) in 0.024 seconds
         23549 function calls (23499 primitive calls) in 0.026 seconds
         23559 function calls (23509 primitive calls) in 0.016 seconds
         23559 function calls (23509 primitive calls) in 0.022 seconds
         23544 function calls (23494 primitive calls) in 0.015 seconds
         23549 function calls (23499 primitive calls) in 0.023 seconds
         23544 function calls (23494 primitive calls) in 0.018 seconds

[snapshot of top three calls]
         31881 function calls (31816 primitive calls) in 0.029 seconds

   Ordered by: cumulative time
   List reduced from 536 to 3 due to restriction <3>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        3    0.000    0.000    0.029    0.010 __init__.py:250(<genexpr>)
        2    0.000    0.000    0.029    0.015 __init__.py:242(get_containers_from_updated_watcher)
        1    0.000    0.000    0.029    0.029 docker.py:248(update)

And before,

$ sudo make run-webserver 2>&1 | grep primitive
         31620 function calls (31555 primitive calls) in 0.021 seconds
         23526 function calls (23476 primitive calls) in 0.019 seconds
         23533 function calls (23483 primitive calls) in 0.024 seconds
         23538 function calls (23488 primitive calls) in 0.015 seconds
         23528 function calls (23478 primitive calls) in 0.023 seconds
         23528 function calls (23478 primitive calls) in 0.022 seconds
         23533 function calls (23483 primitive calls) in 0.016 seconds
         23538 function calls (23488 primitive calls) in 0.025 seconds
         23538 function calls (23488 primitive calls) in 0.029 seconds
         23538 function calls (23488 primitive calls) in 0.013 seconds

[snapshot of top three calls]
         31865 function calls (31800 primitive calls) in 0.024 seconds

   Ordered by: cumulative time
   List reduced from 531 to 3 due to restriction <3>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.024    0.024 docker.py:248(update)
       13    0.000    0.000    0.022    0.002 decorators.py:38(inner)
       13    0.000    0.000    0.022    0.002 client.py:244(_get)

2. msg_curse()
The conditions are directly used in any().

3. exit()
Minimum supported version is Python 3.9; loops use iterators by default.

itervalues() was introduced for compatility with Python 2. Commit 76ea71f2
("Remove Python 2 in docs and README files") removed Python 2 support.

Part-of: #2801
Link: https://docs.python.org/3/library/itertools.html#itertools.chain.from_iterable
Link: https://docs.python.org/3/library/profile.html#profile.Profile
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-05 10:32:11 +02:00
Ariel Otilibili 91902f0ffa plugins: containers: Refactor build_container_data
All the if-statements do the same actions:
- check the key is not disabled
- and add the corresponding callback to the building steps.

There could be done with a list comprehension on a dict.

Part-of: #2801
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-05 10:32:11 +02:00
Ariel Otilibili f747bdfa73 containers: Fix sorting
sort_keys() uses sort_by_these_keys() on the stats. So doing, one of the
retrieved values might be absent; and sort_keys() will fall back to the
default sorting method, which is the alphabetical order.

This is the case for dead or exited containers.

Instead of a key lookup, the get method of dict could be used.

GH issue: #3098
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-05 10:32:11 +02:00
Ariel Otilibili e4cdc14cd0 containers: processes: Refactor
Refactored sort_docker_stats() and sort_stats().

Useful for an upcoming commit.

Part-of: #2801
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-05 10:32:11 +02:00
nicolargo dc165930b4 Refactor code to limit the complexity of update_views method in plugins #3171 2025-07-05 10:32:11 +02:00
nicolargo 03f23a582d Code refactoring - Rename plugin class to <Plugin name>Plugin instead of PluginModel #3169 2025-07-05 10:32:11 +02:00
Ariel Otilibili 1e92365c5e plugins: connections: refactor, version 2
Extracted update_with_net_connections_method and
update_with_nf_conntrack_method from update.

Part-of: #2801
Link: https://scrutinizer-ci.com/g/nicolargo/glances/code-structure/develop/py-function/glances.plugins.connections.PluginModel.update
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-05 10:32:11 +02:00
Nicolas Hennion a3e55145b8 Revert "plugins: connections: refactor" 2025-07-05 10:32:11 +02:00
Ariel Otilibili 72a1466e9f plugins: connections: refactor
Extracted update_with_net_connections_method and
update_with_nf_conntrack_method from update.

Part-of: #2801
Link: https://scrutinizer-ci.com/g/nicolargo/glances/code-structure/develop/py-function/glances.plugins.connections.PluginModel.update
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-05 10:32:11 +02:00
nguuuquaaa c612899612 fix display checking logic 2025-07-05 10:32:11 +02:00
nguuuquaaa b86b201e6a fix broken matching when fs config has show value 2025-07-05 10:32:11 +02:00
nguuuquaaa c59931cb80 fix broken implementation of plugin.is_display/is_hide/is_show 2025-07-05 10:32:11 +02:00
nicolargo bfda524b4e [WEBUI] Irix mode (per core instead of per CPU percentage) not togglable #3158 2025-07-05 10:32:11 +02:00
nicolargo 0bbb20a127 Done bu display 0 on the WebUI CPU column in IRIS mode... Why ??? 2025-07-05 10:32:11 +02:00
Ariel Otilibili 54e57317be plugins: mem: reduce code complexity
Part of #2801.

Link: https://scrutinizer-ci.com/g/nicolargo/glances/code-structure/develop/py-function/glances.plugins.mem.PluginModel.update
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-05 10:32:11 +02:00
wuhgit c473060740 Revision of confusing descriptions in the SMART section of the document 2025-07-05 10:32:11 +02:00
nicolargo 4e8b1f5508 Correct an issue with VMs bin test 2025-07-05 10:32:11 +02:00
nicolargo 82e59dbfda Add stats about running VMS (qemu/libvirt/kvm support through virsh) #1531 2025-07-05 10:32:11 +02:00
nicolargo fb81a2a5f7 Add stats about running VMS (qemu/libvirt/kvm support through virsh) #1531 2025-07-05 10:32:11 +02:00
Nicolas Hennion 50c440f739 Update faq.rst 2025-07-05 10:32:11 +02:00
Nicolas Hennion 9db02dc7ec Update faq.rst 2025-07-05 10:32:11 +02:00
Nicolas Hennion ae5eb61307 Container memory stats not displayed #3142 2025-07-05 10:32:11 +02:00
Tyler Kerr 080be4d845 strip unsupported line endings from password file 2025-07-05 10:32:11 +02:00
renovate[bot] c738f482e9 Update docker/build-push-action action to v6 2025-07-05 10:32:11 +02:00
nicolargo a550afbd25 Take into account @amard33p comment - https://github.com/nicolargo/glances/issues/2394#issuecomment-2794522951 2025-07-05 10:32:11 +02:00
nicolargo 941baba5b4 Improve unittest for CSV export #3150 2025-07-05 10:32:11 +02:00
nicolargo 91c132fe08 Remove quicklook from the exportable list 2025-07-05 10:32:11 +02:00
nicolargo 009212a04d Do not store data during InfluxDB test 2025-07-05 10:32:11 +02:00
nicolargo 43626d9d69 Improve unittest for InfluxDB plugin #3149 2025-07-05 10:32:11 +02:00
nicolargo ec8365817f Improve unittest for InfluxDB plugin #3149 2025-07-05 10:32:11 +02:00
nicolargo bdef92da4f Correct NoneType in update_view method 2025-07-05 10:32:11 +02:00
renovate[bot] 16dee18c52 chore(deps): update actions/stale action to v9 2025-07-05 10:32:11 +02:00
renovate[bot] d2de1424fb Update dependency windows to v2025 2025-07-05 10:32:10 +02:00
renovate[bot] daf6964f14 Update dependency ubuntu to v24 2025-07-05 10:32:10 +02:00
nicolargo cfc34e7cd4 Upgrade JS libs #3147 2025-07-05 10:32:10 +02:00
nicolargo 0d2f5e4ba3 Commit before lint 2025-07-05 10:32:10 +02:00
nicolargo 7de582fdb0 Update precommit hook 2025-07-05 10:32:10 +02:00
nicolargo 1378eb80ba Correct README file 2025-07-05 10:32:10 +02:00
nicolargo fe59850c28 Make the shtab optional 2025-07-05 10:32:10 +02:00
nicolargo 558ebbaec7 Add a new option --print-completion to generate shell tab completion - #3111 2025-07-05 10:32:10 +02:00
nicolargo 9e2504b056 Update documentation 2025-07-05 10:32:10 +02:00
nicolargo b4d5de96fc Add shtab as a dependency 2025-07-05 10:32:10 +02:00
nicolargo 0e181d9059 In the FS module, do not display threshold for volume mounted in 'ro' (read-only) #3143 2025-07-05 10:32:10 +02:00
kenrmayfield 25b550834a Update README.rst
Update Line: 
Glances Binary Package Versions per System Architecture for FreeBSD as of: 08 Mar 2025 04:05:21

Changed to:
Glances Binary Package Versions and Python Versions( pyXY-glances) per System Architecture for FreeBSD as of: 08 Mar 2025 04:05:21
2025-07-05 10:32:10 +02:00
kenrmayfield b30a29897e Update README.rst
Remove CHECK Link.  Not working correctly.  Need to wait until Main Repository has been Updated.  Then I can make a Link to the FreeBSD Glances Binary Package Version Picture.
2025-07-05 10:32:10 +02:00
kenrmayfield 451b1a2294 Update README.rst
Updated CHECK Link again due to Error in Syntax
2025-07-05 10:32:10 +02:00
kenrmayfield b23a4f6a3d Update README.rst
Updated CHECK Link for Python Version corresponding to Glances Binary Package
2025-07-05 10:32:10 +02:00
kenrmayfield 415abe2284 Update README.rst
Capitalize the words eye and system in the Title to Eye and System
2025-07-05 10:32:10 +02:00
kenrmayfield 7f5f2fd2b1 Update README.rst
Changed spelling of ports to Ports
2025-07-05 10:32:10 +02:00
kenrmayfield 49aa4e21ab Update README.rst
Bold the word NOTE
2025-07-05 10:32:10 +02:00
kenrmayfield 11a1aa6250 Update README.rst
Update FreeBSD Instructions
1. Add Glances Binary Package Versions Picture
2. Update Install
3. Add Note to Check Glances Binary Package Version with System 
    Architecture that corresponds to Python Version.
4.  Add Link to Glances Binary Package Versions Picture called 
     CHECK
2025-07-05 10:32:10 +02:00
nicolargo a1eb6cbacf [GPU] AMD Plugin: Operation not permitted #3125 2025-07-05 10:32:10 +02:00
nicolargo 343c933e15 FR: Sort Sensors my name in proper number order #3132 2025-07-05 10:32:10 +02:00
nicolargo e8b6fd7641 [Discussion] FreeBSD - AMD64 Install: Package py39-glances not showing a Version Available for AMD64 but for Package py311-glances #3139 2025-07-05 10:32:10 +02:00
Ariel Otilibili 5d4596ed41 glances: refactor start()
Part of #2801: start() is split into start_main_loop(),
check_memleak(), setup_server_mode(), & maybe_trace_memleak().

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-07-05 10:32:10 +02:00
nicolargo 0d542550a4 Update docs and correct an issue with UTC import 2025-07-05 10:19:59 +02:00
nicolargo ba67e55a0f Add unit test for time zone in history 2025-07-05 09:57:54 +02:00
nicolargo 4cf6cf8ac2 API history endpoints shows times without timezone #3218 2025-07-05 09:38:02 +02:00
nicolargo 3eb67a32bb Correct a crash in client/server mode 2025-07-05 09:18:59 +02:00
nicolargo fe48f7df94 Make --stdout (csv and json) compliant with client/server mode #3235 2025-07-05 08:17:58 +02:00
nicolargo ca65324976 Update documentation lint 2025-06-30 08:06:25 +02:00
nicolargo d563c68b4c Update documentation 2025-06-30 08:04:14 +02:00
nicolargo d978d545ed Glances 4.3.2_rc01 2025-06-29 17:33:31 +02:00
nicolargo 4f743287b6 Merge branch 'issue2632' into develop 2025-06-29 14:33:25 +02:00
nicolargo 12eecf47f6 Improve Restful API documentation embeded in FastAPI #2632 2025-06-29 14:32:58 +02:00
nicolargo 7b8724244a Change the way Docker start Glances 2025-06-29 13:40:52 +02:00
nicolargo fcbad49771 Lint Dockerfile 2025-06-29 13:22:35 +02:00
nicolargo 4b15e6693c Glances breaks if Podman container is started while it is running #3199 2025-06-29 11:00:28 +02:00
nicolargo 6db3672c50 Avoid none in rate computation 2025-06-28 20:14:12 +02:00
nicolargo b56b231ad8 Glances Central Browser should use name instead of IP adress for redirection #3103 2025-06-28 16:10:34 +02:00
nicolargo eec89ccd90 Merge branch 'issue3206' into develop 2025-06-22 22:17:22 +02:00
nicolargo 95ff4506d1 Add container inactive_file & limit to InfluxDB2 export #3206 2025-06-22 22:17:02 +02:00
nicolargo 4e5eff834a Merge branch 'issue2814-TimeScaleDB' into develop 2025-06-22 18:26:43 +02:00
nicolargo 4f03be737b (postgre)SQL export support / TimeScaleDB #2814 2025-06-22 18:26:00 +02:00
nicolargo f799911058 Merge branch 'issue3202' into develop 2025-06-14 10:47:23 +02:00
nicolargo 0dbd4c58d4 Implement a basic memory cache with TTL for API call (set to ~1 second) #3202 2025-06-14 10:47:00 +02:00
nicolargo ecb3e6e0ea Correct key() by keys() 2025-06-10 19:24:42 +02:00
Boris Okassa 4ef03ddac2 exports: outputs: Removed iterator helpers
Related to #3181
Signed-off-by: Boris Okassa <borisokassa@yahoo.fr>
2025-06-10 00:13:05 +02:00
Nicolas Hennion ed400246fd
Merge pull request #3107 from nicolargo/renovate/pysnmp-lextudio-6.x
fix(deps): update dependency pysnmp-lextudio to <6.3.1
2025-06-09 13:10:57 +02:00
Nicolas Hennion efa636b7a7
Merge pull request #3195 from nicolargo/snyk-fix-b29587102aaf5d35b3590a9d7407596b
[Snyk] Security upgrade h11 from 0.14.0 to 0.16.0
2025-06-08 09:44:46 +02:00
Nicolas Hennion a3556a4004
Merge pull request #3184 from nicolargo/snyk-fix-7fbd5db6108cdc150d044d238786b513
[Snyk] Fix for 8 vulnerabilities
2025-06-08 09:44:23 +02:00
nicolargo 4dd312229f Commit issue following #3186 - glances.js not found 2025-06-08 09:40:46 +02:00
snyk-bot 36e0b46903
fix: dev-requirements.txt to reduce vulnerabilities
The following vulnerabilities are fixed by pinning transitive dependencies:
- https://snyk.io/vuln/SNYK-PYTHON-H11-10293728
2025-06-08 07:34:24 +00:00
Nicolas Hennion b31aa7234e
Merge pull request #3192 from fr4nc0is/FIX-3186
Update plugin containers display and order #3186
2025-06-08 09:31:38 +02:00
Nicolas Hennion f854ea31d8
Merge pull request #3191 from ia74/patch-1
Change "Pinned thread" to "Pinned task" and "Upin" to "Unpin"
2025-06-08 09:30:41 +02:00
Nicolas Hennion 1f8e63ec3d
Merge pull request #3190 from ariel-anieli/issue-3181
glances: amps: Removal of iterator helpers, refactor
2025-06-08 09:30:07 +02:00
fr4nc0is 0e288cdc97 Update plugin containers display and order #3186 2025-06-03 09:18:14 +02:00
ia74 6ed7bee526
Change "Pinned thread" to "Pinned task" and "Upin" to "Unpin" 2025-06-02 16:23:22 -05:00
Ariel Otilibili 5a661a295c
glances: Refactor _build_amps_list
Used a list comprehension. Moreover None and empty list are considered
as false values in Python.

Part-of: #2801
Link: https://docs.python.org/3/library/stdtypes.html#truth-value-testing
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-06-02 14:20:22 +02:00
Ariel Otilibili 9e29d8aa45
glances: amps: remove iterator helpers
No more needed in Python 3.

Moreover in update(), the keys are not used: the call to items() is
replaced with values().

Related to #3181
2025-06-02 14:20:13 +02:00
nicolargo a6de55bfca Add test for JSON export 2025-06-01 17:37:21 +02:00
nicolargo fe5edd6e60 Add Star history to Readme file 2025-05-31 15:31:18 +02:00
nicolargo 71c1c34ddd Add Star history to Readme file 2025-05-31 15:28:17 +02:00
Nicolas Hennion eff75ebeed
Merge pull request #3189 from nicolargo/renovate/alpine-3.x
chore(deps): update alpine docker tag to v3.22
2025-05-31 14:44:31 +02:00
Nicolas Hennion 07daacd35f
Merge pull request #3187 from ariel-anieli/issue-3181-processes-client-snmp
glances: removal of iterators helpers in `processes.py` & `stats_client_snmp.py`
2025-05-31 14:44:01 +02:00
Nicolas Hennion 7440f6df9b
Merge pull request #3188 from ariel-anieli/issue-2801-glances-curses
outputs: containers: Refactor
2025-05-31 14:43:45 +02:00
Ariel Otilibili d6802b77d7
plugins: containers: Refactor update()
Commit 445d20dc ("plugins: containers: Refactor") changed update() so
that, stats are added if any of is_key_in_container_and_not_hidden()
or is_key_absent_in_container() is true.

This could be replaced by the negation of is_key_in_container_and_hidden()

Part-of: #2801
Suggested-by: Jasmin Blackshaw <105jassen@gmail.com>
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-05-31 13:46:44 +02:00
renovate[bot] 3462a48081
chore(deps): update alpine docker tag to v3.22 2025-05-30 22:02:58 +00:00
Ariel Otilibili c5acae327b
outputs: glances_curses: Refactor
In catch_other_actions_maybe_return_to_browser(), replaced if-statements
by a dict. If no key is found, a null function is executed.

Part-of: #2801
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-05-30 14:12:11 +02:00
Ariel Otilibili 73663ef5c7
glances: remove iterator helpers
No more needed in Python 3. Following commit 72e1511d ("globals: Fix a
race condition in namedtuple_to_dict"), the dynamic view on the keys is
as well transformed into a list.

Related to #3181
2025-05-29 13:59:09 +02:00
Ariel Otilibili 003ba392c0
glances: Refactor
Instead of a loop, used a generator for the search.

Part-of: #2801
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-05-29 13:59:09 +02:00
Ariel Otilibili b28d793d72
glances: remove iterator helpers
No more needed in Python 3.

Related to #3181
2025-05-29 13:39:51 +02:00
nicolargo 1c6485fda6 Update Glances dev version 2025-05-28 10:01:16 +02:00
nicolargo 649562ca37 Update Glances dev version 2025-05-28 09:54:07 +02:00
nicolargo 17e43c1271 Update Glances dev version 2025-05-28 09:39:25 +02:00
Nicolas Hennion c1a772d7f1
Merge pull request #3185 from ariel-anieli/issue-3097-dict-changed-size-runtime-error
globals: Fix a race condition in `namedtuple_to_dict`
2025-05-27 17:32:55 +02:00
Ariel Otilibili 72e1511dc4
globals: Fix a race condition in namedtuple_to_dict
namedtuple_to_dict() loops over a dynamic view of the dict of processes;
other threads might be editing the same dict.

For instance in webserver mode, when a race condition happens, the
following error shows up in the console:

>   File "C:\Users\ryabtsev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\glances\processes.py", line 628, in update_list
>     return list_of_namedtuple_to_list_of_dict(processlist)
>   File "C:\Users\ryabtsev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\glances\globals.py", line 495, in list_of_namedtuple_to_list_of_dict
>     return [namedtuple_to_dict(d) for d in data]
>             ^^^^^^^^^^^^^^^^^^^^^
>   File "/app/glances/globals.py", line 490, in namedtuple_to_dict
>     return {k: (v._asdict() if hasattr(v, '_asdict') else v) for k, v in data.items()}
>                                                                          ^^^^^^^^^^^^
> RuntimeError: dictionary changed size during iteration

Instead of a dict view, namedtuple_to_dict() will use a list of tuples.

Performances are unchanged: on average, for 100 runs, namedtuple_to_dict()
completes in 0.2ms

GH issue: #3097
Link: https://docs.python.org/3/library/stdtypes.html#dictionary-view-objects
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-05-27 14:55:41 +02:00
snyk-bot 3278027281
fix: optional-requirements.txt to reduce vulnerabilities
The following vulnerabilities are fixed by pinning transitive dependencies:
- https://snyk.io/vuln/SNYK-PYTHON-NUMPY-2321964
- https://snyk.io/vuln/SNYK-PYTHON-NUMPY-2321966
- https://snyk.io/vuln/SNYK-PYTHON-NUMPY-2321970
- https://snyk.io/vuln/SNYK-PYTHON-PYARROW-6052811
- https://snyk.io/vuln/SNYK-PYTHON-SETUPTOOLS-3180412
- https://snyk.io/vuln/SNYK-PYTHON-SETUPTOOLS-7448482
- https://snyk.io/vuln/SNYK-PYTHON-SETUPTOOLS-9964606
- https://snyk.io/vuln/SNYK-PYTHON-URLLIB3-7267250
2025-05-27 08:51:43 +00:00
nicolargo ad5e7f8479 Merge branch 'issue3182-InfluxDB3' into develop 2025-05-27 10:46:54 +02:00
nicolargo 3f124d3596 Add support for InfluxDB 3 Core #3182 2025-05-27 10:46:39 +02:00
Nicolas Hennion 24eb6cf21a
Merge pull request #3183 from ariel-anieli/issue-2801-refactor
podman: docker: Remove iterator helpers
2025-05-26 19:24:48 +02:00
Ariel Otilibili 52bd26f03e
podman: remove iterator helpers
No more needed in Python 3.

Related to #3181
2025-05-26 17:34:58 +02:00
Ariel Otilibili 75afbe16c9
docker: remove iterator helpers
No more needed in Python 3.

Related to #3181
2025-05-26 17:34:48 +02:00
nicolargo 6af2aa092b Related to iteritems, itervalues, and iterkeys are not more needed in Python 3 #3181 2025-05-26 15:12:42 +02:00
nicolargo 95d38a1392 Related to iteritems, itervalues, and iterkeys are not more needed in Python 3 #3181 2025-05-26 15:12:03 +02:00
nicolargo dde335696a Add a new field in the process list to identifie Zombie process #3178 2025-05-25 18:52:25 +02:00
Nicolas Hennion ef83c404ff
Merge pull request #3180 from ariel-anieli/issue-2801-refactor
plugins: containers; Refactor
2025-05-25 17:30:57 +02:00
Ariel Otilibili 445d20dcad
plugins: containers: Refactor
1. update()
Two branches share the same logic for updating stats. Moreover, intermediate
values where used in nested loops: for filtering keys, and for extending stats.

This could be done at once with chain.from_iterable().

Therefore four helpers are introduced:
- add_engine_into_container
- is_key_in_container_and_not_hidden
- is_key_absent_in_container
- get_containers_from_updated_watcher

A profiling shows the stats build time is the same after the refactor,

$ sudo make run-webserver 2>&1 | grep primitive
         31631 function calls (31566 primitive calls) in 0.028 seconds
         23537 function calls (23487 primitive calls) in 0.025 seconds
         23559 function calls (23509 primitive calls) in 0.014 seconds
         23549 function calls (23499 primitive calls) in 0.024 seconds
         23549 function calls (23499 primitive calls) in 0.026 seconds
         23559 function calls (23509 primitive calls) in 0.016 seconds
         23559 function calls (23509 primitive calls) in 0.022 seconds
         23544 function calls (23494 primitive calls) in 0.015 seconds
         23549 function calls (23499 primitive calls) in 0.023 seconds
         23544 function calls (23494 primitive calls) in 0.018 seconds

[snapshot of top three calls]
         31881 function calls (31816 primitive calls) in 0.029 seconds

   Ordered by: cumulative time
   List reduced from 536 to 3 due to restriction <3>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        3    0.000    0.000    0.029    0.010 __init__.py:250(<genexpr>)
        2    0.000    0.000    0.029    0.015 __init__.py:242(get_containers_from_updated_watcher)
        1    0.000    0.000    0.029    0.029 docker.py:248(update)

And before,

$ sudo make run-webserver 2>&1 | grep primitive
         31620 function calls (31555 primitive calls) in 0.021 seconds
         23526 function calls (23476 primitive calls) in 0.019 seconds
         23533 function calls (23483 primitive calls) in 0.024 seconds
         23538 function calls (23488 primitive calls) in 0.015 seconds
         23528 function calls (23478 primitive calls) in 0.023 seconds
         23528 function calls (23478 primitive calls) in 0.022 seconds
         23533 function calls (23483 primitive calls) in 0.016 seconds
         23538 function calls (23488 primitive calls) in 0.025 seconds
         23538 function calls (23488 primitive calls) in 0.029 seconds
         23538 function calls (23488 primitive calls) in 0.013 seconds

[snapshot of top three calls]
         31865 function calls (31800 primitive calls) in 0.024 seconds

   Ordered by: cumulative time
   List reduced from 531 to 3 due to restriction <3>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.024    0.024 docker.py:248(update)
       13    0.000    0.000    0.022    0.002 decorators.py:38(inner)
       13    0.000    0.000    0.022    0.002 client.py:244(_get)

2. msg_curse()
The conditions are directly used in any().

3. exit()
Minimum supported version is Python 3.9; loops use iterators by default.

itervalues() was introduced for compatility with Python 2. Commit 76ea71f2
("Remove Python 2 in docs and README files") removed Python 2 support.

Part-of: #2801
Link: https://docs.python.org/3/library/itertools.html#itertools.chain.from_iterable
Link: https://docs.python.org/3/library/profile.html#profile.Profile
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-05-24 19:56:59 +02:00
Ariel Otilibili e732ba37be
plugins: containers: Refactor build_container_data
All the if-statements do the same actions:
- check the key is not disabled
- and add the corresponding callback to the building steps.

There could be done with a list comprehension on a dict.

Part-of: #2801
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-05-23 18:17:33 +02:00
Nicolas Hennion e118d7d171
Merge pull request #3179 from ariel-anieli/issue-3098-display-containers
Fix the sorting of containers
2025-05-23 11:33:36 +02:00
Ariel Otilibili b414bafc94
containers: Fix sorting
sort_keys() uses sort_by_these_keys() on the stats. So doing, one of the
retrieved values might be absent; and sort_keys() will fall back to the
default sorting method, which is the alphabetical order.

This is the case for dead or exited containers.

Instead of a key lookup, the get method of dict could be used.

GH issue: #3098
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-05-22 17:40:42 +02:00
Ariel Otilibili 8e23bd661f
containers: processes: Refactor
Refactored sort_docker_stats() and sort_stats().

Useful for an upcoming commit.

Part-of: #2801
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-05-22 17:40:42 +02:00
nicolargo c8d70fb343 Merge branch 'issue3171' into develop 2025-05-02 15:02:33 +02:00
nicolargo 21f0fd0eb4 Refactor code to limit the complexity of update_views method in plugins #3171 2025-05-02 15:01:29 +02:00
nicolargo 5f31106ac1 Merge branch 'issue3169' into develop 2025-05-02 11:17:04 +02:00
nicolargo 6e466c7d14 Code refactoring - Rename plugin class to <Plugin name>Plugin instead of PluginModel #3169 2025-05-02 09:41:32 +02:00
renovate[bot] 1be8d528ed
fix(deps): update dependency pysnmp-lextudio to <6.3.1 2025-04-30 12:09:19 +00:00
Nicolas Hennion 1e7e0c056b
Merge pull request #3163 from ariel-anieli/refactor-plugin-connections-v2
plugins: connections: refactor, version 2
2025-04-27 19:56:10 +02:00
Ariel Otilibili ebd8f766b0
plugins: connections: refactor, version 2
Extracted update_with_net_connections_method and
update_with_nf_conntrack_method from update.

Part-of: #2801
Link: https://scrutinizer-ci.com/g/nicolargo/glances/code-structure/develop/py-function/glances.plugins.connections.PluginModel.update
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-04-27 17:16:43 +02:00
Nicolas Hennion 270ff52363
Merge pull request #3162 from nicolargo/revert-3161-refactor-plugin-connections
Revert "plugins: connections: refactor"
2025-04-27 15:21:54 +02:00
Nicolas Hennion f933d9f1ef
Revert "plugins: connections: refactor" 2025-04-27 15:21:06 +02:00
Nicolas Hennion c69a5a9307
Merge pull request #3161 from ariel-anieli/refactor-plugin-connections
plugins: connections: refactor
2025-04-27 15:02:36 +02:00
Nicolas Hennion b747c87796
Merge pull request #3160 from nguuuquaaa/fix-fs
Fix matching problem when fs config has "show" value
2025-04-27 14:58:38 +02:00
nicolargo f77e039f21 Merge branch 'issue3158' into develop 2025-04-27 14:53:30 +02:00
nicolargo 1901fcad05 [WEBUI] Irix mode (per core instead of per CPU percentage) not togglable #3158 2025-04-27 14:53:02 +02:00
nguuuquaaa 2ef24c7b2d fix display checking logic 2025-04-27 04:35:24 +07:00
Ariel Otilibili 1c93368561
plugins: connections: refactor
Extracted update_with_net_connections_method and
update_with_nf_conntrack_method from update.

Part-of: #2801
Link: https://scrutinizer-ci.com/g/nicolargo/glances/code-structure/develop/py-function/glances.plugins.connections.PluginModel.update
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-04-26 19:07:32 +02:00
nicolargo 55258748ff Done bu display 0 on the WebUI CPU column in IRIS mode... Why ??? 2025-04-26 19:06:56 +02:00
nguuuquaaa 133b97bcaf fix broken matching when fs config has show value 2025-04-26 01:12:13 +07:00
nguuuquaaa 840670ea77 fix broken implementation of plugin.is_display/is_hide/is_show 2025-04-26 00:52:15 +07:00
Nicolas Hennion 5e1a08af79
Merge pull request #3159 from ariel-anieli/reduce-complexity-mem-plugin-update
plugins: mem: reduce code complexity
2025-04-24 07:59:43 +02:00
Ariel Otilibili 4531aac37f
plugins: mem: reduce code complexity
Part of #2801.

Link: https://scrutinizer-ci.com/g/nicolargo/glances/code-structure/develop/py-function/glances.plugins.mem.PluginModel.update
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-04-23 22:01:27 +02:00
Nicolas Hennion 829ae981b5
Merge pull request #3152 from wuhgit/develop
Revision of confusing descriptions in the SMART section of the document
2025-04-21 11:13:53 +02:00
nicolargo 8d1039d4ac Correct an issue with VMs bin test 2025-04-21 10:56:04 +02:00
nicolargo 2cbf7a7fba Merge branch 'issue1531' into develop 2025-04-21 10:40:03 +02:00
nicolargo 0f10ffc245 Add stats about running VMS (qemu/libvirt/kvm support through virsh) #1531 2025-04-21 10:39:48 +02:00
nicolargo f9250c9985 Add stats about running VMS (qemu/libvirt/kvm support through virsh) #1531 2025-04-21 10:39:20 +02:00
wuhgit bdccb0b196
Revision of confusing descriptions in the SMART section of the document 2025-04-17 07:19:26 +08:00
Nicolas Hennion 7218a22002
Update faq.rst 2025-04-15 09:04:40 +02:00
Nicolas Hennion 1feb1ec6f8
Update faq.rst 2025-04-15 09:04:14 +02:00
Nicolas Hennion 4b21d0a18f
Container memory stats not displayed #3142 2025-04-15 09:03:41 +02:00
Nicolas Hennion bead0ae13d
Merge pull request #3151 from Destarianon/bug/discussion2274
Ignore unsupported line endings in password file
2025-04-15 08:54:09 +02:00
Tyler Kerr 1c7a824821
strip unsupported line endings from password file 2025-04-14 21:54:36 +00:00
Nicolas Hennion 48543cab8f
Merge pull request #3070 from nicolargo/renovate/docker-build-push-action-6.x
Update docker/build-push-action action to v6
2025-04-14 16:54:29 +02:00
nicolargo 01b4ca1cf5 Take into account @amard33p comment - https://github.com/nicolargo/glances/issues/2394#issuecomment-2794522951 2025-04-13 16:36:29 +02:00
nicolargo de90b4fd54 Improve unittest for CSV export #3150 2025-04-13 16:28:49 +02:00
nicolargo a91b187069 Remove quicklook from the exportable list 2025-04-13 15:53:52 +02:00
nicolargo eeb7db8e82 Do not store data during InfluxDB test 2025-04-13 15:41:02 +02:00
nicolargo d22f3e16fe Merge branch 'issue3149' into develop 2025-04-13 14:41:32 +02:00
nicolargo 7cc4e86639 Improve unittest for InfluxDB plugin #3149 2025-04-13 14:41:08 +02:00
nicolargo 3cdededa78 Improve unittest for InfluxDB plugin #3149 2025-04-13 14:40:56 +02:00
nicolargo 3016717208 Correct NoneType in update_view method 2025-04-12 16:40:26 +02:00
Nicolas Hennion 9fd1efce21
Merge pull request #3108 from nicolargo/renovate/actions-stale-9.x
Update actions/stale action to v9
2025-04-12 16:12:51 +02:00
Nicolas Hennion 4db6aaeb3d
Merge pull request #3148 from nicolargo/renovate/windows-2025.x
Update dependency windows to v2025
2025-04-12 16:11:06 +02:00
Nicolas Hennion d4202339d9
Merge pull request #3066 from nicolargo/renovate/ubuntu-24.x
Update dependency ubuntu to v24
2025-04-12 16:10:52 +02:00
renovate[bot] 551ec80be6
Update dependency windows to v2025 2025-04-12 12:55:54 +00:00
nicolargo 4c9685f0bf Merge branch 'issue3147' into develop 2025-04-12 14:55:16 +02:00
nicolargo 90ebe27f7e Upgrade JS libs #3147 2025-04-12 14:54:39 +02:00
nicolargo 0907700843 Commit before lint 2025-04-12 14:51:38 +02:00
nicolargo ca2b7a9907 Update precommit hook 2025-04-11 19:19:44 +02:00
nicolargo c1beee40a2 Correct README file 2025-04-11 19:05:30 +02:00
nicolargo acf54a508e Make the shtab optional 2025-04-11 18:54:25 +02:00
nicolargo 50aa49a497 Merge branch 'issue3111' into develop 2025-04-11 18:45:24 +02:00
nicolargo 17553fac8f Add a new option --print-completion to generate shell tab completion - #3111 2025-04-11 18:44:55 +02:00
nicolargo 060457c2ae Update documentation 2025-04-11 18:43:35 +02:00
nicolargo bf54140b87 Add shtab as a dependency 2025-04-11 18:18:21 +02:00
nicolargo 18d6beebe1 Merge branch 'issue3143' into develop 2025-04-11 17:59:31 +02:00
nicolargo bc1211a672 In the FS module, do not display threshold for volume mounted in 'ro' (read-only) #3143 2025-04-11 17:58:00 +02:00
Nicolas Hennion 9cd51fc060
Merge pull request #3141 from kenrmayfield/develop
Updates 4/6/2025: FreeBSD Section - Glances - An Eye on your System
2025-04-10 13:42:21 +02:00
kenrmayfield 041a9852a9
Update README.rst
Update Line: 
Glances Binary Package Versions per System Architecture for FreeBSD as of: 08 Mar 2025 04:05:21

Changed to:
Glances Binary Package Versions and Python Versions( pyXY-glances) per System Architecture for FreeBSD as of: 08 Mar 2025 04:05:21
2025-04-06 23:42:31 -05:00
kenrmayfield aa8f3abab3
Update README.rst
Remove CHECK Link.  Not working correctly.  Need to wait until Main Repository has been Updated.  Then I can make a Link to the FreeBSD Glances Binary Package Version Picture.
2025-04-06 23:33:44 -05:00
kenrmayfield 96aa6987ab
Update README.rst
Updated CHECK Link again due to Error in Syntax
2025-04-06 23:20:20 -05:00
kenrmayfield f29af964ef
Update README.rst
Updated CHECK Link for Python Version corresponding to Glances Binary Package
2025-04-06 22:44:53 -05:00
kenrmayfield aee1ea6acd
Update README.rst
Capitalize the words eye and system in the Title to Eye and System
2025-04-06 22:27:05 -05:00
kenrmayfield 6f93c1bad9
Update README.rst
Changed spelling of ports to Ports
2025-04-06 22:00:29 -05:00
kenrmayfield 20d08c0cb6
Update README.rst
Bold the word NOTE
2025-04-06 21:58:44 -05:00
kenrmayfield 4d7300ab96
Update README.rst
Update FreeBSD Instructions
1. Add Glances Binary Package Versions Picture
2. Update Install
3. Add Note to Check Glances Binary Package Version with System 
    Architecture that corresponds to Python Version.
4.  Add Link to Glances Binary Package Versions Picture called 
     CHECK
2025-04-06 21:47:56 -05:00
nicolargo 0b62a9f785 [GPU] AMD Plugin: Operation not permitted #3125 2025-04-06 18:49:38 +02:00
nicolargo cb22a0c56a Merge branch 'issue3132' into develop 2025-04-06 18:39:26 +02:00
nicolargo fcbcbbfb4d FR: Sort Sensors my name in proper number order #3132 2025-04-06 18:37:45 +02:00
nicolargo c5954c9d99 [Discussion] FreeBSD - AMD64 Install: Package py39-glances not showing a Version Available for AMD64 but for Package py311-glances #3139 2025-04-06 17:51:36 +02:00
nicolargo ad0be97653 Merge branch 'develop' of github.com:nicolargo/glances into develop 2025-04-06 17:49:08 +02:00
nicolargo 6ccd4430e9 Merge branch 'issue2394' into develop 2025-04-06 17:48:54 +02:00
nicolargo b06b0d5c7c Make all results from amps plugins exportable #2394 2025-04-06 17:48:34 +02:00
nicolargo 3a96cfd0cc CSV column name now include the plugin name - Related to #2394 2025-04-06 17:33:20 +02:00
Nicolas Hennion 584fbba311
Merge pull request #3131 from ariel-anieli/glances-start-refactor
glances: refactor start()
2025-03-25 07:37:59 +01:00
Ariel Otilibili fc4dc38028 glances: refactor start()
Part of #2801: start() is split into start_main_loop(),
check_memleak(), setup_server_mode(), & maybe_trace_memleak().

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2025-03-23 21:19:31 +01:00
nicolargo aa428b51c9 Create a new init method for export in order to init fields in some export module 2025-03-23 18:53:19 +01:00
nicolargo 3ba5946974 Remove <plugin>_disable field from export 2025-03-23 17:49:32 +01:00
nicolargo b7cdf66eb0 On the road of Glances 4.3.2 2025-03-22 17:53:04 +01:00
nicolargo 7cfc0c7aa6 version 4.3.1 2025-03-22 17:51:23 +01:00
nicolargo 91fa4bf200 Update configuration file for docker compose 2025-03-22 17:39:36 +01:00
nicolargo a6b14d75bb Remove debug message in sensors plugins 2025-03-22 16:41:11 +01:00
nicolargo ec0baca9f7 Little improvment regarding the CPU name if nothing is found. Display the CPU architecture. 2025-03-22 16:05:58 +01:00
nicolargo e7c2c219c5 Merge branch 'issue3102' into develop 2025-03-09 16:43:35 +01:00
nicolargo 84c54a7b9a Cannot set warning/critical temperature for a specific sensor #3102 2025-03-09 16:43:01 +01:00
nicolargo f2c7e4724a Merge branch 'develop' of github.com:nicolargo/glances into develop 2025-03-08 12:06:12 +01:00
nicolargo 91a052d11a Try to reduce latency between stat's update and view - #3086 2025-03-08 12:05:35 +01:00
nicolargo 002954e58a Try to reduce latency between stat's update and view 2025-03-08 12:04:13 +01:00
nicolargo df3d96bd33 Merge branch 'issue3113' into develop 2025-03-02 17:33:01 +01:00
nicolargo 079f926eb1 Add disable background option in glances.conf file - #3113 2025-03-02 17:32:45 +01:00
nicolargo c70eb857ba I'd like a feature to make the forground color for colored background white #3119 2025-03-01 17:19:34 +01:00
nicolargo 979d040f7b Merge branch 'issue410' into develop 2025-03-01 16:21:13 +01:00
nicolargo 8e8773d1c2 Change button style 2025-03-01 16:02:20 +01:00
nicolargo b206938f95 Update CSS style for extended stats 2025-03-01 15:30:00 +01:00
Nicolas Hennion 1aa8d221f1
Merge pull request #3118 from jo-chemla/quickfix-glances-grafana-flux.json
Replace `docker` by `containers` in `glances-grafana-flux.json`
2025-02-27 17:44:12 +01:00
Jonathan Chemla e14e49a2fd
Replace `docker` by `containers` in `glances-grafana-flux.json`
Typo probably introduced following a naming convention change that was not repercuted on that grafana fluxQL influxdb2 dashboard JSON
2025-02-25 09:51:12 +01:00
nicolargo f9bbcea9e1 First version OK, need change on UI 2025-02-23 19:50:48 +01:00
nicolargo c32d363897 Merge branch 'issue410' of github.com:nicolargo/glances into issue410 2025-02-22 10:13:22 +01:00
renovate[bot] 6a265be9d5
chore(deps): update actions/stale action to v9 2025-02-19 09:49:45 +00:00
Nicolas Hennion c00383f0b0
Merge pull request #3106 from almkuznetsov/config-dir
default_config_dir: Fix config path to include glances/ directory
2025-02-19 10:49:06 +01:00
Alexander Kuznetsov bafe0e2438 docs: Fix default config path typos 2025-02-17 16:28:27 +03:00
Alexander Kuznetsov 7e28116252 default_config_dir: Fix config path to include glances/ directory
Non-venv default config path was /usr/share/doc/glances.conf
(not /usr/share/doc/glances/glances.conf) since a55970a.

Fix it and place the venv path to the end of the paths list,
so it will have priority over the system default.
2025-02-17 16:26:44 +03:00
nicolargo e1dcfc38c5 _api_get_extended_processes is called several time per second. Should be corrected. 2025-02-08 17:48:15 +01:00
nicolargo 1345bc24d5 Entry point in the API to get extended process stats #3095 2025-01-26 09:54:23 +01:00
nicolargo 0c6c488627 Lint the code 2025-01-25 11:11:17 +01:00
nicolargo 4a4cb135da [Docker plugin] KeyError: 'mem' cause 'Exception in ASGI application' #3091 2025-01-25 11:05:21 +01:00
nicolargo 233a47e971 Error on Cloud plugin initialisation make TUI crash #3085 2025-01-19 19:54:26 +01:00
Nicolas Hennion c93df694d9
Update docker-compose.yml
Update Docker-Compose
2025-01-15 09:56:29 +01:00
Nicolas Hennion c536fcde77
Update docker-compose.yml
Dockerized Web Sever mode with login/password #2684
2025-01-15 09:55:40 +01:00
Nicolas Hennion 7eb488ba77
Update README.rst
Add OSSRank
2025-01-13 10:33:38 +01:00
Nicolas Hennion d2e2b8fb17
Merge pull request #3083 from mizulike/develop
Fixed minor typos
2025-01-11 17:35:18 +01:00
mizulike 296b2ece60 Fixed typos 2025-01-10 03:45:36 +01:00
nicolargo e4bc144f31 Add Selenium test with different resolution 2025-01-04 15:48:53 +01:00
nicolargo 3ad94bc095 Refactor dynamic plugin max size computation in the __display_right method 2025-01-04 15:10:59 +01:00
nicolargo d5f8418387 Again on the road to Glances 4.3.1 2025-01-04 11:24:00 +01:00
nicolargo 5090cd4493 Update NEWS 2025-01-04 11:23:05 +01:00
nicolargo e907519c4a version 4.3.0.8 2025-01-04 11:21:51 +01:00
nicolargo d264155fc2 Add a message to verify Netifaces2 2025-01-04 11:20:08 +01:00
nicolargo 728f86fa5e IP plugin broken with Netifaces2 #3076 2025-01-04 11:12:25 +01:00
nicolargo 2c9beccea5 Improve WebUI display on low screen 2025-01-04 10:14:34 +01:00
nicolargo 0b818e99fa On the road again again to 3.4.1 2025-01-03 10:23:38 +01:00
nicolargo 372380bdb9 version 4.3.0.7 2025-01-03 10:20:15 +01:00
nicolargo c711a63322 Full responsive WebUI 2025-01-03 10:08:36 +01:00
nicolargo bfdc27dc2c Make the header and top menu responsive 2024-12-31 17:45:38 +01:00
nicolargo 7e3948b72e On the road (again) to Glances 4.3.1 2024-12-30 15:20:20 +01:00
nicolargo 7a2ee52362 version 4.3.0.6 2024-12-30 15:15:43 +01:00
renovate[bot] f1054c5eea
Update docker/build-push-action action to v6 2024-12-30 14:11:07 +00:00
nicolargo 1588375624 Merge branch 'issue3055' into develop 2024-12-30 15:09:15 +01:00
nicolargo c0270056b7 Merge branch 'develop' into issue3055 2024-12-30 15:08:47 +01:00
nicolargo dd93371dc4 Browser mode do not working with the sensors plugin #3069 2024-12-30 15:07:12 +01:00
nicolargo 5274339774 Browser do not working 2024-12-30 14:19:26 +01:00
renovate[bot] 4c3e8f9448
Update dependency ubuntu to v24 2024-12-30 12:42:00 +00:00
nicolargo 825b9879c8 Disable Renovate for Lock file 2024-12-30 11:57:11 +01:00
nicolargo 3b67eb1c79 Remove test on Windows and Python 3.13 2024-12-29 15:09:58 +01:00
nicolargo c372d35f2c Make the test compliant with Windows 2024-12-29 13:36:04 +01:00
nicolargo acb206ef78 Refactor memory leak 2024-12-29 13:27:57 +01:00
nicolargo bd35c77437 Disable history test on Windows 2024-12-29 13:26:19 +01:00
nicolargo b77d1b36b3 Semgrep is not available on Windows 2024-12-29 13:15:16 +01:00
nicolargo 797b0d06b1 Add memory leak unitary test 2024-12-29 13:07:54 +01:00
nicolargo 6124da2e59 Move all the Python test files in ./tests/ folder 2024-12-28 18:31:39 +01:00
nicolargo f730bf3aa2 Correct an issue with the fs plugin in test_perf 2024-12-28 18:27:43 +01:00
nicolargo b33cd3fd2b Add dep for run test in CI 2024-12-28 18:20:20 +01:00
nicolargo 8fb49d99b1 Improve unittest (PyTest, add perf, add Selenium) #2757 2024-12-28 18:09:08 +01:00
nicolargo 1624e66f48 Improve unittest #2757 2024-12-28 18:08:52 +01:00
nicolargo b4402bfc53 Merge branch 'develop' into issue2757 2024-12-28 13:52:42 +01:00
nicolargo ef602ac59e Get back to road for Glances 4.3.1 2024-12-28 13:52:08 +01:00
nicolargo c8a592b5b7 Merge branch 'master' into develop 2024-12-28 13:51:15 +01:00
nicolargo ae31259709 version 4.3.0.5 2024-12-28 13:49:54 +01:00
nicolargo d457fad293 WebUI errors in 4.3.0.4 on iPad Air (and Browser with low resolution) #3057 2024-12-28 13:47:21 +01:00
nicolargo 790bd5bfad WebUI errors in 4.3.0.4 on iPad Air (and Browser with low resolution) #3057 2024-12-28 13:46:14 +01:00
nicolargo 233f5a68df WebUI errors in 4.3.0.4 on iPad Air (and Browser with low resolution) #3057 2024-12-28 13:45:34 +01:00
nicolargo 3ec94d32f0 Switch to Chrome for Selenium 2024-12-28 13:16:11 +01:00
nicolargo bce9fe3621 Before switching to Chrome/2 2024-12-28 10:25:55 +01:00
nicolargo d92c18784e Before switching to Chrome 2024-12-28 10:25:37 +01:00
nicolargo 754898854f Merge branch 'develop' into issue2757 2024-12-28 09:57:34 +01:00
nicolargo c8cb4d05b3 Build for SNAP 2024-12-28 09:57:06 +01:00
nicolargo 7e1b7e34db Disable VMS by default to make it renable in SNAP 2024-12-28 09:53:00 +01:00
nicolargo df5ecca044 Back to dev 2024-12-28 09:17:46 +01:00
nicolargo 287df49af2 Rebuild Snap with multipass support 2024-12-28 09:16:39 +01:00
nicolargo 18e386a5dd Merge branch 'master' into develop 2024-12-28 09:07:55 +01:00
nicolargo bc201df05b version 4.3.0.4 2024-12-28 09:07:25 +01:00
nicolargo ec0d5695a9 First test with Selenium 2024-12-28 09:00:50 +01:00
nicolargo 4bb39232fe Merge branch 'develop' into issue2757 2024-12-27 22:09:20 +01:00
nicolargo 5faad4b13c Reapply "Replace netifaces by netifaces-plus #3053"
This reverts commit 85b786c832.
2024-12-27 21:59:51 +01:00
nicolargo 80f330d866 version 4.3.0.3 2024-12-27 21:56:00 +01:00
nicolargo ebf5431592 version 4.3.0.2 2024-12-27 21:22:34 +01:00
nicolargo 85b786c832 Revert "Replace netifaces by netifaces-plus #3053"
This reverts commit 9da81638b9.
2024-12-27 21:20:24 +01:00
nicolargo 86082963b3 version 4.3.0.1 2024-12-27 21:05:02 +01:00
nicolargo 236d2f80e3 CONTAINERS section missing in 4.3.0 WebUI #3052 2024-12-27 21:00:39 +01:00
nicolargo 9da81638b9 Replace netifaces by netifaces-plus #3053 2024-12-27 20:42:35 +01:00
nicolargo dbb791fa58 Update Python version for containers 2024-12-27 16:10:05 +01:00
nicolargo 7439ec1625 On the road to Glances 3.4.1 2024-12-27 15:29:12 +01:00
nicolargo e09530693f version 4.3.0 2024-12-27 15:15:46 +01:00
nicolargo 1a4eeaee01 Merge branch 'master' into develop 2024-12-27 11:56:31 +01:00
nicolargo e14934a197 Update profiling file 2024-12-27 11:53:34 +01:00
nicolargo 8276ddd184 Enable PyTest in the Github pipeline 2024-12-26 11:08:06 +01:00
nicolargo c828f21753 Updata min-test 2024-12-26 10:54:50 +01:00
nicolargo 61edf4daf5 Make main.py comliant with PyTest (concerning args) 2024-12-26 10:49:26 +01:00
nicolargo b491cbe42b Make main.py comliant with PyTest (concerning args) 2024-12-26 10:48:50 +01:00
nicolargo b6865d8cff Remove now plugin in the left menu of the WebUI (in the make webui task) 2024-12-25 09:35:08 +01:00
nicolargo 0ed44f2c13 Make the glances/outputs/static/js/uiconfig.json generated automaticaly from the make webui task 2024-12-25 09:31:29 +01:00
nicolargo f3d9e3feee [WebUI] Unecessary space between Processcount and processlist #3032 2024-12-23 19:19:43 +01:00
nicolargo 499e46cf44 Unexpected behaviour while running glances in docker with --export influxdb2 #2904 2024-12-23 16:17:32 +01:00
nicolargo 695559c72a Align conf file 2024-12-23 11:52:57 +01:00
nicolargo 01e007deaa Allow containers columns to be selected in config file #2722 2024-12-23 11:51:09 +01:00
nicolargo b6fc1596a9 Done for the WebUI 2024-12-23 11:50:53 +01:00
nicolargo 1980569c90 Done in the TUI 2024-12-23 11:39:17 +01:00
nicolargo 96ed18e503 Remove unused NICE level in color 2024-12-23 10:58:34 +01:00
nicolargo de8341b5b5 Improve CAREFUL_LOG display on 256 color terminal 2024-12-23 10:47:42 +01:00
nicolargo c6e7281e1b Update API docs 2024-12-22 20:02:44 +01:00
nicolargo 077d5fee5b Merge branch 'issue3042' into develop 2024-12-22 19:19:14 +01:00
nicolargo 0e9e74fa8c [WEBUI] Clear old alert messages in the WebUI #3042 2024-12-22 19:13:46 +01:00
nicolargo cf56203c09 Create entry point for clear warnig/all events in the API 2024-12-21 16:14:47 +01:00
nicolargo a20362d68e Update glances.conf for container 2024-12-21 15:38:48 +01:00
nicolargo faf4d3cbf6 Glances 4.3.0_dev06 2024-12-21 15:22:11 +01:00
nicolargo 183772cf3e Merge branch 'issue3049' into develop 2024-12-21 15:19:49 +01:00
nicolargo 890b5d5dd2 Raise an (Alert) Event for a group of sensors #2692 2024-12-21 15:19:34 +01:00
Nicolas Hennion d9725d623f
Merge pull request #3045 from ariel-anieli/revert-98e8e32457dcf6129c8c6084e03675268ac20f9f
Revert "Reduced complexity of `unittest-core.TestGlances._common_plugin_tests()`"
2024-12-21 13:18:48 +01:00
nicolargo 53d5a0f1a6 Glances 4.3dev05 2024-12-14 17:08:35 +01:00
nicolargo d0b9ea69b6 Update WebUI dep 2024-12-14 09:29:27 +01:00
nicolargo 577605f772 Update documentation 2024-12-14 09:28:45 +01:00
Ariel Otilibili 2134174758 Revert "Reduced complexity of `unittest-core.TestGlances._common_plugin_tests()`"
* reverting 98e8e32457
* introduced #3040.
2024-12-08 21:12:25 +01:00
Nicolas Hennion 8258101d35
Merge pull request #3029 from ariel-anieli/glances-processes
Refactored `glances.processes.GlancesProcesses.update`, version 2
2024-12-08 19:10:19 +01:00
nicolargo af808c48e8 Correct unittest with programame 2024-12-08 18:52:50 +01:00
Ariel Otilibili cb53393f83 Refactored `glances.processes.GlancesProcesses.update`, version 2
* part of #2801
* second take of 1fda541350
* reverted in 0c635af10d.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-23 13:43:38 +01:00
Ariel Otilibili 4345e9877b Fix Ruff warnings in GitHub Actions
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-23 13:43:11 +01:00
nicolargo ce0e3c7945 Correct display issue on Containers plugin in WebUI #3028 2024-11-23 10:16:36 +01:00
nicolargo 2061d1b42c Refactor display of +time in WebUI 2024-11-21 19:47:25 +01:00
nicolargo 55d42d358d Make top menu dynamic on WebUI 2024-11-21 19:18:13 +01:00
nicolargo 9e945f1bb7 Merge branch 'issue3024' into develop 2024-11-20 15:03:03 +01:00
nicolargo 21d17c2d44 Improve CCS of WebUI #3024 2024-11-20 15:02:47 +01:00
nicolargo fb25a6f4f4 Bug In the Web-UI, Timestamps for 'Warning or critical alerts' are showing incorrect month #3023 2024-11-20 13:15:28 +01:00
nicolargo 16c5c71cdc Update WebUI 2024-11-20 09:49:30 +01:00
nicolargo 86c07a3fb4 Merge branch 'jdrouhard-fix-network-disk-filter' into develop 2024-11-20 09:48:32 +01:00
John Drouhard 3fdc5402be WebUI: Fix network/diskio filter when property doesn't exist 2024-11-17 14:25:43 -06:00
nicolargo 40299a633e WebUI doesn't display valid time for process list #2902 2024-11-17 19:18:12 +01:00
nicolargo feefcd417d Update pretty_date 2024-11-17 18:45:51 +01:00
nicolargo e1e4e8bda9 Uptime for Docker containers not working #3021 2024-11-17 18:31:44 +01:00
nicolargo 734632faa2 Merge branch 'issue3019' into develop 2024-11-17 15:32:57 +01:00
nicolargo 8d1a5ca189 Thread mode ('j' hotkey) is not taken into accound in the WebUI #3019 2024-11-17 15:32:34 +01:00
nicolargo a7d5b1e869 Thread mode ('j' hotkey) is not taken into accound in the WebUI #3019 2024-11-17 15:31:10 +01:00
nicolargo fa57d5a5ab Disable 'j' hotky in WebUI - Waiting for #3019 2024-11-16 17:05:11 +01:00
nicolargo 2ec5c8d251 Code refactor after reading https://blog.codingconfessions.com/p/the-pythonic-emptiness?utm_source=tldrwebdev 2024-11-16 16:09:53 +01:00
nicolargo a36c2bf87a Rework CI to split build Pypi packages and build Docker images 2024-11-16 16:08:12 +01:00
nicolargo ddd7e5ebe4 Try with a new develop version to check last commit 2024-11-16 15:26:42 +01:00
nicolargo 494b0a01c5 Try with a new develop version to check last commit 2024-11-16 15:16:08 +01:00
nicolargo c36ad5d4ff Try new build and publish to Pypi CI actions - Correct issue 2024-11-16 15:07:07 +01:00
nicolargo 7ef4b6642b Try new build and publish to Pypi CI actions 2024-11-16 14:52:23 +01:00
nicolargo 77e3c4968d Revert commit 57868c7 waitin implementation of issue 3020 2024-11-16 12:15:21 +01:00
nicolargo 57868c70f5 CI - Allow develop branch to overwrite Pip package in Pypi Test 2024-11-16 11:49:10 +01:00
nicolargo 8cf98e59e6 Update docs 2024-11-16 11:47:32 +01:00
nicolargo c5fc63b53a Merge branch 'issue2996' into develop 2024-11-16 11:39:51 +01:00
nicolargo 3f26fb85f6 Ability to specify hide or show for smart plugin #2996 2024-11-16 11:39:24 +01:00
nicolargo 07656fd7ff Network problem when no bitrate available #3014 2024-11-15 18:06:20 +01:00
nicolargo 9fe0c812a0 SyntaxError: f-string: unmatched '[' in server list (on the DEVELOP branch only) #3018 2024-11-15 18:01:47 +01:00
nicolargo 318a61da6c Add a target to start Glances with Htop features 2024-11-11 17:09:24 +01:00
Nicolas Hennion 1910004d21
Merge pull request #3013 from nicolargo/revert-3009-refactor-glances-processes
Revert "Refactored `glances.processes.GlancesProcesses.update`"
2024-11-11 16:52:26 +01:00
Nicolas Hennion 0c635af10d
Revert "Refactored `glances.processes.GlancesProcesses.update`" 2024-11-11 16:52:02 +01:00
nicolargo b59f9a3957 Merge branch 'ariel-anieli-refactor-glances-processes' into develop 2024-11-11 16:49:29 +01:00
nicolargo 279a27f60f Correct merge issue 2024-11-11 16:49:10 +01:00
nicolargo 0370c91567 Issue with ports plugin (for URL request) #3008 2024-11-11 16:21:58 +01:00
nicolargo da54624d5a Merge branch 'issue3010' into develop 2024-11-11 16:04:21 +01:00
nicolargo 28fb7bff62 FS module alias configuration do not taken into account everytime #3010 2024-11-11 16:04:09 +01:00
nicolargo 10543581ed Merge branch 'issue1524' into develop 2024-11-11 15:27:20 +01:00
nicolargo 172dda97de Remove test in the glances.conf file 2024-11-11 15:26:59 +01:00
nicolargo 82c2ade01f Implementation for WebUI ok 2024-11-11 15:03:19 +01:00
Ariel Otilibili 1fda541350 Refactored `glances.processes.GlancesProcesses.update`
Part of #2801.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-11 13:09:31 +01:00
nicolargo 34520ca45b First version but only for the TUI standalone mode 2024-11-10 20:00:40 +01:00
nicolargo e1cd3ded23 Add Memory profiling 2024-11-10 17:06:02 +01:00
nicolargo ff9339b74f Refactor code in order to prepare the feature request #1524 2024-11-10 14:57:05 +01:00
nicolargo 7a57263b81 Reduce complexity of __init__ for processes.py 2024-11-10 14:09:25 +01:00
nicolargo 42b87acb55 Update profiling 2024-11-10 13:59:42 +01:00
nicolargo f980608724 Updae theme 2024-11-09 15:32:53 +01:00
Nicolas Hennion a3341b196e
Merge pull request #3006 from ariel-anieli/bump-ruff
Bump ruff target to Python 3.9
2024-11-09 14:40:58 +01:00
Ariel Otilibili 5791a19017 `make lint` in `glances/plugins/containers/__init__.py`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-09 13:21:36 +01:00
Ariel Otilibili ffb2af1b66 `make lint` in `glances/plugins/containers/engines/__init__.py`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-09 13:21:36 +01:00
Ariel Otilibili 170dda4eac `make lint` in `glances/plugins/containers/engines/docker.py`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-09 13:21:36 +01:00
Ariel Otilibili aaf660c1c1 `make lint` in `glances/plugins/containers/engines/podman.py`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-09 13:21:36 +01:00
Ariel Otilibili e763c9b4f1 `make lint` in `glances/plugins/sensors/__init__.py`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-09 13:21:36 +01:00
Ariel Otilibili 4ad93e629d `make lint` in `glances/plugins/vms/__init__.py`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-09 13:21:36 +01:00
Ariel Otilibili 776a2356b2 `make lint` in `glances/plugins/vms/engines/__init__.py`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-09 13:21:36 +01:00
Ariel Otilibili 0e83631b97 `make lint` in `glances/plugins/vms/engines/multipass.py`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-09 13:21:36 +01:00
Ariel Otilibili 7d1b9a3bf3 `make lint` in `glances/globals.py`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-09 13:21:36 +01:00
Ariel Otilibili 6ea8244906 `make lint` in `glances/cpu_percent.py`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-09 13:21:36 +01:00
Ariel Otilibili f92150a4f6 Bumped ruff target to Python 3.9
* sequel of b537f454c1
* prelude to subsequent changes due to ruff [Link]

Link: https://docs.astral.sh/ruff/rules/non-pep585-annotation/
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-09 13:19:47 +01:00
nicolargo 037c0d2cf9 Avoid error when stop / restart web server in the Glances Central Browser 2024-11-09 10:17:17 +01:00
nicolargo 530f4e37b0 Update unit-test for Glances Central Browser 2024-11-09 09:38:51 +01:00
nicolargo c60b4bf2eb Add unit-test for new entry point in the API (plugin/item/key) 2024-11-09 09:13:37 +01:00
Nicolas Hennion 76d8cbe251
Merge pull request #3005 from ariel-anieli/python-bump
Bumped minimal Python version to 3.9
2024-11-09 08:45:25 +01:00
nicolargo af156665a4 Remove log message used during debug 2024-11-08 19:33:17 +01:00
nicolargo 773ebd9920 Remove log message used during debug 2024-11-08 19:32:37 +01:00
nicolargo 64e8cf4221 Issue when display sensors with space in browser #2983 2024-11-08 19:31:35 +01:00
nicolargo cd70a8091f Correct issue when key name contains space - Related to #2983 2024-11-08 19:19:56 +01:00
nicolargo 15d993a2cc Remove the test in glances.conf file 2024-11-08 18:22:08 +01:00
nicolargo efd79b0bd8 Correct an issue on the Webbrowser, the column list is now shared between static and dynamic Glances servers list 2024-11-08 18:21:40 +01:00
nicolargo a9e3820947 Update doc and WebUI 2024-11-08 15:26:44 +01:00
Ariel Otilibili 27116443b7 `make format`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-08 15:19:40 +01:00
Ariel Otilibili b537f454c1 Bumped minimal Python version to 3.9
* Python 3.8 is now end of life [Link]
* changed occurrences found with `git grep -P '[^\d\.]3\.8[^\d]'`
* so doing, removed unused branch in `glances/outputs/glances_restful_api.py`
* branch introduced by f6545580db
* ruff also needs a bump; i.e, `s/py38/py39/`
* not done yet, since it needs to clear out warnings.

Link: https://devguide.python.org/versions/
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-08 15:19:40 +01:00
nicolargo 114435e033 Thresholds not displayed in the WebUI for the DiskIO plugin #1498 2024-11-08 15:14:41 +01:00
nicolargo eebab00720 Update docs 2024-11-08 12:37:36 +01:00
nicolargo e2b53594ec Update glances.conf 2024-11-08 12:36:54 +01:00
nicolargo 0eaa3727a1 Merge branch 'issue1121' into develop 2024-11-08 12:36:02 +01:00
nicolargo 0f641cb9eb Merge branch 'develop' into issue1121 2024-11-08 12:35:41 +01:00
nicolargo 2495677d7b Update doc 2024-11-08 12:28:58 +01:00
nicolargo dc5c182ee8 The Web browser client should detect clients on the same LAN (thanks to zeroconf, like it is already done in --browser XMLRPC client/server mode) 2024-11-08 11:59:18 +01:00
nicolargo 7ac7171a3f Improve theme and refactor getDecoration for stats 2024-11-08 09:17:51 +01:00
nicolargo d0629ea128 Change the default path for graph export to /tmp/glances 2024-11-06 15:42:40 +01:00
Nicolas Hennion 6bfccdf87f
Merge pull request #3000 from shidetian/patch-1
add comparable NVML_LIB check for Windows
2024-11-06 14:52:21 +01:00
Nicolas Hennion 08c31b810f
Merge pull request #2998 from ariel-anieli/ip-model
Refactored `glances.plugins.ip.PluginModel.update`
2024-11-06 14:49:53 +01:00
nicolargo ce3f740a2f Change theme 2024-11-06 14:44:28 +01:00
nicolargo e6e6b16aad Update SCSS for browser mode 2024-11-04 08:06:43 +01:00
nicolargo 0d908034ab Display the list and click on a server is OK 2024-11-03 16:30:35 +01:00
Detian Shi bcd7b3d9c6
remove unused variable 2024-11-02 17:06:17 -07:00
Detian Shi 30a31eda81
add comparable NVML_LIB check for Windows 2024-11-02 16:48:42 -07:00
nicolargo e1dd979b86 Refactor server list code in order to put all the methodin the servers_list.py file 2024-11-02 16:23:31 +01:00
nicolargo 799dcab034 Add WebUI Central Browser 2024-11-02 09:00:31 +01:00
nicolargo 3352f095b6 Refactor servers list (static and dynamic) 2024-11-02 08:59:45 +01:00
Ariel Otilibili cd5877daf0 Refactored `glances.plugins.ip.PluginModel.update`
* part of #2801
* formatted into a dict; if input method is SNMP, returns default stats
* if input method is local, calls `get_stats_for_local_input`
* it has three steps:  `get_private_ipv4`, `get_first_ipv4`, `get_public_ipv4`.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-11-01 21:06:14 +01:00
nicolargo d538b2dd13 First step done - Rest server are managed in the current TUI client browser 2024-11-01 14:29:33 +01:00
nicolargo f12de6619b Publish a new snap release 2024-11-01 12:01:34 +01:00
nicolargo ce0fc37952 Disable attestations check 2024-11-01 11:53:12 +01:00
nicolargo 1f5deb3f83 Disable attestations check 2024-11-01 11:46:39 +01:00
nicolargo ac8cd748f3 Merge branch 'master' into develop 2024-11-01 11:24:14 +01:00
nicolargo ccf837eb9f Add attestations to allow publishing to Pypi 2024-11-01 11:21:28 +01:00
nicolargo 23f4c55147 On the road again (again) to Glances 4.3.0 2024-11-01 11:04:44 +01:00
nicolargo 6095eadd30 Did not generate Pypi test if not on the develop branch 2024-11-01 10:53:52 +01:00
nicolargo 5a3ce6e8aa version 4.2.1 2024-11-01 10:38:11 +01:00
nicolargo 72f142d2ac Update requirements 2024-11-01 10:20:12 +01:00
nicolargo 1f505dda60 [WEBUI] Came back to default Black Theme / Reduce font size #2993 2024-11-01 09:55:47 +01:00
nicolargo a3b8ca83d4 Format code 2024-11-01 07:40:38 +01:00
nicolargo 63c7cfcfe8 Format code 2024-11-01 07:37:54 +01:00
Bharath Vignesh J K 6ee3683172 fix: ReST API - typing imports support for py38
fixes #2992
2024-11-01 02:10:24 +05:30
Nicolas Hennion 8767de51f2 Correct issue with variable name in the last commit 2024-10-31 16:31:48 +00:00
Nicolas Hennion ac7ab9ea84 Do not display error message in loop when containers list can not be retrieve (only first time after a failure). 2024-10-31 16:28:56 +00:00
Nicolas Hennion 49d15b20da Avoid importing pynvml if NVML_LIB is not installed 2024-10-31 16:09:59 +00:00
Nicolas Hennion a6956bf7ee Possible memory leak #2976 2024-10-31 15:39:13 +00:00
nicolargo a2c609ca6f Update WebUI 2024-10-26 17:14:12 +02:00
nicolargo ffba4ca6f4 hide_zero=True option not working in the WebUI #2987 2024-10-26 12:37:56 +02:00
nicolargo 5b091f413b Non blocking error message when Glances starts from a container (alpine-dev image) #2991 2024-10-26 10:54:53 +02:00
nicolargo 34da61647b Non blocking error message when Glances starts from a container (alpine-dev image) #2991 2024-10-26 10:53:15 +02:00
Nicolas Hennion ff1cde4ffb
Merge pull request #2990 from branchvincent/pyproject
Make pyproject.toml's version dynamic
2024-10-24 08:13:26 +02:00
Branch Vincent 0e40ec657e
Make pyproject.toml's version dynamic 2024-10-23 15:19:02 -07:00
Branch Vincent 47da2a6967
Revert "Set the version by reading directly the pyproject file in local (dev and Docker) - Related to #2956"
This reverts commit 68104b7d0f.
2024-10-23 15:16:20 -07:00
Branch Vincent 6479a6c38d
Revert "Set the version by reading directly the pyproject file in local (dev and Docker) - Related to #2956"
This reverts commit 604d805828.
2024-10-23 15:16:10 -07:00
nicolargo 604d805828 Set the version by reading directly the pyproject file in local (dev and Docker) - Related to #2956 2024-10-23 23:12:55 +02:00
nicolargo 68104b7d0f Set the version by reading directly the pyproject file in local (dev and Docker) - Related to #2956 2024-10-23 23:03:43 +02:00
Nicolas Hennion 2d0dcb18e1
Merge pull request #2977 from ariel-anieli/pretty-date
Refactored `glances.globals.pretty_date()`, version 2
2024-10-23 22:29:36 +02:00
nicolargo b2b6879dd5 Update version (in order to test #2956) and rebuild the Web UI 2024-10-23 22:06:08 +02:00
nicolargo 039dd00c96 Desable warning message concerning version when executed in local - Related to #2956 2024-10-23 22:02:06 +02:00
Nicolas Hennion 4f692fa185
Merge pull request #2984 from branchvincent/pyproject
Migrate to pyproject.toml, add 3.13 support
2024-10-23 21:53:22 +02:00
nicolargo 5732a52fbc Update docs 2024-10-23 21:29:37 +02:00
Nicolas Hennion 88a804b57b
Merge pull request #2985 from uoguelph-engg4450/Lukas-Dev
Implement Improve hide_zero option #2958
2024-10-23 21:07:30 +02:00
nicolargo d343131487 Add id-token action to deploy with trusted publisher for release 2024-10-23 20:33:36 +02:00
nicolargo 0bbbd8fce2 Add id-token action to deploy with trusted publisher 2024-10-23 20:24:58 +02:00
Ariel Otilibili 9e1d977a26 Refactored `glances.globals.pretty_date()`, version 2
* part of #2801
* follows from f6279baacd4cf0b27ca10df6dc01f091ea86a40a; which caused #2973.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-10-22 22:35:51 +02:00
Tacitor 9ad511ad05 add the changes to give a threshold in the config to cut off small values 2024-10-20 21:46:43 -04:00
Tacitor 31abc57c2a add a todo statement 2024-10-20 20:15:15 -04:00
Branch Vincent 04a1770ebd
Add 3.13 support 2024-10-20 12:30:55 -07:00
Branch Vincent 44ae3e5f0b
Migrate to pyproject.toml 2024-10-20 12:13:54 -07:00
nicolargo 73fd34e588 Remove token from Github action 2024-10-20 18:56:50 +02:00
nicolargo e02d95083b On the road of Glances 4.3.0 2024-10-20 18:29:49 +02:00
nicolargo a8608f17d6 version 4.2.0 2024-10-20 18:02:15 +02:00
nicolargo 7d44a2f554 Solve merge conflict 2024-10-20 17:38:57 +02:00
nicolargo d67d4e3d0e Glances 4.2.0 2024-10-20 17:37:34 +02:00
nicolargo e1f7ec252f Unit test with epoch fail on Github because of the timezone, remove it from test_021 2024-10-20 14:04:10 +02:00
nicolargo c2cb7cc788 Correct some minor issue in SNMP mode 2024-10-19 19:31:13 +02:00
nicolargo ddb7cfabc7 Do not display Unknown information in the cloud plugin #2485 2024-10-19 18:35:35 +02:00
nicolargo ea11ee9243 Incomplete pipx install to allow webui + containers #2955 2024-10-19 17:27:54 +02:00
nicolargo 9cf60be628 Remove unused lib in globals.py 2024-10-19 15:31:01 +02:00
nicolargo 5f3350e62f Merge branch 'issue2979' into develop 2024-10-19 15:27:43 +02:00
nicolargo 315678b5bd Use defusedxml lib #2979 2024-10-19 15:27:13 +02:00
nicolargo d39d7c7dfa In TUI, when processes are filtered, column are not aligned #2980 2024-10-19 14:57:53 +02:00
nicolargo cac964df3c Merge branch 'issue2942' into develop 2024-10-19 10:17:21 +02:00
nicolargo 06ab6144b4 Can't kill process. Standalone, Ubuntu 24.04 #2942 2024-10-19 10:16:50 +02:00
nicolargo a1c0be479f Erreur Internal Server Error à partir de la V4.1.0 et suivante #2943 2024-10-19 09:59:15 +02:00
nicolargo dc8707ad33 Update docs 2024-10-19 09:52:04 +02:00
nicolargo eed2ec954a Lint and format 2024-10-19 09:36:56 +02:00
nicolargo 4afe46a2cb Make feature #1289 compatible with multiple keys 2024-10-13 17:45:45 +02:00
nicolargo 119add783e Add additional test for pretty-date 2024-10-13 16:38:49 +02:00
nicolargo 13606da667 Update WebUI 2024-10-13 16:30:58 +02:00
nicolargo db9785e37f Add unitary tests for pretty-date 2024-10-13 16:28:28 +02:00
nicolargo 7f2454154f Filter Docker containers - #2962 2024-10-13 15:42:13 +02:00
Nicolas Hennion 8b8c61cc7c
Merge pull request #2975 from nicolargo/revert-2961-pretty-date
Revert "Refactored `glances.globals.pretty_date()`"
2024-10-13 14:55:17 +02:00
Nicolas Hennion 25b87a08ae
Revert "Refactored `glances.globals.pretty_date()`" 2024-10-13 14:54:27 +02:00
Nicolas Hennion 0cdf2d62e7
Merge pull request #2974 from casse-boubou/Add-'Availability'-topic-to-MQTT-connection
Add retain to availability topic
2024-10-13 14:48:00 +02:00
Github GPG acces 252f593bcc
reformatted for pass ruff test 2024-10-13 11:06:03 +02:00
Github GPG acces 4eb5f540c1
Add retain to availability topic
Added the forgotten topic retain, but important for this kind of data
2024-10-13 10:45:23 +02:00
nicolargo 77e9eb3306 Merge branch 'develop' of github.com:nicolargo/glances into develop 2024-10-12 09:59:41 +02:00
nicolargo a1b07690e4 Refactor WebUI responsive 2024-10-12 09:59:30 +02:00
Nicolas Hennion e57eeb8089
Merge pull request #2961 from ariel-anieli/pretty-date
Refactored `glances.globals.pretty_date()`
2024-10-09 10:01:21 +02:00
Ariel Otilibili f6279baacd Refactored `glances.globals.pretty_date()`
* part of #2801
* instead of many, a single return point is used
* refactoring possible because `OrderedDict` preserve insertion order [1]
* though `dict` preverse order since 3.6, used `OrderedDict` for safety [2]
* introduced as helpers:

1. `get_diff_time`
2. `get_msg_for_true_cond`
3. `get_conds_for_sec_diff_msg`
4. `get_conds_for_day_diff_msg`.

[1] https://docs.python.org/3/library/collections.html#collections.OrderedDict
[2] https://peps.python.org/pep-0520/

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-10-08 20:26:20 +02:00
nicolargo adfb642539 Improve docs for Web API 2024-10-06 17:49:45 +02:00
Nicolas Hennion 702b747d9d
Merge pull request #2960 from casse-boubou/Add-'Availability'-topic-to-MQTT-connection
Add 'Availability' topic to MQTT connection
2024-10-06 17:19:31 +02:00
Nicolas Hennion b2a2a96292
Merge pull request #2959 from ariel-anieli/plugins-port-alerts
Reduced `get_web_alert` & `get_ports_alert`
2024-10-06 17:17:38 +02:00
nicolargo 65abadfe00 Remove default conf (column def) from the config file 2024-10-06 17:16:16 +02:00
Github GPG acces 2af34b3069
Add 'Availability' topic to MQTT connection
Addition of the 'availability' topic: Online or Offline when using the --export MQTT option in the case where other devices on the same broker are looking for our Glances instance
2024-10-06 15:12:45 +02:00
Ariel Otilibili f8fe7e2d64 Reduced `get_web_alert` & `get_ports_alert`
* sequel of cbd166bf0baef31650f67cda4f357c8f4de38064; part of #2801
* `get_web_alert` & `get_ports_alert` rely on `get_p_alert`
* each needs an helper: if `get_web_alert`, the helper is `get_conds_if_url`
* if `get_ports_alert`, it is `get_conds_if_port`
* `get_p_alert` uses the helper with `get_default_ret_value`.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-10-06 12:01:51 +02:00
nicolargo 10cc1dbe82 Merge branch 'issue1289' into develop 2024-10-06 11:20:25 +02:00
nicolargo 56d7801afb Feature request: make the central client UI configurable (example: GPU status) #1289 2024-10-06 11:20:12 +02:00
Nicolas Hennion 6e485a2bad
Merge pull request #2957 from ariel-anieli/plugin-port-msg
Fixed typos, refactored  `glances.plugins.ports.PluginModel.msg_curse()`
2024-10-05 13:06:35 +02:00
nicolargo f27c39c74a Update docs 2024-10-05 13:03:40 +02:00
nicolargo 612615bc79 Merge branch 'issue2914' into develop 2024-10-05 13:01:55 +02:00
nicolargo 3a860dd4c2 Merge branch 'develop' into issue2914 2024-10-05 13:01:38 +02:00
nicolargo e2d3179c43 Help also done 2024-10-05 13:00:46 +02:00
Ariel Otilibili cbd166bf0b Refactored `glances.plugins.ports.PluginModel.msg_curse()`
Part of #2801.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-10-04 21:43:25 +02:00
Ariel Otilibili 3ede32a359 Fixed typos
```
$ git grep 'emptu' | awk -F: '{print $1}' | xargs -I {} sed -ie 's/emptu/empty/' {}; echo $?
0
```

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-10-04 20:20:12 +02:00
Nicolas Hennion 7ab8a39846
Merge pull request #2954 from ariel-anieli/makefile
Refactored `webui*` rules
2024-10-02 15:05:54 +02:00
nicolargo 3f97874c63 Almost ok 2024-09-29 18:52:42 +02:00
nicolargo 2e1abd3986 Docne for containers and processlist and amps 2024-09-28 18:28:10 +02:00
Ariel Otilibili dec419f443 Refactored `webui*` rules
* part of #2906
* output is unchanged.

```
$ git log --oneline -n1 --pretty=short
commit f2f97e2f (HEAD -> makefile)
Author: Ariel Otilibili <otilibil@eurecom.fr>

    Refactored `webui*` rules

$ make webui -n >> /tmp/makefile; echo $?
0

$ make webui-audit -n >> /tmp/makefile; echo $?
0

$ make webui-audit-fix -n >> /tmp/makefile; echo $?
0

$ git switch develop
Switched to branch 'develop'
Your branch is up to date with 'origin/develop'.

$ git log --oneline -n1 --pretty=short
commit 24c87253 (HEAD -> develop, origin/develop, origin/HEAD)
Merge: 42af55b3 fa7fc5bd
Author: Nicolas Hennion <nicolashennion@gmail.com>

    Merge pull request #2941 from ariel-anieli/refactor-alert

$ make webui -n >> /tmp/develop; echo $?
0

$ make webui-audit -n >> /tmp/develop; echo $?
0

$ make webui-audit-fix -n >> /tmp/develop; echo $?
0

$ diff /tmp/develop /tmp/makefile; echo $?
0
```

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-09-23 22:47:56 +02:00
Nicolas Hennion 24c8725359
Merge pull request #2941 from ariel-anieli/refactor-alert
Refactorized alert plugin
2024-09-23 14:19:27 +02:00
Nicolas Hennion 42af55b317
Merge pull request #2950 from ariel-anieli/revert-commit-01823df9
Refactorized `_GlancesCurses.display_plugin()`, version 2
2024-09-23 14:16:46 +02:00
nicolargo 7fee42f940 Top bar is ok 2024-09-22 10:15:26 +02:00
Ariel Otilibili 4bcbc12cea Refactorized `_GlancesCurses.display_plugin()`, version 2
Part of #2801. Broken down using:

1. `setup_upper_left_pos`
2. `get_next_x_and_x_max`
3. `display_stats_with_current_size`
4. `display_stats`

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-09-17 18:55:48 +02:00
Ariel Otilibili 400013bb4a Revert "Refactorized `_GlancesCurses.display_plugin()`"
* reverted commit 01823df917
* that commit introduced #2949.
2024-09-16 20:10:35 +02:00
nicolargo 61480109d6 Migration to Table bootstrap is on going 2024-09-16 08:05:32 +02:00
nicolargo ccda282bbf Build ok but CSS style is a mess 2024-09-14 16:23:18 +02:00
Ariel Otilibili fa7fc5bdcd Refactorized alert plugin
* closes #2416
* `msg_curse` calls `loop_over_alert`
* `loop_over_alert` loops each alert with:

    1. `add_new_line`
    2. `add_start_time`
    3. `add_duration`
    4. `add_infos`
    5. `add_min_mean_max`
    6. `add_top_proc`

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-09-14 12:40:53 +02:00
nicolargo 75fdc8f46e Remove test 2024-09-14 09:54:10 +02:00
nicolargo 10c98f6fda Merge branch 'issue2939' into develop 2024-09-14 09:53:09 +02:00
nicolargo 7d3904e89f The Web interface ignores the strftime_format parameter #2939 2024-09-14 09:52:51 +02:00
Nicolas Hennion a1cb3630b8
Merge pull request #2932 from ariel-anieli/refactorize-display-plugin
Refactorized `_GlancesCurses.display_plugin()`
2024-09-14 09:42:02 +02:00
Ariel Otilibili 01823df917 Refactorized `_GlancesCurses.display_plugin()`
Part of #2801. The flow is the same. Used as helpers:

    1. `self.set_upper_left_pos`
    2. `self.goto_next_and_ret_first_col`
    3. `self.check_opt_and_add`
    4. `self.x_overbound`
    5. `self.y_overbound`
    6. `self.display_msg`

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-09-13 10:36:24 +02:00
nicolargo b9843a1d8c Merge branch 'issue2929' into develop 2024-09-08 19:17:30 +02:00
nicolargo 36755ba4be Show only active Disk I/O (and network interface) #2929 2024-09-08 19:17:07 +02:00
RazCrimson a3895e49b6
Merge pull request #2938 from nicolargo/feature/json-serialization-fallbacks
JSON serialization fallbacks on ujson and builtin json lib
2024-09-08 15:37:39 +05:30
RazCrimson e9ae9ff61b chg: globals - datetime serialization support without orjson 2024-09-08 15:26:03 +05:30
RazCrimson 1fa173edbc chg: restful_api - avoid duplicating checks + basic typing 2024-09-08 14:44:49 +05:30
RazCrimson 6dc16e92ea chore: restful_api - remove unused code 2024-09-08 14:44:15 +05:30
RazCrimson 2a5251ca2d chg: restful_api - use internal serialization features 2024-09-08 14:44:15 +05:30
RazCrimson 538013d192 chg: globals - standardize json_dumps return type to bytes 2024-09-08 14:25:26 +05:30
RazCrimson 46054afd22 chg: globals - json lib preference: orjson > ujson > json 2024-09-08 14:25:26 +05:30
RazCrimson adfa85e8ab chore: fix typos 2024-09-08 12:31:24 +05:30
Bharath Vignesh J K 7598fbed54 chg: remove orjson from base requirements.txt 2024-08-28 00:10:23 +05:30
Bharath Vignesh J K 1e278fa2cb chg: make orjson optional 2024-08-28 00:10:13 +05:30
nicolargo 92de3be0a1 Stick FastAPI version to 0.82.0 or higher (latest is better) - Related to #2926 2024-08-26 17:20:05 +02:00
nicolargo 9432d9361e Improve user message when Glances WebUI/RestAPI is ran 2024-08-24 15:53:20 +02:00
nicolargo 76478959cc Correct issue in Makefile 2024-08-24 09:32:01 +02:00
Nicolas Hennion 37457ed892
Merge pull request #2924 from ariel-anieli/makefile
Refactorized rules targetting `profiling-*` & `memory-profiling`
2024-08-24 09:12:47 +02:00
RazCrimson 2493a1929f
Merge pull request #2925 from nicolargo/standardize-history-display-timestamp
chg: alerts - standardise history display timings
2024-08-19 00:04:18 +05:30
Bharath Vignesh J K 16d56109c8 chg: alerts - standardise history display timings 2024-08-19 00:01:59 +05:30
Ariel Otilibili 962ea850ed Refactorized rules targetting `profiling-*` & `memory-profiling`
Part of #2906:

* `profiling-*` share the same start banner
* used `OUT_DIR` for static outputs
* `TIMES` controls the number of iterations.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-18 15:26:21 +02:00
RazCrimson 74a8b0bf34
Merge pull request #2923 from nicolargo/fix-typing-issues-for-py38-compatibility
fix: typing - compatibility with py3.8
2024-08-18 14:27:57 +05:30
Bharath Vignesh J K 73ff388400 fix: typing - compatibility with py3.8
closes #2922
2024-08-18 14:25:50 +05:30
nicolargo d9fc2ca231 Update snap configuration 2024-08-18 10:20:11 +02:00
Nicolas Hennion 504cf0613f
Merge pull request #2919 from ariel-anieli/refactor-plugin-model-msg-curse
Refactorized `glances.plugins.containers.PluginModel.msg_curse()`
2024-08-18 09:36:25 +02:00
Ariel Otilibili fa6d46c0c1 Refactorized `glances.plugins.containers.PluginModel.msg_curse()`
Part of #2801. Broken down in:

* `build_title`
* `build_header`
* on each container, `build_data_line` calls `build_container_data`.

`build_container_data` does for a container:

* `maybe_add_engine_name_or_pod_name`
* `build_container_name`
* `build_status_name`
* `build_uptime_line`
* `build_cpu_line`
* `build_memory_line`
* `build_io_line`
* `build_net_line`
* `build_cmd_line`.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-17 23:53:46 +02:00
nicolargo c9525b8a5a Manage the all option (in the Vms plugin) 2024-08-16 09:49:11 +02:00
nicolargo 8e4b9d9215 Only display VMs with a running status (in the Vms plugin) 2024-08-16 09:43:26 +02:00
nicolargo 6fa969adf4 api/4/vms returns a dict, thus breaking make test-restful #2918 2024-08-16 09:25:37 +02:00
nicolargo fbca700562 Disable Webui audit fix in the CI, 2024-08-11 18:45:21 +02:00
Nicolas Hennion c0aa754ebc
Merge pull request #2917 from ariel-anieli/makefile
Used patterns for rules targetting `venv`, `venv-python`, `venv-upgrade`
2024-08-11 18:28:09 +02:00
Nicolas Hennion fcbee3518c
Merge pull request #2915 from ariel-anieli/refactor-process-thread
Reduced complexity of `PluginModel.__msg_curse_extended_process_thread()`
2024-08-11 18:27:06 +02:00
Ariel Otilibili 13079a606b Used patterns rules in `venv`, `venv-python`, & `venv-python`
* `venv-*-python` relies on the pattern `venv-%-python`
* `venv-(full|min|dev)` & `venv-*-upgrade` on `venv-%`
* macros `UPGRADE`, `PRE_COMMIT`, `VIRTUAL_ENV`, & `REQS` are rule switches
* `VIRTUAL_ENV` being evaluated at runtime from `DEFINE_VARS_FOR_TYPE`
* `make help` is unchanged.

```
$ make venv -n
virtualenv -p /usr/bin/python3 venv
virtualenv -p /usr/bin/python3 venv-min
virtualenv -p /usr/bin/python3 venv-dev
venv/bin/pip install  -r requirements.txt;  venv/bin/pip install  -r optional-requirements.txt;
venv-min/bin/pip install  -r requirements.txt;
venv-dev/bin/pip install  -r dev-requirements.txt;  venv-dev/bin/pip install  -r doc-requirements.txt;
venv-dev/bin/pre-commit install --hook-type pre-commit

$ make venv-python -n
virtualenv -p /usr/bin/python3 venv
virtualenv -p /usr/bin/python3 venv-min
virtualenv -p /usr/bin/python3 venv-dev

$ make venv-upgrade -n
venv/bin/install install --upgrade pip
venv/bin/pip install --upgrade -r requirements.txt;  venv/bin/pip install --upgrade -r optional-requirements.txt;
venv-min/bin/install install --upgrade pip
venv-min/bin/pip install --upgrade -r requirements.txt;
venv-dev/bin/install install --upgrade pip
venv-dev/bin/pip install --upgrade -r dev-requirements.txt;  venv-dev/bin/pip install --upgrade -r doc-requirements.txt;
```

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-11 17:45:21 +02:00
Ariel Otilibili feac10a84d Renamed macros in Makefile
* `s/VENV/venv_full/; s/VENV_MIN/venv_min/; s/VENV_DEV/venv_dev/;`
* useful in subsequent changes

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-11 17:40:27 +02:00
Ariel Otilibili 916aabcfd9 Reduced complexity of `PluginModel.__msg_curse_extended_process_thread()`
Part of #2801. `ret` goes through these steps:

* `add_title_line`
* `add_cpu_line`
* `maybe_add_cpu_affinity_line`
* `maybe_add_ionice_line`
* `add_memory_line`
* `add_io_and_network_lines`
* `append_newlines`

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-11 12:23:41 +02:00
nicolargo 9c09d6b4a4 url_prefix do not work in Glances < 4.2.0 - Correct issue with mount #2912 2024-08-10 14:58:59 +02:00
Nicolas Hennion 7f049669fb
Merge pull request #2913 from ariel-anieli/makefile
Renamed variables in `Makefile`; rules targetting `docker-*` are now built at runtime
2024-08-10 11:32:28 +02:00
nicolargo 0003768bb8 url_prefix do not work in Glances < 4.2.0 #2912 2024-08-10 10:18:49 +02:00
Ariel Otilibili a37010929d Rules targetting `docker-*` are now built at runtime
* removed the macros `DOCKERFILE`, `TARGET`, & `DOCKER_TAG`
* introduced the macro `MAKE_DOCKER_BUILD_RULES`
* at runtime, `docker-*` are built from the `DISTROS` list: done using `eval` [1]
* `make help` is unchanged:

```
$ make | grep '\sdocker-'
make docker-alpine                                       Generate local docker images (Alpine)
make docker-alpine-dev                                   Generate local docker image (Alpine dev)
make docker-alpine-full                                  Generate local docker image (Alpine full)
make docker-alpine-minimal                               Generate local docker image (Alpine minimal)
make docker-ubuntu                                       Generate local docker images (Ubuntu)
make docker-ubuntu-dev                                   Generate local docker image (Ubuntu dev)
make docker-ubuntu-full                                  Generate local docker image (Ubuntu full)
make docker-ubuntu-minimal                               Generate local docker image (Ubuntu minimal)

$ make docker -n
docker buildx build --target full -f docker-files/alpine.Dockerfile -t glances:local-alpine-full .
docker buildx build --target minimal -f docker-files/alpine.Dockerfile -t glances:local-alpine-minimal .
docker buildx build --target dev -f docker-files/alpine.Dockerfile -t glances:local-alpine-dev .
docker buildx build --target full -f docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-full .
docker buildx build --target minimal -f docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-minimal .
docker buildx build --target dev -f docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-dev .
```

[1] https://www.gnu.org/software/make/manual/html_node/Eval-Function.html

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-10 09:23:37 +02:00
Ariel Otilibili ddfcf46dee Renamed variables in `Makefile`; introduced the variable `DISTROS`
* needed for subsequent changes in `Makefile`
* `s/ALPINE_IMAGES/alpine_images/; s/UBUNTU_IMAGES/ubuntu_images/`

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-10 09:17:30 +02:00
Nicolas Hennion 69290ee405
Merge pull request #2910 from ariel-anieli/makefile
Refactorized `Makefile` by using pattern rules
2024-08-09 17:21:50 +02:00
Nicolas Hennion e40aa05e8a
Merge pull request #2900 from ariel-anieli/issue-2801-catch-key
Reduced complexity of `_GlancesCurses.__catch_key()`
2024-08-09 17:15:53 +02:00
Ariel Otilibili f5c2d8ce36 Used pattern for rules targetting `run-docker-*`
`make help` & `make run-docker-*` are unchanged:

```
$ make | grep run-docker
make run-docker-alpine-dev                               Start Glances Alpine Docker dev in console mode
make run-docker-alpine-full                              Start Glances Alpine Docker full in console mode
make run-docker-alpine-minimal                           Start Glances Alpine Docker minimal in console mode
make run-docker-ubuntu-dev                               Start Glances Ubuntu Docker dev in console mode
make run-docker-ubuntu-full                              Start Glances Ubuntu Docker full in console mode
make run-docker-ubuntu-minimal                           Start Glances Ubuntu Docker minimal in console mode

$ make run-docker-alpine-minimal -n
docker run --rm -e TZ="" -e GLANCES_OPT="" --pid host --network host -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro -v /var/run/docker.sock:/var/run/docker.sock:ro -it glances:local-alpine-minimal

$ make run-docker-alpine-full -n
docker run --rm -e TZ="" -e GLANCES_OPT="" --pid host --network host -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro -v /var/run/docker.sock:/var/run/docker.sock:ro -it glances:local-alpine-full

$ make run-docker-alpine-dev -n
docker run --rm -e TZ="" -e GLANCES_OPT="" --pid host --network host -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro -v /var/run/docker.sock:/var/run/docker.sock:ro -it glances:local-alpine-dev

$ make run-docker-ubuntu-dev -n
docker run --rm -e TZ="" -e GLANCES_OPT="" --pid host --network host -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro -v /var/run/docker.sock:/var/run/docker.sock:ro -it glances:local-ubuntu-dev

$ make run-docker-ubuntu-full -n
docker run --rm -e TZ="" -e GLANCES_OPT="" --pid host --network host -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro -v /var/run/docker.sock:/var/run/docker.sock:ro -it glances:local-ubuntu-full

$ make run-docker-ubuntu-minimal -n
docker run --rm -e TZ="" -e GLANCES_OPT="" --pid host --network host -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro -v /var/run/docker.sock:/var/run/docker.sock:ro -it glances:local-ubuntu-minimal
```

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-08 12:28:58 +02:00
Ariel Otilibili 516c99e496 Used pattern for rules targetting `docker-*`
`make help` & `make docker-*` are unchanged:

```
$ make | grep -P '\sdocker-'
make docker-alpine                                       Generate local docker images (Alpine)
make docker-alpine-dev                                   Generate local docker image (Alpine dev)
make docker-alpine-full                                  Generate local docker image (Alpine full)
make docker-alpine-minimal                               Generate local docker image (Alpine minimal)
make docker-ubuntu                                       Generate local docker images (Ubuntu)
make docker-ubuntu-dev                                   Generate local docker image (Ubuntu dev)
make docker-ubuntu-full                                  Generate local docker image (Ubuntu full)
make docker-ubuntu-minimal                               Generate local docker image (Ubuntu minimal)

$ make docker-alpine -n
docker buildx build --target full -f docker-files/alpine.Dockerfile -t glances:local-alpine-full .
docker buildx build --target minimal -f docker-files/alpine.Dockerfile -t glances:local-alpine-minimal .
docker buildx build --target dev -f docker-files/alpine.Dockerfile -t glances:local-alpine-dev .

$ make docker-ubuntu -n
docker buildx build --target full -f docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-full .
docker buildx build --target minimal -f docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-minimal .
docker buildx build --target dev -f docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-dev .
```

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-08 12:28:58 +02:00
Ariel Otilibili 1fef2594d2 Used pattern for rules targetting `test-*`
`make help` & `make test-*` are unchanged:

```
$ make | grep test
make test                                                Run unit tests
make test-core                                           Run core unit tests
make test-min                                            Run core unit tests in minimal environment
make test-min-with-upgrade                               Upgrade deps and run unit tests in minimal environment
make test-restful                                        Run Restful unit tests
make test-with-upgrade                                   Upgrade deps and run unit tests
make test-xmlrpc                                         Run XMLRPC unit tests

$ make test -n
venv/bin/python unittest-core.py
venv/bin/python unittest-restful.py
venv/bin/python unittest-xmlrpc.py
```

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-08 12:28:51 +02:00
RazCrimson c5f06b3847
Merge pull request #2911 from nicolargo/2908-raid-plugin-breaks-with-inactive-raid0-arrays
fix: plugin (raid) - Show degradation only when stats are available
2024-08-08 07:58:57 +05:30
Bharath Vignesh J K 16e5bb2023 fix: plugin (raid) - Show degradation only when stats are available
fixes #2908
2024-08-08 07:58:17 +05:30
RazCrimson 69f4a5fe24
Merge pull request #2907 from ariel-anieli/refactorize-makefile
Refactorize `Makefile`
2024-08-07 18:40:39 +05:30
Ariel Otilibili 0804d06c0b Refactorized `make flatpak`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-07 07:37:48 +02:00
Ariel Otilibili b03ea17a5f Refactorized the rules targetting `docker-*`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-07 07:37:48 +02:00
Ariel Otilibili 6910e61bde Refactorized `make semgrep`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-07 07:37:48 +02:00
Ariel Otilibili a6fdc098b9 Refactorized the rules targetting `docs-*`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-07 07:37:48 +02:00
Ariel Otilibili 313612333c Refactorized `trace-malloc` and the rules targetting `memory-*`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-07 07:37:48 +02:00
Ariel Otilibili cad29145f1 Refactorized the rules targetting `profiling-*`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-07 07:37:48 +02:00
Ariel Otilibili 4dba2f13ad Refactorized `format`, `lint`, & `codespell` rules
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-07 07:37:48 +02:00
Ariel Otilibili c171d7604e Refactorized the rules targetting `test*`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-07 07:37:48 +02:00
Ariel Otilibili 658e318fd7 Refactorized the rules targetting `venv-*`
Addressed `venv-full-*`, `venv-min-*`, & `venv-dev-*`.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-07 07:37:48 +02:00
Ariel Otilibili 76cd7e63e2 Refactorized `make help`
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-07 07:37:48 +02:00
Ariel Otilibili 020fe7a0b2 Placed phony targets under the same rule
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-07 07:37:48 +02:00
Ariel Otilibili c96c778883 Refactorized the rules targetting `run*`
* refactorized the rules targetting `run*`
* set up variables for subsequent refactorizations.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-07 07:37:48 +02:00
Bharath Vignesh J K 4dd732b4d1 chg: deps - cap pysnmp-lextudio ro 6.1.* until migration to async API
Issue tracked at #2874
2024-08-07 07:42:44 +05:30
Bharath Vignesh J K a7402b1e94 Revert "chg: curses - change colors for some LOG styles"
This reverts commit 5ef7238298.
2024-08-07 07:33:58 +05:30
Ariel Otilibili 7c45563991 Fixed typo in API documentation
Found with `make codespell`.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-08-06 20:47:32 +02:00
RazCrimson 99ba0d0a84
Merge pull request #2903 from nicolargo/2882-make-fields-labelled-in-green-easier-to-see
chg: curses - change colors for some LOG styles
2024-07-30 23:51:56 +05:30
Bharath Vignesh J K 5ef7238298 chg: curses - change colors for some LOG styles
fix #2882
2024-07-30 23:50:27 +05:30
Ariel Otilibili 1b199ada75 Reduced complexity of `_GlancesCurses.__catch_key()`
Part of #2801. Broken down `__catch_key` in two parts:

* `catch_actions_from_hotkey`
* `catch_other_actions_maybe_return_to_browser`.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-07-27 16:49:31 +02:00
nicolargo e03632459b Add VMs to unittest 2024-07-27 08:21:43 +02:00
Ariel Otilibili 98e8e32457 Reduced complexity of `unittest-core.TestGlances._common_plugin_tests()`
Part of #2801. Common tests follows the flow:

* `reset_stats_history_and_views`
* `do_checks_before_update`
* add first element with `update_stats`
* `check_stats`
* `filter_stats`
* add second element `update_stats`
* `chk_hist_maybe_add_third_elem`
* `check_views`.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-07-27 02:09:49 +02:00
nicolargo 81a529dbad Crash when terminal is resized #2872 2024-07-26 11:30:53 +02:00
nicolargo 52a129a3e8 Migration to Alpine 3.20 and Python 3.12 for Alpine Docker 2024-07-26 11:03:38 +02:00
nicolargo aacc12df45 Correct linter issue https://github.com/nicolargo/glances/actions/runs/10108117146/job/27953472522 - Related to PR #2891 2024-07-26 10:46:04 +02:00
nicolargo 2b30c9986f Add VMs section (disabled by default) in the Docker glances.conf file 2024-07-26 10:20:47 +02:00
Nicolas Hennion fbd0eee5c4
Merge pull request #2891 from ariel-anieli/issue-2801-plugin-msg-curse
Reduced complexity of `glances.plugins.percpu.PluginModel.msg_curse()`
2024-07-26 10:18:24 +02:00
Ariel Otilibili 6059b9ab42 Reduced complexity of `glances.plugins.percpu.PluginModel.msg_curse()`
Part of #2801. Broken `msg_curse`: if no stats returns empty list, else:

1. `define_headers_from_os`
2. `maybe_build_string_msg`
3. `display_cpu_stats_per_line`
4. `manage_max_cpu_to_display`
5. Then, for CPU:
   * `display_cpu_header_in_columns`
   * `display_cpu_stats_in_columns`
6. Hence, `summarize_all_cpus_not_displayed`

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-07-25 00:14:48 +02:00
nicolargo e38e2ce831 beta04 2024-07-24 15:53:30 +02:00
nicolargo d10b4bdc71 Reformat file with Ruff 2024-07-24 15:52:04 +02:00
nicolargo 80d07615f4 Merge branch 'issue2252' into develop 2024-07-24 15:47:36 +02:00
nicolargo 81f6ec03b4 Merge branch 'develop' into issue2252 2024-07-24 15:47:12 +02:00
Nicolas Hennion 1153d18a37
Merge pull request #2884 from ariel-anieli/issue-2801-plugin-update
Reduced complexity of `glances.plugins.system.PluginModel.update()`
2024-07-24 15:45:31 +02:00
nicolargo 0950e407a7 Catch error when Glances stop 2024-07-24 15:31:55 +02:00
nicolargo 5ed876423f WebUI is OK, had to manage the error when Glances stop, see Github issue #2252 for detail 2024-07-24 11:32:57 +02:00
nicolargo 9d76bfeb3e First version of the Curses UI, miss engine name 2024-07-23 19:34:12 +02:00
Ariel Otilibili 881017e63b Reduced complexity of `glances.plugins.system.PluginModel.update()`
Part of #2801. Broke `update` in two parts:

* if `local`, stats taken from `get_stats_from_std_sys_lib`
* and readability achieved by `add_human_readable_name`
* else if `snmp`, taken from `update_stats_with_snmp`.

`get_stats_from_std_sys_lib` has two helpers:

1. `get_win_version_and_platform`.
2. `get_linux_version_and_distro`.

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
2024-07-22 22:22:48 +02:00
nicolargo 6b036ec0ac Refactor colors Class for Curses UI 2024-07-21 19:16:33 +02:00
RazCrimson e086625f1a
Merge pull request #2877 from Neved4/medium-line
fix: Use `ncurses` dedicated functions for the separator line
2024-07-16 01:06:38 +05:30
Neveda bfdf899615 refactor: Simplify `separator_line()` logic 2024-07-15 13:43:23 +02:00
Neveda e1e3ca9c8a fix: Use `self.term_window.hline()` and `curses.ACS_HLINE` for the separator line 2024-07-15 12:36:03 +02:00
Nicolas Hennion 413df02728
Merge pull request #2873 from ey-jo/fix-docs-path
Corrected path in docs for docker
2024-07-11 16:31:15 +02:00
ey-jo be83a0f735 changing path in docs for docker 2024-07-11 15:13:25 +01:00
RazCrimson 166e6df373
Merge pull request #2867 from Neved4/medium-line
Replace `U+23AF` with `U+2500` for splitlines
2024-07-11 11:29:50 +05:30
Neveda c86f01b7a1 Replace `U+23AF` with `U+2500` 2024-07-11 00:01:42 +02:00
Nicolas Hennion 363a66c263 UodateSnapcraft 2024-07-08 08:54:40 +00:00
nicolargo f603e8412c Add another connector to snap 2024-07-07 18:47:46 +02:00
nicolargo 6f7a09686c Check if server name is not null in the Glances browser - Related to #2861 2024-07-06 08:30:02 +02:00
nicolargo 18bade9edf On the raod again again 2024-07-03 19:50:23 +02:00
nicolargo cc9054d082 Merge branch 'develop' 2024-07-03 19:47:18 +02:00
nicolargo ca41d09845 Glances 4.1.2 2024-07-03 19:47:05 +02:00
nicolargo f8aa98bac7 Glances 4.1.2 2024-07-03 19:43:45 +02:00
nicolargo 90f4934c62 Glances 4.1.2 2024-07-03 19:41:40 +02:00
Bharath Vignesh J K fd99c8008d chore: version patch update for a quick test pypi upload 2024-07-03 17:27:36 +05:30
Bharath Vignesh J K 6af2340c5c chg: plugin(percpu) - show times based on host OS 2024-07-01 10:27:33 +05:30
RazCrimson 46abd4b4c9
Merge pull request #2860 from nicolargo/2859-glances-411-on-windows-attributeerror-cpupercent-object-has-no-attribute-cpu_percent
fix: cpu_percent - initialization timer bugs
2024-07-01 09:33:57 +05:30
Bharath Vignesh J K 2801add7e2 fix: cpu_percent - initialization timer bugs
fixes #2859
2024-07-01 09:33:05 +05:30
nicolargo 9b853d857b Merge branch 'develop' of github.com:nicolargo/glances into develop 2024-06-30 10:18:29 +02:00
Bharath Vignesh J K 99e65079a0 chg: plugin(docker) - add some typing 2024-06-30 03:52:09 +05:30
Bharath Vignesh J K 0e1d462c69 chg: exports (influxdb) - log warning message if export fails 2024-06-30 01:33:51 +05:30
nicolargo f4c7ca01fe Correct codespell 2024-06-29 19:19:26 +02:00
nicolargo 60591630df Improve lisibility of OK_LOG 2024-06-29 19:01:25 +02:00
nicolargo 48103f167e Only test latest Python version on MacOS 2024-06-29 16:43:47 +02:00
nicolargo 154ae8e610 On the road (again) to Glances 4.2.0 2024-06-29 16:36:22 +02:00
nicolargo 1826f07fb3 Glances 4.1.1 2024-06-29 16:32:42 +02:00
nicolargo 86c2cd1d4a Glances 4.1.1 2024-06-29 16:28:50 +02:00
nicolargo 452fd6497e Sensors data is not exported using InfluxDB2 exporter #2856 2024-06-29 16:03:27 +02:00
nicolargo ccfd8f0aa9 On the road of Glances 4.2.0 2024-06-29 10:01:07 +02:00
nicolargo d91bfa2f8b Update docs 2024-06-29 09:55:33 +02:00
nicolargo afa1da59d1 Merge branch 'develop' 2024-06-29 09:54:13 +02:00
nicolargo 582ca07716 Glances 4.1.0 2024-06-29 09:49:36 +02:00
Nicolas Hennion 036eb976e9
Merge pull request #2854 from CognitiveDisson/patch-1
Remove duplicate line from the README file
2024-06-27 06:37:58 +02:00
Vadim Smal 2c5a1150bd
Remove duplicate line from the README file 2024-06-26 23:35:37 +01:00
nicolargo f6066e5d46 PsUtil 6+ no longer check PID reused #2755 2024-06-26 18:56:31 +02:00
nicolargo cff2e9fc4a Call process_iter.clear_cache() (PsUtil 6+) when Glances user force a refresh (F5 or CTRL-R) #2753 2024-06-26 18:36:10 +02:00
nicolargo e5d5351d31 Add cpu model for CPU info (Raspberry PI 5) 2024-06-26 18:12:56 +02:00
nicolargo be89ee0025 Merge remote-tracking branch 'origin/2616-raspberry-pi-cpu-info-is-not-correct' into develop 2024-06-26 18:10:00 +02:00
nicolargo f4cd350221 Update Security messag 2024-06-23 10:50:35 +02:00
nicolargo 3928007169 Merge branch 'issue2849' into develop 2024-06-23 10:23:10 +02:00
nicolargo eebd769c46 perCPU and CPU consumption display time to time a total of 100% #2849 2024-06-23 10:22:37 +02:00
nicolargo 2ee3c86e2b Graph export is broken if there is no graph section in Glances configuration file #2839 2024-06-22 10:37:00 +02:00
nicolargo f5ecbf7a1f Merge branch 'clean-fs-plugin-code' into develop 2024-06-22 10:23:55 +02:00
nicolargo 267e7e2ff0 Clean FS Plugin code 2024-06-22 10:23:37 +02:00
Bharath Vignesh J K 1e2e36af23 chg: cpu_percent - support CPU Name for Raspberry Pi
fixes #2616
2024-06-22 02:32:20 +05:30
Continuous Integration c153e71aa3 Continuous Integration Build Artifacts 2024-06-18 00:13:48 +00:00
RazCrimson f9915d93e8
Merge pull request #2842 from nicolargo/2841-glances-api-status-check-returns-error-405-method-not-allowed
fix: RESTful API - HEAD request not supported on `{version}/status` as mentioned in docs
2024-06-18 05:38:14 +05:30
Bharath Vignesh J K 69c3a948ba fix: RESTful API - HEAD request not supported on `{version}/status` as mentioned in docs
fixes #2841
2024-06-18 05:36:18 +05:30
Nicolas Hennion 8c520e1d94
Update network.rst
Correct alias example
2024-06-17 13:40:11 +02:00
Nicolas Hennion 1edaed52de
Update doc-requirements.txt
Add defusedxml
2024-06-17 13:36:17 +02:00
Nicolas Hennion 752bd40a04
Update doc-requirements.txt
Add PsUutl as a requirement to generate doc.
https://readthedocs.org/projects/glances/builds/24710902/
2024-06-17 13:34:13 +02:00
nicolargo fce3aac34e Add .redthedocs.yaml configuration file 2024-06-16 22:46:36 +02:00
nicolargo 9c482196f3 Add .redthedocs.yaml configuration file 2024-06-16 22:43:55 +02:00
nicolargo 3beb08b66e Merge branch 'issue977' into develop 2024-06-16 17:06:11 +02:00
nicolargo 0874e13f1d Enhance Glances browser color #977 2024-06-16 17:05:53 +02:00
Bharath Vignesh J K 8b4ef8c235 fix: containers (podman) - handle dead infra container with active children 2024-06-16 06:25:46 +05:30
RazCrimson 993ef0107a
Merge pull request #2834 from nicolargo/2827-dont-display-rootless-podman-containers-keyerror
fix: containers (podman) - missing support for rootless mode
2024-06-16 06:11:45 +05:30
Bharath Vignesh J K 0bdda36143 fix: containers (podman) - missing support for rootless mode 2024-06-16 06:04:13 +05:30
nicolargo 7cffdcbff7 Add needs contributor workflow to Github actions 2024-06-15 09:44:05 +02:00
nicolargo 986c865718 Add inactive issues workflow to Github actions 2024-06-15 09:40:14 +02:00
nicolargo 0227d221da [snap] PermissionError: [Errno 13] Permission denied: '/proc/net/wireless' #2829 2024-06-15 08:42:32 +02:00
Continuous Integration 3f39522487 Continuous Integration Build Artifacts 2024-06-15 00:26:00 +00:00
RazCrimson 78b4518547
Merge pull request #2832 from nicolargo/2831-j-hot-key-crashs-glances
fix: plugin (processlist) - failure on programs view
2024-06-15 05:49:58 +05:30
Bharath Vignesh J K ea4ce83d83 fix: plugin (processlist) - failure on programs view
#2831
2024-06-15 05:42:12 +05:30
nicolargo 051006e12f test test_107_fs_plugin_method fails on aarch64-linux #2819 2024-06-09 17:40:28 +02:00
nicolargo 4862264a2a Update bug report template 2024-06-09 17:27:51 +02:00
nicolargo 0791c7e9da --export-process-filter Filter using complete command #2824 2024-06-09 15:17:01 +02:00
nicolargo 12dafcf856 Exception when Glances is ran with limited plugin list #2822 2024-06-09 10:30:34 +02:00
nicolargo 4b071403da Disable separator option do not work... #2823 2024-06-09 10:08:16 +02:00
nicolargo a6b7de8a4b API: Network module is disabled but appears in endpoint all (Glances v4 regression) #2815 2024-06-08 19:30:09 +02:00
nicolargo e371c8f39d API is not compatible with requests containing spcial/encoding char #2820 2024-06-08 18:52:30 +02:00
nicolargo 810b0ec488 Remove some breaking test 2024-06-08 18:02:53 +02:00
nicolargo f224cab225 Impoprove unittest 2024-06-08 17:50:42 +02:00
nicolargo 9b0d0a7ff0 Get back to Glances 4.1.0 2024-06-08 10:29:57 +02:00
nicolargo 1832655793 Glances 4.0.8 - Update release note 2024-06-08 10:27:31 +02:00
nicolargo af06652fa1 Glances 4.0.8 - Update release note 2024-06-08 10:26:19 +02:00
nicolargo bf3bb6a7e8 Glances 4.0.8 2024-06-08 10:25:45 +02:00
nicolargo 8d3b3691e5 Add release note for Glances 4.0.8 2024-06-08 10:19:49 +02:00
nicolargo 13e2f73738 Merge branch 'secureamps' into develop 2024-06-01 18:33:11 +02:00
nicolargo 6077bb4a55 [BREAKING CHANGE in conf file] Secure call to AMPS, use && as commend separator instead of ; 2024-06-01 18:32:51 +02:00
nicolargo 5ad9e89658 Optimize 2024-06-01 18:08:46 +02:00
nicolargo 65f84fd1e9 Raspberry PI - CPU info is not correct #2616 2024-06-01 17:49:22 +02:00
nicolargo b2e5cb58c4 Reduce code complexity #2801 2024-06-01 17:28:52 +02:00
nicolargo 4a60e826b5 Merge branch 'issue2799' into develop 2024-06-01 11:03:24 +02:00
nicolargo d0de547e41 Add support for automatically hiding network interfaces that are down or that don't have any IP addresses #2799 2024-06-01 11:02:58 +02:00
nicolargo d00be34255 Merge branch 'issue2812' into develop 2024-06-01 10:39:34 +02:00
nicolargo 6410ccab9b Make CORS option configurable #2812 2024-06-01 10:38:40 +02:00
nicolargo 350318fb6e Put * in default CORS configuration. Related to discussion #2802 2024-05-29 17:44:24 +02:00
nicolargo 5a78e72419 Optimize Glances configuration file path search 2024-05-28 13:49:11 +02:00
nicolargo 2379ec6b55 Merge branch 'develop' of github.com:nicolargo/glances into develop 2024-05-28 13:31:38 +02:00
nicolargo a55970af83 When Glances is installed via venv, default configuration file is not used #2803 2024-05-28 13:31:22 +02:00
Nicolas Hennion 273a405a10
Update README.rst
Remove py-cpuinfo
2024-05-27 15:04:08 +02:00
nicolargo c187c14b5f Update NEWS file 2024-05-25 16:18:53 +02:00
nicolargo b1b8ea6966 version 4.0.7 2024-05-25 16:12:53 +02:00
Bharath Vignesh J K ad604c1dc5 fix: plugin(sensors) - serialization bug with raw stats 2024-05-25 16:03:14 +02:00
nicolargo a06737c177 cpu_hz_current not available on NetBSD #2792 2024-05-25 16:02:10 +02:00
nicolargo a129c1b337 GET /1272f6e9e8f9d6bfd6de.png results in 404 #2781 2024-05-25 15:45:34 +02:00
nicolargo e5e5cf4c01 cpu_hz_current not available on NetBSD #2792 2024-05-25 12:30:10 +02:00
nicolargo 092ecf5cf8 Correct error witj orjson version: use the latest one 2024-05-25 12:15:38 +02:00
nicolargo 9c446bf8ce version 4.0.6 2024-05-25 12:08:42 +02:00
nicolargo 52f354d5a0 No GPU info on Web View #2796 2024-05-25 12:03:25 +02:00
nicolargo 4b48304324 Merge branch 'issue2796' into develop 2024-05-25 12:02:40 +02:00
nicolargo 79d9aa742b No GPU info on Web View #2796 2024-05-25 12:01:40 +02:00
nicolargo 8d6fabc510 Retire ujson for being in maintenance mode #2791 2024-05-25 10:03:39 +02:00
nicolargo 23cd99d11e Merge branch 'develop' into issue2791 2024-05-25 10:03:21 +02:00
nicolargo 6d2ecf5cf0 Change client and browser call 2024-05-25 10:02:35 +02:00
nicolargo c61d10bec7 Unittest OK 2024-05-25 09:42:02 +02:00
nicolargo 60d6be1718 Better 2024-05-20 19:35:56 +02:00
Bharath Vignesh J K 9ab3199e13 fix: build workflow - missing scope on `cache-from` 2024-05-19 09:37:53 +05:30
Bharath Vignesh J K f6ddc5cf49 chg: build workflow - use scope to prevent multiple os caches from overwriting each other 2024-05-19 08:40:37 +05:30
Bharath Vignesh J K c5ea3d292c chg: build workflow - use newer cache exporter - gha
Ref: https://docs.docker.com/build/cache/backends
2024-05-19 07:33:44 +05:30
Bharath Vignesh J K e07bacf9a3 chg: build workflow - use latest official docker meta action 2024-05-19 07:22:37 +05:30
Bharath Vignesh J K 6743eea32d chg: requirements.txt(s) - remove unnecessary version constraints
- drop duplicated deps already present in base requirements.txt
2024-05-19 07:01:33 +05:30
Bharath Vignesh J K 53621f413b chg: deps - remove unused deps - scandir & wifi 2024-05-19 06:59:03 +05:30
Bharath Vignesh J K f0fc27f952 chg: pyproject.toml - remove black config 2024-05-19 06:57:11 +05:30
nicolargo ba88263b85 Replace UJson by ORJson - Client/Server do not work anymore 2024-05-18 14:09:30 +02:00
nicolargo b8c6c22bb0 Reformat code 2024-05-18 11:26:08 +02:00
nicolargo d2f1fa10d5 Reformat code 2024-05-18 11:24:54 +02:00
nicolargo 15b0a9bbab Update snapcraft 2024-05-18 11:18:01 +02:00
nicolargo 5d88280ad6 version 4.0.5 2024-05-18 11:10:56 +02:00
nicolargo 1183b4dabd Update docs 2024-05-18 10:58:39 +02:00
nicolargo 74f9606e65 Merge Ruff formating and solve some conflicts #2779 2024-05-18 10:37:57 +02:00
Nicolas Hennion a99bf33b4b
Merge pull request #2779 from nicolargo/ruff-cleanup
chore: ruff cleanup
2024-05-18 10:32:13 +02:00
nicolargo 4f38bf384b Add some comment regarding the minimal Python version and exclude all the venv* folders in the linter configuration 2024-05-18 10:17:47 +02:00
nicolargo 5262524db3 Merge branch 'develop' of github.com:nicolargo/glances into develop 2024-05-18 09:32:32 +02:00
RazCrimson 3306fa0118
Merge pull request #2789 from nicolargo/2788-sensortype-change-in-rest-api-breaks-compatibility-in-404
fix: plugin(sensors) - serialization bug with raw stats
2024-05-18 05:01:09 +05:30
Bharath Vignesh J K 30ec25fa0a fix: plugin(sensors) - serialization bug with raw stats 2024-05-18 04:57:47 +05:30
Bharath Vignesh J K 6a0889851c chg: glances client - avoid logging user creds 2024-05-18 01:21:32 +05:30
Bharath Vignesh J K f31b767e0e chg: github-actions to use ruff 2024-05-17 04:41:31 +05:30
Bharath Vignesh J K 14efbac82d chore: remove older lint configs 2024-05-17 04:17:33 +05:30
Bharath Vignesh J K 00c662f870 chg: Makefile - use ruff & pre-commit 2024-05-17 04:13:26 +05:30
Bharath Vignesh J K cd69c4a0e8 chg: ruff - naming
exclude already ignores rules with flake8
2024-05-17 03:58:43 +05:30
Bharath Vignesh J K 28e7e5b74a chg: ruff - flake8-comprehensions 2024-05-17 03:37:24 +05:30
Bharath Vignesh J K 108ffcdfb6 chg: ruff - pyupgrade 2024-05-17 03:37:22 +05:30
Bharath Vignesh J K f9a06a31f0 chg: ruff - mccabe (CC>21) 2024-05-17 03:36:55 +05:30
Bharath Vignesh J K 1f628642d4 fix: auto-removed imports in globals 2024-05-17 03:36:55 +05:30
Bharath Vignesh J K b4c2a4c24a chg: ruff - flake-return fixes 2024-05-17 03:36:55 +05:30
Bharath Vignesh J K d392caf6f6 chg: ruff - isort fixes 2024-05-17 03:36:53 +05:30
Bharath Vignesh J K 9890749d81 add: pre-commit - setup changes 2024-05-17 02:11:23 +05:30
Bharath Vignesh J K acb5ef585f chore: ruff cleanup 2024-05-17 02:10:09 +05:30
RazCrimson 396e78c415
Merge pull request #2778 from nicolargo/2777-make-pydantic-dep-optional
chg: event_list - enable data validation only if pydantic available
2024-05-16 21:05:18 +05:30
Nicolas Hennion 6583109c73 Update the Grafana dashboard - Sensors is now displayed #2780 2024-05-16 14:14:16 +00:00
Nicolas Hennion 986cd99fbd Update the Grafana dashboard #2780 2024-05-16 13:44:51 +00:00
Bharath Vignesh J K fecd23b26f Merge branch 'refs/heads/support/v4.0.x'
# Conflicts:
#	NEWS.rst
#	docs/api.rst
#	docs/man/glances.1
#	glances/__init__.py
#	glances/plugins/sensors/__init__.py
#	snap/snapcraft.yaml
2024-05-16 17:15:42 +05:30
Bharath Vignesh J K 98f2bb7fbe chg: event_list - enable data validation only if pydantic available 2024-05-16 17:00:20 +05:30
Nicolas Hennion 05bc1449db Merge branch 'issue2776' into develop 2024-05-16 09:00:39 +00:00
Nicolas Hennion d095e4ae34 4.0.4 - On Glances startup ERROR -- Can not init battery class ([WinError 3] even though sensors plugin disabled #2776 2024-05-16 09:00:17 +00:00
Nicolas Hennion 6acd0da704 Merge branch 'issue2773' into develop 2024-05-16 08:46:46 +00:00
Nicolas Hennion f6545580db In codeSpace (with Python 3.8), an error occurs in ./unittest-restful.py #2773 2024-05-16 08:46:27 +00:00
Bharath Vignesh J K d94b0b4e92 fix: plugin(sensors) - typehint for py38 2024-05-15 18:09:28 +05:30
Bharath Vignesh J K 16621cf75f version 4.0.4 2024-05-15 14:50:23 +05:30
Bharath Vignesh J K abdbb00f3e fix: plugin(sensors) - typehint for py38 2024-05-15 14:47:53 +05:30
Nicolas Hennion 0447e210e5 Catch exception when init colors in TMUX 2024-05-15 08:12:38 +00:00
Bharath Vignesh J K 3e9b949a0f version 4.0.3 2024-05-15 13:08:28 +05:30
Bharath Vignesh J K 594188528b refactor: plugin(sensors) - cleanup + typing + fixes
cherry-picked from develop `7a25f716`
2024-05-15 13:04:55 +05:30
RazCrimson d8c5a72387
Merge pull request #2771 from nicolargo/2770-pydantic-v1-breaks-glances-v4
chg: requirements.txt - use pydantic v2
2024-05-15 10:37:45 +05:30
Bharath Vignesh J K 25ae493517 chg: requirements.txt - use pydantic v2
Co-authored-by: Saketh Raman KS <sakethramansundaram78@gmail.com>
2024-05-15 10:19:07 +05:30
RazCrimson 3aa9225da0
Merge pull request #2768 from nicolargo/2765-sensors-plugin-is-buggy
refactor: plugin(sensors) - cleanup + typing + fixes
2024-05-14 14:01:00 +05:30
Bharath Vignesh J K 7a25f7165e refactor: plugin(sensors) - cleanup + typing + fixes 2024-05-14 13:37:20 +05:30
nicolargo c66c651205 Merge branch 'develop' of github.com:nicolargo/glances into develop 2024-05-13 23:00:58 +02:00
nicolargo eb83f6e6b1 version 4.0.2 2024-05-13 22:58:34 +02:00
nicolargo 4e926788ac Remove unused target in CI 2024-05-13 22:51:30 +02:00
Nicolas Hennion 127f2e45ed
Merge pull request #2761 from chenrui333/fix-requirements.txt
fix: include requirements.txt and SECURITY.md for pypi dist
2024-05-13 22:49:46 +02:00
nicolargo c98b7fcf1d Refactor setup.py 2024-05-13 22:48:07 +02:00
Bharath Vignesh J K 2d744121d1 version 4.0.2 2024-05-14 01:56:59 +05:30
Bharath Vignesh J K 84a511c716 hotfix: plugin(sensors) - race conditions btw fan_speed & temperature methods
(cherry-picked for v4.0.2 from latest develop `8c1b7499`)
2024-05-14 01:46:39 +05:30
RazCrimson 8c1b74993d
Merge pull request #2766 from nicolargo/2765-sensors-plugin-is-buggy
hotfix: plugin(sensors) - race conditions btw fan_speed & temperature…
2024-05-14 01:29:17 +05:30
Bharath Vignesh J K 371885c34c hotfix: plugin(sensors) - race conditions btw fan_speed & temperature methods 2024-05-14 01:14:21 +05:30
Rui Chen 6d4e0884cd
AUTHORS: add Rui for homebrew package
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-05-12 14:48:51 -04:00
Rui Chen fc63162515
fix: include requirements.txt and SECURITY.md for pypi dist
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-05-12 14:45:13 -04:00
nicolargo 516b3ab478 Force build for snap... 2024-05-12 19:27:56 +02:00
nicolargo b54fbda064 On the road to Glances 4.1.0 2024-05-12 19:05:07 +02:00
nicolargo 714d252999 version 4.0.1 2024-05-12 19:01:46 +02:00
nicolargo 7fbc598d5a Correct pydantic miss dep in tox 2024-05-12 18:32:32 +02:00
Nicolas Hennion ddfa809280
Merge pull request #2760 from chenrui333/add-pydantic
fix(setup): add missing pydantic
2024-05-12 18:23:35 +02:00
Rui Chen 4bfe5f2c81
fix(setup): add missing pydantic
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-05-12 12:11:30 -04:00
nicolargo afb06cb230 WebUI not needed to build in CI 2024-05-12 11:13:59 +02:00
nicolargo 8ff40f0e46 WebUI not needed to build in CI 2024-05-12 11:13:14 +02:00
nicolargo 4ff7c82559 Update docs and API 2024-05-12 11:10:59 +02:00
nicolargo 4a4ca76505 Do not build WebUI if tags 2024-05-12 11:05:13 +02:00
nicolargo 374bf0944b On the road of Glances 4.1.0 2024-05-12 10:49:45 +02:00
336 changed files with 36382 additions and 26616 deletions

View File

@ -1,2 +0,0 @@
[bandit]
exclude: ./docs,./glances/outputs/static/node_modules

View File

@ -4,7 +4,6 @@ include =
*glances*
omit =
setup.py
glances/outputs/*
glances/exports/*
glances/compat.py

View File

@ -8,13 +8,15 @@
!/glances/outputs/static
# Include Requirements files
!/requirements.txt
!/all-requirements.txt
!/docker-requirements.txt
!/webui-requirements.txt
!/optional-requirements.txt
# Include Config file
!/docker-compose/glances.conf
!/docker-files/docker-logger.json
# Include Binary file
!/docker-bin.sh
# Include TOML file
!/pyproject.toml

View File

@ -1,8 +0,0 @@
[flake8]
exclude = .git,__pycache__,docs/,build,dist
ignore =
W504, B007, B014, B008, B902, Q000,
N801, N802, N803, N806, N807, N811, N812, N813, N814, N815, N816, N817, N818
# lines should not exceed 120 characters
max-line-length = 120

View File

@ -6,6 +6,9 @@ labels: ''
assignees: ''
---
**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.
@ -26,11 +29,7 @@ If applicable, add screenshots to help explain your problem.
- Operating System (lsb_release -a or OS name/version): `To be completed with result of: lsb_release -a`
- Glances & psutil versions: `To be completed with result of: glances -V`
- How do you install Glances (Pypi package, script, package manager, source): `To be completed`
- Glances test (only available with Glances 3.1.7 or higher):
```
To be completed with result of: glances --issue
```
- Glances test: ` To be completed with result of: glances --issue`
**Additional context**
Add any other context about the problem here.

View File

@ -1,170 +1,82 @@
# This pipeline aims at building Glances for the following targets:
# - Pypi
# - Docker Hub
# This pipeline aims at building Glances Pypi packages
name: build
env:
DEFAULT_DOCKER_IMAGE: nicolargo/glances
NODE_ENV: ${{ (contains('refs/heads/master', github.ref) || startsWith(github.ref, 'refs/tags/v')) && 'prod' || 'dev' }}
PUSH_BRANCH: ${{ 'refs/heads/develop' == github.ref || 'refs/heads/master' == github.ref || startsWith(github.ref, 'refs/tags/v') }}
# Alpine image platform: https://hub.docker.com/_/alpine
# linux/arm/v6,linux/arm/v7 do not work (timeout during the build)
DOCKER_PLATFORMS: linux/amd64,linux/arm64/v8
# Ubuntu image platforms list: https://hub.docker.com/_/ubuntu
# linux/arm/v7 do not work (Cargo/Rust not available)
DOCKER_PLATFORMS_UBUNTU: linux/amd64,linux/arm64/v8
on:
workflow_call:
secrets:
TEST_PYPI_API_TOKEN:
description: 'Test PyPI API token'
required: true
PYPI_API_TOKEN:
description: 'PyPI API token'
required: true
DOCKER_USERNAME:
description: 'Docker Hub username'
required: true
DOCKER_TOKEN:
description: 'Docker Hub token'
required: true
jobs:
pypi:
build:
name: Build distribution 📦
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Upgrade pip
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install pypa/build
run: >-
python -m
pip install
--upgrade
pip
- name: Install build tools
run: >-
python -m
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution package to Test PyPI
pypi:
name: Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/glances
permissions:
attestations: write
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v5
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
attestations: false
print-hash: true
pypi_test:
name: Publish Python 🐍 distribution 📦 to TestPyPI
if: github.ref == 'refs/heads/develop'
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://pypi.org/p/glances
permissions:
attestations: write
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v5
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: Publish distribution package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
create_Docker_builds:
runs-on: ubuntu-latest
# Make sure we release the python package first. So we are sure to get the latest.
needs:
- pypi
outputs:
tags: ${{ steps.config.outputs.tags }}
steps:
- name: Determine image tags
id: config
shell: bash
run: |
TAG_ARRAY='['
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
TAG_ARRAY="$TAG_ARRAY { \"target\": \"minimal\", \"tag\": \"${VERSION}\" },"
TAG_ARRAY="$TAG_ARRAY { \"target\": \"full\", \"tag\": \"${VERSION}-full\" },"
elif [[ $GITHUB_REF == refs/heads/develop ]]; then
TAG_ARRAY="$TAG_ARRAY { \"target\": \"dev\", \"tag\": \"dev\" },"
else
TAG_ARRAY="$TAG_ARRAY { \"target\": \"minimal\", \"tag\": \"latest\" },"
TAG_ARRAY="$TAG_ARRAY { \"target\": \"full\", \"tag\": \"latest-full\" },"
fi
TAG_ARRAY="${TAG_ARRAY::-1} ]"
echo "Tags to build: $TAG_ARRAY"
echo "tags=$TAG_ARRAY" >> $GITHUB_OUTPUT
build_Docker_image:
runs-on: ubuntu-latest
needs:
- create_Docker_builds
strategy:
fail-fast: false
matrix:
os: ['alpine', 'ubuntu']
tag: ${{ fromJson(needs.create_Docker_builds.outputs.tags) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Retrieve Repository Docker metadata
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v5.0.0
with:
images: ${{ env.DEFAULT_DOCKER_IMAGE }}
labels: |
org.opencontainers.image.url=https://nicolargo.github.io/glances/
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ env.NODE_ENV }}-${{ matrix.os }}-${{ matrix.tag.tag }}
restore-keys: ${{ runner.os }}-buildx-${{ env.NODE_ENV }}-${{ matrix.os }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Login to DockerHub
uses: docker/login-action@v3
if: ${{ env.PUSH_BRANCH == 'true' }}
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v5
with:
push: ${{ env.PUSH_BRANCH == 'true' }}
tags: "${{ env.DEFAULT_DOCKER_IMAGE }}:${{ matrix.os != 'alpine' && format('{0}-', matrix.os) || '' }}${{ matrix.tag.tag }}"
build-args: |
CHANGING_ARG=${{ github.sha }}
context: .
file: "docker-files/${{ matrix.os }}.Dockerfile"
platforms: ${{ matrix.os != 'ubuntu' && env.DOCKER_PLATFORMS || env.DOCKER_PLATFORMS_UBUNTU }}
target: ${{ matrix.tag.target }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
attestations: false

105
.github/workflows/build_docker.yml vendored Normal file
View File

@ -0,0 +1,105 @@
# This pipeline aims at building Glances Docker images
name: build_docker
env:
DEFAULT_DOCKER_IMAGE: nicolargo/glances
PUSH_BRANCH: ${{ 'refs/heads/develop' == github.ref || startsWith(github.ref, 'refs/tags/v') }}
# Alpine image platform: https://hub.docker.com/_/alpine
# linux/arm/v6,linux/arm/v7 do not work (timeout during the build)
DOCKER_PLATFORMS: linux/amd64,linux/arm64/v8
# Ubuntu image platforms list: https://hub.docker.com/_/ubuntu
# linux/arm/v7 do not work (Cargo/Rust not available)
DOCKER_PLATFORMS_UBUNTU: linux/amd64,linux/arm64/v8
on:
workflow_call:
secrets:
DOCKER_USERNAME:
description: 'Docker Hub username'
required: true
DOCKER_TOKEN:
description: 'Docker Hub token'
required: true
jobs:
create_docker_images_list:
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.config.outputs.tags }}
steps:
- name: Determine image tags
id: config
shell: bash
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
TAG_ARRAY="[{ \"target\": \"minimal\", \"tag\": \"${VERSION}\" },"
TAG_ARRAY="$TAG_ARRAY { \"target\": \"minimal\", \"tag\": \"latest\" },"
TAG_ARRAY="$TAG_ARRAY { \"target\": \"full\", \"tag\": \"${VERSION}-full\" },"
TAG_ARRAY="$TAG_ARRAY { \"target\": \"full\", \"tag\": \"latest-full\" }]"
elif [[ $GITHUB_REF == refs/heads/develop ]]; then
TAG_ARRAY="[{ \"target\": \"dev\", \"tag\": \"dev\" }]"
else
TAG_ARRAY="[]"
fi
echo "Tags to build: $TAG_ARRAY"
echo "tags=$TAG_ARRAY" >> $GITHUB_OUTPUT
build_docker_images:
runs-on: ubuntu-latest
needs:
- create_docker_images_list
strategy:
fail-fast: false
matrix:
os: ['alpine', 'ubuntu']
tag: ${{ fromJson(needs.create_docker_images_list.outputs.tags) }}
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Retrieve Repository Docker metadata
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DEFAULT_DOCKER_IMAGE }}
labels: |
org.opencontainers.image.url=https://nicolargo.github.io/glances/
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Login to DockerHub
uses: docker/login-action@v3
if: ${{ env.PUSH_BRANCH == 'true' }}
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
push: ${{ env.PUSH_BRANCH == 'true' }}
tags: "${{ env.DEFAULT_DOCKER_IMAGE }}:${{ matrix.os != 'alpine' && format('{0}-', matrix.os) || '' }}${{ matrix.tag.tag }}"
build-args: |
CHANGING_ARG=${{ github.sha }}
context: .
file: "docker-files/${{ matrix.os }}.Dockerfile"
platforms: ${{ matrix.os != 'ubuntu' && env.DOCKER_PLATFORMS || env.DOCKER_PLATFORMS_UBUNTU }}
target: ${{ matrix.tag.target }}
labels: ${{ steps.docker_meta.outputs.labels }}
# GHA default behaviour overwrites last build cache. Causes alpine and ubuntu cache to overwrite each other.
# Use `scope` with the os name to prevent that
cache-from: 'type=gha,scope=${{ matrix.os }}'
cache-to: 'type=gha,mode=max,scope=${{ matrix.os }}'

View File

@ -17,9 +17,11 @@ jobs:
build:
if: github.event_name != 'pull_request'
uses: ./.github/workflows/build.yml
needs: [quality, test]
build_docker:
if: github.event_name != 'pull_request'
uses: ./.github/workflows/build_docker.yml
secrets:
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
needs: [quality, test]

View File

@ -11,7 +11,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master

22
.github/workflows/inactive_issues.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Label inactive issues
on:
schedule:
- cron: "30 1 * * *"
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v10
with:
days-before-issue-stale: 90
days-before-issue-close: -1
stale-issue-label: "inactive"
stale-issue-message: "This issue is stale because it has been open for 3 months with no activity."
close-issue-message: "This issue was closed because it has been inactive for 30 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}

22
.github/workflows/needs_contributor.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Add a message when needs contributor tag is used
on:
issues:
types:
- labeled
jobs:
add-comment:
if: github.event.label.name == 'needs contributor'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add comment
run: gh issue comment "$NUMBER" --body "$BODY"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
BODY: >
This issue is available for anyone to work on.
**Make sure to reference this issue in your pull request.**
:sparkles: Thank you for your contribution ! :sparkles:

View File

@ -22,7 +22,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

View File

@ -7,107 +7,117 @@ on:
jobs:
source-code-checks:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Check formatting with Ruff
uses: chartboost/ruff-action@v1
with:
args: 'format --check'
- name: Check linting with Ruff
uses: chartboost/ruff-action@v1
with:
args: 'check'
# - name: Static type check
# run: |
# echo "Skipping static type check for the moment, too much error...";
# # pip install pyright
# # pyright glances
test-linux:
needs: source-code-checks
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
# Python EOL version are note tested
# Multiple Python version only tested for Linux
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
if [ -f dev-requirements.txt ]; then python -m pip install -r dev-requirements.txt; fi
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
- name: Unitary tests
run: |
python -m pytest ./tests/test_core.py
test-windows:
needs: source-code-checks
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
runs-on: windows-2025
strategy:
matrix:
# Windows-curses not available for Python 3.14 for the moment
# See https://github.com/zephyrproject-rtos/windows-curses/issues/76
python-version: ["3.13"]
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.git,./docs,./glances/outputs/static
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=.git,./docs,./glances/outputs/static
- name: Static type check
run: |
echo "Skipping static type check for the moment, too much error...";
# pip install pyright
# pyright glances
if (Test-Path -PathType Leaf "dev-requirements.txt") { python -m pip install -r dev-requirements.txt }
if (Test-Path -PathType Leaf "requirements.txt") { python -m pip install -r requirements.txt }
pip install .
- name: Unitary tests
run: |
python ./unittest-core.py
# Error appear with h11, not related to Glances
# Should be tested if correction is done
# Installed c:\hostedtoolcache\windows\python\3.9.13\x64\lib\site-packages\exceptiongroup-1.2.1-py3.9.egg
# error: h11 0.14.0 is installed but h11<0.13,>=0.11 is required by {'httpcore'}
# Error: Process completed with exit code 1.
# test-windows:
# # https://github.com/actions/runner-images?tab=readme-ov-file#available-images
# runs-on: windows-2022
# strategy:
# matrix:
# # Python version "3.12" introduce this issue:
# # https://github.com/nicolargo/glances/actions/runs/6439648370/job/17487567454
# python-version: ["3.8", "3.9", "3.10", "3.11"]
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
# cache: 'pip'
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# if (Test-Path -PathType Leaf "requirements.txt") { python -m pip install -r requirements.txt }
# python setup.py install
# - name: Unitary tests
# run: |
# python ./unittest-core.py
python -m pytest ./tests/test_core.py
test-macos:
needs: source-code-checks
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
runs-on: macos-14
runs-on: macos-15
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
# Only test the latest stable version
python-version: ["3.14"]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install dependencies
run: |
if [ -f dev-requirements.txt ]; then python -m pip install -r dev-requirements.txt; fi
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
- name: Unitary tests
run: |
python ./unittest-core.py
- name: Unitary tests
run: |
python -m pytest ./tests/test_core.py
# Error when trying to implement #2749
# pkg: No packages available to install matching 'py-pip' have been found in the repositories
@ -124,8 +134,10 @@ jobs:
# with:
# usesh: true
# prepare: |
# pkg install -y python3 py-pip
# pkg install -y python3
# run: |
# set -e -x
# python3 -m pip install pytest
# python3 -m pip install --user -r dev-requirements.txt
# python3 -m pip install --user -r requirements.txt
# python ./unittest-core.py
# python3 -m pytest ./tests/test_core.py

View File

@ -14,17 +14,18 @@ jobs:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Glances will be build with Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: ./glances/outputs/static/package-lock.json
- name: Build Glances WebUI
working-directory: ./glances/outputs/static
# TODO: add the following line when https://github.com/nicolargo/glances/issues/2914 will be solved
# npm audit fix
run: |
npm audit fix
npm ci
npm run build
- name: Commit and push WebUI

12
.gitignore vendored
View File

@ -23,6 +23,7 @@ local.properties
.classpath
.settings/
.loadpath
.ipynb_checkpoints/
# External tool builders
.externalToolBuilders/
@ -63,5 +64,14 @@ bower_components/
/*_source.tar.bz2
# Virtual env
/venv*/
.venv-uv/
.venv/
uv.lock
.python-version
# Test
.coverage
tests-data/issues/*/config/
# Local SSL certificates
glances.local*.pem

107
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,107 @@
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.24.2
hooks:
- id: gitleaks
name: "🔒 security · Detect hardcoded secrets"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
hooks:
- id: ruff-format
name: "🐍 python · Formatter with Ruff"
types_or: [ python, pyi ]
args: [ --config, './pyproject.toml' ]
- id: ruff-check
name: "🐍 python · Linter with Ruff"
types_or: [ python, pyi ]
args: [ --fix, --exit-non-zero-on-fix, --config, './pyproject.toml' ]
# - repo: https://github.com/RobertCraigie/pyright-python
# rev: v1.1.391
# hooks:
# - id: pyright
# name: "🐍 python · Check types"
# - repo: https://github.com/biomejs/pre-commit
# rev: "v2.3.7"
# hooks:
# - id: biome-check
# name: "🟨 javascript · Lint, format, and safe fixes with Biome"
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.35.0
hooks:
- id: check-github-workflows
name: "🐙 github-actions · Validate gh workflow files"
args: ["--verbose"]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
name: "🐚 shell · Lint shell scripts"
- repo: https://github.com/openstack/bashate
rev: 2.1.1
hooks:
- id: bashate
name: "🐚 shell · Check shell script code style"
entry: bashate --error . --ignore=E006
# - repo: https://github.com/mrtazz/checkmake.git
# rev: 0.2.2
# hooks:
# - id: checkmake
# name: "🐮 Makefile · Lint Makefile"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-executables-have-shebangs
name: "📁 filesystem/⚙️ exec · Verify shebang presence"
- id: check-shebang-scripts-are-executable
name: "📁 filesystem/⚙️ exec · Verify script permissions"
- id: check-case-conflict
name: "📁 filesystem/📝 names · Check case sensitivity"
- id: destroyed-symlinks
name: "📁 filesystem/🔗 symlink · Detect broken symlinks"
- id: check-merge-conflict
name: "🌳 git · Detect conflict markers"
- id: forbid-new-submodules
name: "🌳 git · Prevent submodule creation"
- id: no-commit-to-branch
name: "🌳 git · Protect main branches"
args: ["--branch", "main", "--branch", "master"]
- id: check-added-large-files
name: "🌳 git · Block large file commits"
args: ['--maxkb=5000']
- id: check-ast
name: "🐍 python/🔍 quality · Validate Python AST"
- id: check-docstring-first
name: "🐍 python/📝 style · Enforce docstring at top"
- id: check-json
name: "📄 formats/json · Validate JSON files"
- id: check-shebang-scripts-are-executable
name: "📁 filesystem/⚙️ exec · Ensure scripts are executable"
- id: check-toml
name: "📄 formats/toml · Validate TOML files"
- id: check-yaml
name: "📄 formats/yaml · Validate YAML syntax"
- id: debug-statements
name: "🐍 python/🪲 debug · Detect debug statements"
- id: detect-private-key
name: "🔐 security · Detect private keys"
- id: mixed-line-ending
name: "📄 text/↩️ newline · Normalize line endings"
- id: requirements-txt-fixer
name: "🐍 python/📦 deps · Sort requirements.txt"
- repo: local
hooks:
- id: find-duplicate-lines
name: "❗local script · Find duplicate lines at the end of file"
entry: bash tests-data/tools/find-duplicate-lines.sh
language: system
types: [python]
pass_filenames: false

34
.readthedocs.yaml Normal file
View File

@ -0,0 +1,34 @@
# Read the Docs configuration file for Glances projects
# Required
version: 2
# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"
# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true
# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub
# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: dev-requirements.txt

View File

@ -13,6 +13,9 @@ PGP Public key: gpg --keyserver pgp.mit.edu --recv-keys 0xba43c11f2c8b4347
RazCrimson (maintainer of the Glances project)
https://github.com/RazCrimson
Ariel Otibili (aka) ariel-anieli (for the huge work on code quality)
https://github.com/ariel-anieli
Alessio Sergi (aka) Al3hex (thanks you for the great job on this project)
https://twitter.com/al3hex
https://github.com/asergi
@ -64,3 +67,7 @@ http://www.macports.org/ports.php?by=name&substr=glances
John Kirkham for the conda package (at conda-forge)
https://github.com/conda-forge/glances-feedstock
Rui Chen for the Homebrew package
https://chenrui.dev/
https://formulae.brew.sh/formula/glances

View File

@ -6,7 +6,7 @@ In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance, race,
education, socioeconomic status, nationality, personal appearance, race,
religion, or sexual identity and orientation.
## Our Standards

View File

@ -10,7 +10,6 @@ the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue or assessing
patches and features.
## Using the issue tracker
The [issue tracker](https://github.com/nicolargo/glances/issues) is
@ -24,7 +23,6 @@ restrictions:
* Please **do not** derail or troll issues. Keep the discussion on topic and
respect the opinions of others.
## Bug reports
A bug is a _demonstrable problem_ that is caused by the code in the repository.
@ -65,19 +63,17 @@ Example:
> causing the bug, and potential solutions (and your opinions on their
> merits).
>
> You can also run Glances in debug mode (-d) and paste/bin the glances.conf file (https://glances.readthedocs.io/en/latest/config.html).
> You can also run Glances in debug mode (-d) and paste/bin the glances.conf file (<https://glances.readthedocs.io/en/latest/config.html>).
>
> Glances 3.2.0 or higher have also a --issue option to run a simple test. Please use it and copy/paste the output.
## Feature requests
Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to *you* to make a strong
fits with the scope and aims of the project. It's up to _you* to make a strong
case to convince the project's developers of the merits of this feature. Please
provide as much detail and context as possible.
## Pull requests
Good pull requests—patches, improvements, new features—are a fantastic
@ -133,6 +129,7 @@ included in the project:
5. Test you code using the Makefile:
* make format ==> Format your code thanks to the Ruff linter
* make run ==> Run Glances
* make run-webserver ==> Run a Glances Web Server
* make test ==> Run unit tests

View File

@ -3,7 +3,12 @@ include CONTRIBUTING.md
include COPYING
include NEWS.rst
include README.rst
include README-pypi.rst
include SECURITY.md
include conf/glances.conf
include conf/fetch-templates/*.jinja
include requirements.txt
include all-requirements.txt
recursive-include docs *
recursive-include glances *.py
recursive-include glances/outputs/static *

362
Makefile
View File

@ -1,161 +1,242 @@
PORT?=8008
LASTTAG = $(shell git describe --tags --abbrev=0)
PORT ?= 8008
CONF := conf/glances.conf
LASTTAG = $(shell git describe --tags --abbrev=0)
IMAGES_TYPES := full minimal
DISTROS := alpine ubuntu
alpine_images := $(IMAGES_TYPES:%=docker-alpine-%)
ubuntu_images := $(IMAGES_TYPES:%=docker-ubuntu-%)
DOCKER_IMAGES := $(alpine_images) $(ubuntu_images)
DOCKER_RUNTIMES := $(DOCKER_IMAGES:%=run-%)
UNIT_TESTS := test-core test-restful test-xmlrpc
DOCKER_BUILD := docker buildx build
DOCKER_RUN := docker run
PODMAN_SOCK ?= /run/user/$(shell id -u)/podman/podman.sock
DOCKER_SOCK ?= /var/run/docker.sock
DOCKER_SOCKS := -v $(PODMAN_SOCK):$(PODMAN_SOCK):ro -v $(DOCKER_SOCK):$(DOCKER_SOCK):ro
DOCKER_OPTS := --rm -e TZ="${TZ}" -e GLANCES_OPT="" --pid host --network host
UV_RUN := .venv-uv/bin/uv
# if the command is only `make`, the default tasks will be the printing of the help.
.DEFAULT_GOAL := help
.PHONY: help
.PHONY: help test docs docs-server venv requirements profiling docker all clean all test
help: ## List all make commands available
@grep -E '^[\.a-zA-Z_%-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk -F ":" '{print $1}' | grep -v % | sed 's/\\//g' | sort | awk 'BEGIN {FS = ":[^:]*?##"}; {printf "\033[1;34mmake %-50s\033[0m %s\n", $$1, $$2}'
@grep -E '^[\.a-zA-Z_%-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk -F ":" '{print $1}' | \
grep -v % | sed 's/\\//g' | sort | \
awk 'BEGIN {FS = ":[^:]*?##"}; {printf "\033[1;34mmake %-50s\033[0m %s\n", $$1, $$2}'
# ===================================================================
# Virtualenv
# ===================================================================
venv-python: venv-full-python venv-min-python venv-dev-python ## Install all Python 3 venv
# install-uv: ## Instructions to install the UV tool
# @echo "Install the UV tool (https://astral.sh/uv/)"
# @echo "Please install the UV tool manually"
# @echo "For example with: curl -LsSf https://astral.sh/uv/install.sh | sh"
# @echo "Or via a package manager of your distribution"
# @echo "For example for Snap: snap install astral-uv"
venv: venv-full venv-min venv-dev ## Install all Python 3 dependencies
install-uv: ## Install UV tool in a specific virtualenv
python3 -m venv .venv-uv
.venv-uv/bin/pip install uv
venv-upgrade: venv-full-upgrade venv-min-upgrade venv-dev-upgrade ## Upgrade all Python 3 dependencies
upgrade-uv: ## Upgrade the UV tool
.venv-uv/bin/pip install --upgrade pip
.venv-uv/bin/pip install --upgrade uv
# For full installation (with optional dependencies)
venv: ## Create the virtualenv with all dependencies
$(UV_RUN) sync --all-extras --no-group dev
venv-full-python: ## Install Python 3 venv
virtualenv -p /usr/bin/python3 venv
venv-upgrade venv-switch-to-full: ## Upgrade the virtualenv with all dependencies
$(UV_RUN) sync --upgrade --all-extras
venv-full: venv-python ## Install Python 3 run-time dependencies
./venv/bin/pip install -r requirements.txt
./venv/bin/pip install -r optional-requirements.txt
venv-min: ## Create the virtualenv with minimal dependencies
$(UV_RUN) sync
venv-full-upgrade: ## Upgrade Python 3 run-time dependencies
./venv/bin/pip install --upgrade pip
./venv/bin/pip install --upgrade -r requirements.txt
./venv/bin/pip install --upgrade -r optional-requirements.txt
venv-upgrade-min venv-switch-to-min: ## Upgrade the virtualenv with minimal dependencies
$(UV_RUN) sync --upgrade
# For minimal installation (without optional dependencies)
venv-clean: ## Remove the virtualenv
rm -rf .venv
venv-min-python: ## Install Python 3 venv minimal
virtualenv -p /usr/bin/python3 venv-min
venv-dev: ## Create the virtualenv with dev dependencies
$(UV_RUN) sync --dev --all-extras
$(UV_RUN) run pre-commit install --hook-type pre-commit
venv-min: venv-min-python ## Install Python 3 minimal run-time dependencies
./venv-min/bin/pip install -r requirements.txt
# ===================================================================
# Requirements
#
# Note: the --no-hashes option should be used because pip (in CI) has
# issues with hashes.
# ===================================================================
venv-min-upgrade: ## Upgrade Python 3 minimal run-time dependencies
./venv-min/bin/pip install --upgrade pip
./venv-min/bin/pip install --upgrade -r requirements.txt
requirements-min: ## Generate the requirements.txt files (minimal dependencies)
$(UV_RUN) export --no-emit-workspace --no-hashes --no-group dev --output-file requirements.txt
# For development
requirements-all: ## Generate the all-requirements.txt files (all dependencies)
$(UV_RUN) export --no-emit-workspace --no-hashes --all-extras --no-group dev --output-file all-requirements.txt
venv-dev-python: ## Install Python 3 venv
virtualenv -p /usr/bin/python3 venv-dev
requirements-docker: ## Generate the docker-requirements.txt files (Docker specific dependencies)
$(UV_RUN) export --no-emit-workspace --no-hashes --no-group dev --extra containers --extra web --output-file docker-requirements.txt
venv-dev: venv-python ## Install Python 3 dev dependencies
./venv-dev/bin/pip install -r dev-requirements.txt
./venv-dev/bin/pip install -r doc-requirements.txt
requirements-dev: ## Generate the dev-requirements.txt files (dev dependencies)
$(UV_RUN) export --no-hashes --only-dev --output-file dev-requirements.txt
venv-dev-upgrade: ## Upgrade Python 3 dev dependencies
./venv-dev/bin/pip install --upgrade pip
./venv-dev/bin/pip install --upgrade -r dev-requirements.txt
./venv-dev/bin/pip install --upgrade -r doc-requirements.txt
requirements: requirements-min requirements-all requirements-dev requirements-docker ## Generate all the requirements files
requirements-upgrade: venv-upgrade requirements ## Upgrade the virtualenv and regenerate all the requirements files
# ===================================================================
# Tests
# ===================================================================
test-core: ## Run core unit tests
./venv/bin/python ./unittest-core.py
test: ## Run All unit tests
$(UV_RUN) run pytest
test-restful: ## Run Restful unit tests
./venv/bin/python ./unittest-restful.py
test-core: ## Run Core unit tests
$(UV_RUN) run pytest tests/test_core.py
test-xmlrpc: ## Run XMLRPC unit tests
./venv/bin/python ./unittest-xmlrpc.py
test-api: ## Run API unit tests
$(UV_RUN) run pytest tests/test_api.py
test: test-core test-restful test-xmlrpc ## Run unit tests
test-memoryleak: ## Run Memory-leak unit tests
$(UV_RUN) run pytest tests/test_memoryleak.py
test-with-upgrade: venv-upgrade venv-dev-upgrade test ## Upgrade deps and run unit tests
test-perf: ## Run Perf unit tests
$(UV_RUN) run pytest tests/test_perf.py
test-min: ## Run core unit tests in minimal environment
./venv-min/bin/python ./unittest-core.py
test-restful: ## Run Restful API unit tests
$(UV_RUN) run pytest tests/test_restful.py
test-min-with-upgrade: venv-min-upgrade ## Upgrade deps and run unit tests in minimal environment
./venv-min/bin/python ./unittest-core.py
test-webui: ## Run WebUI unit tests
$(UV_RUN) run pytest tests/test_webui.py
test-xmlrpc: ## Run XMLRPC API unit tests
$(UV_RUN) run pytest tests/test_xmlrpc.py
test-with-upgrade: venv-upgrade test ## Upgrade deps and run unit tests
test-export-csv: ## Run interface tests with CSV
/bin/bash ./tests/test_export_csv.sh
test-export-json: ## Run interface tests with JSON
/bin/bash ./tests/test_export_json.sh
test-export-influxdb-v1: ## Run interface tests with InfluxDB version 1 (Legacy)
/bin/bash ./tests/test_export_influxdb_v1.sh
test-export-influxdb-v3: ## Run interface tests with InfluxDB version 3 (Core)
/bin/bash ./tests/test_export_influxdb_v3.sh
test-export-timescaledb: ## Run interface tests with TimescaleDB
/bin/bash ./tests/test_export_timescaledb.sh
test-export-nats: ## Run interface tests with NATS
/bin/bash ./tests/test_export_nats.sh
test-exports: test-export-csv test-export-json test-export-influxdb-v1 test-export-influxdb-v3 test-export-timescaledb test-export-nats ## Tests all exports
# ===================================================================
# Linters, profilers and cyber security
# ===================================================================
pre-commit: ## Run pre-commit hooks
$(UV_RUN) run pre-commit run --all-files
find-duplicate-lines: ## Search for duplicate lines in files
/bin/bash tests-data/tools/find-duplicate-lines.sh
format: ## Format the code
@git ls-files 'glances/*.py' | xargs ./venv-dev/bin/python -m autopep8 --in-place --jobs 0 --global-config=.flake8
@git ls-files 'glances/*.py' | xargs ./venv-dev/bin/python -m autoflake --in-place --remove-all-unused-imports --remove-unused-variables --remove-duplicate-keys --exclude="compat.py,globals.py"
./venv-dev/bin/python -m black ./glances --exclude outputs/static
$(UV_RUN) run ruff format .
flake8: ## Run flake8 linter.
@git ls-files 'glances/ *.py' | xargs ./venv-dev/bin/python -m flake8 --config=.flake8
lint: ## Lint the code.
$(UV_RUN) run ruff check . --fix
ruff: ## Run Ruff (fastest) linter.
./venv-dev/bin/python -m ruff check . --config=./pyproject.toml
lint-readme: ## Lint the main README.rst file
$(UV_RUN) run rstcheck README.rst
$(UV_RUN) run rstcheck README-pypi.rst
codespell: ## Run codespell to fix common misspellings in text files
./venv-dev/bin/codespell -S .git,./docs/_build,./Glances.egg-info,./venv*,./glances/outputs,*.svg -L hart,bu,te,statics
$(UV_RUN) run codespell -S .git,./docs/_build,./Glances.egg-info,./venv*,./glances/outputs,*.svg -L hart,bu,te,statics -w
semgrep: ## Run semgrep to find bugs and enforce code standards
./venv-dev/bin/semgrep scan --config=auto
$(UV_RUN) run semgrep scan --config=auto
profiling-%: SLEEP = 3
profiling-%: TIMES = 30
profiling-%: OUT_DIR = docs/_static
define DISPLAY-BANNER
@echo "Start Glances for $(TIMES) iterations (more or less 1 mins, please do not exit !)"
sleep $(SLEEP)
endef
profiling-gprof: CPROF = glances.cprof
profiling-gprof: ## Callgraph profiling (need "apt install graphviz")
@echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
sleep 3
./venv/bin/python -m cProfile -o ./glances.cprof ./run.py --stop-after 30
./venv-dev/bin/gprof2dot -f pstats ./glances.cprof | dot -Tsvg -o ./docs/_static/glances-cgraph.svg
rm -f ./glances.cprof
$(DISPLAY-BANNER)
$(UV_RUN) run python -m cProfile -o $(CPROF) run-venv.py -C $(CONF) --stop-after $(TIMES)
$(UV_RUN) run gprof2dot -f pstats $(CPROF) | dot -Tsvg -o $(OUT_DIR)/glances-cgraph.svg
rm -f $(CPROF)
profiling-pyinstrument: ## PyInstrument profiling
@echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
sleep 3
./venv/bin/pip install pyinstrument
./venv/bin/python -m pyinstrument -r html -o ./docs/_static/glances-pyinstrument.html -m glances --stop-after 30
$(DISPLAY-BANNER)
$(UV_RUN) add pyinstrument
$(UV_RUN) run pyinstrument -r html -o $(OUT_DIR)/glances-pyinstrument.html -m glances -C $(CONF) --stop-after $(TIMES)
profiling-pyspy: ## Flame profiling (currently not compatible with Python 3.12)
@echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
sleep 3
./venv-dev/bin/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s -- ./venv/bin/python ./run.py --stop-after 30
profiling-pyspy: ## Flame profiling
$(DISPLAY-BANNER)
$(UV_RUN) run py-spy record -o $(OUT_DIR)/glances-flame.svg -d 60 -s -- .venv-uv/bin/uvrun python run-venv.py -C $(CONF) --stop-after $(TIMES)
profiling: profiling-gprof profiling-pyinstrument profiling-pyspy ## Profiling of the Glances software
trace-malloc: ## Trace the malloc() calls
@echo "Malloc test is running, please wait ~30 secondes..."
./venv/bin/python -m glances -C ./conf/glances.conf --trace-malloc --stop-after 15 --quiet
$(UV_RUN) run python -m glances -C $(CONF) --trace-malloc --stop-after 15 --quiet
memory-leak: ## Profile memory leaks
./venv/bin/python -m glances -C ./conf/glances.conf --memory-leak
$(UV_RUN) run python -m glances -C $(CONF) --memory-leak
memory-profiling: TIMES = 2400
memory-profiling: PROFILE = mprofile_*.dat
memory-profiling: OUT_DIR = docs/_static
memory-profiling: ## Profile memory usage
@echo "It's a very long test (~4 hours)..."
rm -f mprofile_*.dat
rm -f $(PROFILE)
@echo "1/2 - Start memory profiling with the history option enable"
./venv-dev/bin/mprof run -T 1 -C run.py -C ./conf/glances.conf --stop-after 2400 --quiet
./venv-dev/bin/mprof plot --output ./docs/_static/glances-memory-profiling-with-history.png
rm -f mprofile_*.dat
$(UV_RUN) run mprof run -T 1 -C run-venv.py -C $(CONF) --stop-after $(TIMES) --quiet
$(UV_RUN) run mprof plot --output $(OUT_DIR)/glances-memory-profiling-with-history.png
rm -f $(PROFILE)
@echo "2/2 - Start memory profiling with the history option disable"
./venv-dev/bin/mprof run -T 1 -C run.py -C ./conf/glances.conf --disable-history --stop-after 2400 --quiet
./venv-dev/bin/mprof plot --output ./docs/_static/glances-memory-profiling-without-history.png
rm -f mprofile_*.dat
$(UV_RUN) run mprof run -T 1 -C run-venv.py -C $(CONF) --disable-history --stop-after $(TIMES) --quiet
$(UV_RUN) run mprof plot --output $(OUT_DIR)/glances-memory-profiling-without-history.png
rm -f $(PROFILE)
# Trivy installation: https://aquasecurity.github.io/trivy/latest/getting-started/installation/
trivy: ## Run Trivy to find vulnerabilities in container images
trivy fs .
trivy: ## Run Trivy to find vulnerabilities
$(UV_RUN) run trivy fs ./glances/
bandit: ## Run Bandit to find vulnerabilities
$(UV_RUN) run bandit glances -r
# ===================================================================
# Docs
# ===================================================================
docs: ## Create the documentation
./venv/bin/python -m glances -C ./conf/glances.conf --api-doc > ./docs/api.rst
$(UV_RUN) run python -m glances -C $(CONF) --api-doc > ./docs/api/python.rst
$(UV_RUN) run python ./generate_openapi.py
$(UV_RUN) run python -m glances -C $(CONF) --api-restful-doc > ./docs/api/restful.rst
cd docs && ./build.sh && cd ..
docs-server: docs ## Start a Web server to serve the documentation
(sleep 2 && sensible-browser "http://localhost:$(PORT)") &
cd docs/_build/html/ && ../../../venv/bin/python -m http.server $(PORT)
cd docs/_build/html/ && .venv-uv/bin/uvrun python -m http.server $(PORT)
docs-jupyter: ## Start Jupyter Notebook
$(UV_RUN) run --with jupyter jupyter lab
release-note: ## Generate release note
git --no-pager log $(LASTTAG)..HEAD --first-parent --pretty=format:"* %s"
@ -170,26 +251,34 @@ install: ## Open a Web Browser to the installation procedure
# Follow ./glances/outputs/static/README.md for more information
# ===================================================================
webui: ## Build the Web UI
cd glances/outputs/static/ && npm ci && npm run build
webui webui%: DIR = glances/outputs/static/
webui-gen-config: ## Generate the Web UI config file
$(UV_RUN) run python ./generate_webui_conf.py > ./glances/outputs/static/js/uiconfig.json
webui: webui-gen-config ## Build the Web UI
cd $(DIR) && npm ci && npm run build
webui-audit: ## Audit the Web UI
cd glances/outputs/static/ && npm audit
cd $(DIR) && npm audit
webui-audit-fix: ## Fix audit the Web UI
cd glances/outputs/static/ && npm audit fix && npm ci && npm run build
webui-audit-fix: webui-gen-config ## Fix audit the Web UI
cd $(DIR) && npm audit fix && npm ci && npm run build
webui-update: webui-gen-config ## Update JS dependencies
cd $(DIR) && npm update --save && npm ci && npm run build
# ===================================================================
# Packaging
# ===================================================================
flatpak: venv-dev-upgrade ## Generate FlatPack JSON file
flatpak: venv-upgrade ## Generate FlatPack JSON file
git clone https://github.com/flatpak/flatpak-builder-tools.git
./venv/bin/python ./flatpak-builder-tools/pip/flatpak-pip-generator glances
$(UV_RUN) run python ./flatpak-builder-tools/pip/flatpak-pip-generator glances
rm -rf ./flatpak-builder-tools
@echo "Now follow: https://github.com/flathub/flathub/wiki/App-Submission"
# Snap package is automaticaly build on the Snapcraft.io platform
# Snap package is automatically build on the Snapcraft.io platform
# https://snapcraft.io/glances
# But you can try an offline build with the following command
snapcraft:
@ -200,98 +289,99 @@ snapcraft:
# Need Docker Buildx package (apt install docker-buildx on Ubuntu)
# ===================================================================
define MAKE_DOCKER_BUILD_RULES
$($(DISTRO)_images): docker-$(DISTRO)-%: docker-files/$(DISTRO).Dockerfile
$(DOCKER_BUILD) --target $$* -f $$< -t glances:local-$(DISTRO)-$$* .
endef
$(foreach DISTRO,$(DISTROS),$(eval $(MAKE_DOCKER_BUILD_RULES)))
docker: docker-alpine docker-ubuntu ## Generate local docker images
docker-alpine: docker-alpine-full docker-alpine-minimal docker-alpine-dev ## Generate local docker images (Alpine)
docker-alpine: $(alpine_images) ## Generate local docker images (Alpine)
docker-ubuntu: $(ubuntu_images) ## Generate local docker images (Ubuntu)
docker-alpine-full: ## Generate local docker image (Alpine full)
docker buildx build --target full -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-full .
docker-alpine-minimal: ## Generate local docker image (Alpine minimal)
docker buildx build --target minimal -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-minimal .
docker-alpine-dev: ## Generate local docker image (Alpine dev)
docker buildx build --target dev -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-dev .
docker-ubuntu: docker-ubuntu-full docker-ubuntu-minimal docker-ubuntu-dev ## Generate local docker images (Ubuntu)
docker-ubuntu-full: ## Generate local docker image (Ubuntu full)
docker buildx build --target full -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-full .
docker-ubuntu-minimal: ## Generate local docker image (Ubuntu minimal)
docker buildx build --target minimal -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-minimal .
docker-ubuntu-dev: ## Generate local docker image (Ubuntu dev)
docker buildx build --target dev -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-dev .
trivy-docker: ## Run Trivy to find vulnerabilities in Docker images
$(UV_RUN) run trivy image glances:local-alpine-full
$(UV_RUN) run trivy image glances:local-alpine-minimal
$(UV_RUN) run trivy image glances:local-ubuntu-full
$(UV_RUN) run trivy image glances:local-ubuntu-minimal
# ===================================================================
# Run
# ===================================================================
run: ## Start Glances in console mode (also called standalone)
./venv/bin/python -m glances -C ./conf/glances.conf
$(UV_RUN) run python -m glances -C $(CONF)
run-debug: ## Start Glances in debug console mode (also called standalone)
./venv/bin/python -m glances -C ./conf/glances.conf -d
$(UV_RUN) run python -m glances -C $(CONF) -d
run-local-conf: ## Start Glances in console mode with the system conf file
./venv/bin/python -m glances
$(UV_RUN) run python -m glances
run-local-conf-hide-public: ## Start Glances in console mode with the system conf file and hide public information
./venv/bin/python -m glances --hide-public-info
$(UV_RUN) run python -m glances --hide-public-info
run-min: ## Start minimal Glances in console mode (also called standalone)
./venv-min/bin/python -m glances -C ./conf/glances.conf
run-like-htop: ## Start Glances with the same features than Htop
$(UV_RUN) run python -m glances --disable-plugin network,ports,wifi,connections,diskio,fs,irq,folders,raid,smart,sensors,vms,containers,ip,amps --disable-left-sidebar
run-min-debug: ## Start minimal Glances in debug console mode (also called standalone)
./venv-min/bin/python -m glances -C ./conf/glances.conf -d
run-fetch: ## Start Glances in fetch mode
$(UV_RUN) run python -m glances --fetch
run-min-local-conf: ## Start minimal Glances in console mode with the system conf file
./venv-min/bin/python -m glances
$(DOCKER_RUNTIMES): run-docker-%:
$(DOCKER_RUN) $(DOCKER_OPTS) $(DOCKER_SOCKS) -it glances:local-$*
run-docker-alpine-minimal: ## Start Glances Alpine Docker minimal in console mode
docker run --rm -e TZ="${TZ}" -e GLANCES_OPT="" -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-alpine-minimal
run-docker-alpine-full: ## Start Glances Alpine Docker full in console mode
docker run --rm -e TZ="${TZ}" -e GLANCES_OPT="" -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-alpine-full
run-docker-alpine-dev: ## Start Glances Alpine Docker dev in console mode
docker run --rm -e TZ="${TZ}" -e GLANCES_OPT="" -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-alpine-dev
run-docker-ubuntu-minimal: ## Start Glances Ubuntu Docker minimal in console mode
docker run --rm -e TZ="${TZ}" -e GLANCES_OPT="" -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-ubuntu-minimal
run-docker-ubuntu-full: ## Start Glances Ubuntu Docker full in console mode
docker run --rm -e TZ="${TZ}" -e GLANCES_OPT="" -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-ubuntu-full
run-docker-ubuntu-dev: ## Start Glances Ubuntu Docker dev in console mode
docker run --rm -e TZ="${TZ}" -e GLANCES_OPT="" -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-ubuntu-dev
generate-ssl: ## Generate local and sel signed SSL certificates for dev (need mkcert)
mkcert glances.local localhost 120.0.0.1 0.0.0.0
run-webserver: ## Start Glances in Web server mode
./venv/bin/python -m glances -C ./conf/glances.conf -w
$(UV_RUN) run python -m glances -C $(CONF) -w
run-webserver-local-conf: ## Start Glances in Web server mode with the system conf file
./venv/bin/python -m glances -w
$(UV_RUN) run python -m glances -w
run-webserver-local-conf-hide-public: ## Start Glances in Web server mode with the system conf file and hide public info
./venv/bin/python -m glances -w --hide-public-info
$(UV_RUN) run python -m glances -w --hide-public-info
run-restapiserver: ## Start Glances in REST API server mode
./venv/bin/python -m glances -C ./conf/glances.conf -w --disable-webui
$(UV_RUN) run python -m glances -C $(CONF) -w --disable-webui
run-server: ## Start Glances in server mode (RPC)
./venv/bin/python -m glances -C ./conf/glances.conf -s
$(UV_RUN) run python -m glances -C $(CONF) -s
run-client: ## Start Glances in client mode (RPC)
./venv/bin/python -m glances -C ./conf/glances.conf -c localhost
$(UV_RUN) run python -m glances -C $(CONF) -c localhost
run-browser: ## Start Glances in browser mode (RPC)
./venv/bin/python -m glances -C ./conf/glances.conf --browser
$(UV_RUN) run python -m glances -C $(CONF) --browser
run-web-browser: ## Start Web Central Browser
$(UV_RUN) run python -m glances -C $(CONF) -w --browser
run-issue: ## Start Glances in issue mode
./venv/bin/python -m glances -C ./conf/glances.conf --issue
$(UV_RUN) run python -m glances -C $(CONF) --issue
run-multipass: ## Install and start Glances in a VM (only available on Ubuntu with multipass already installed)
multipass launch -n glances-on-lts lts
multipass exec glances-on-lts -- sudo snap install glances
multipass exec glances-on-lts -- glances
multipass stop glances-on-lts
multipass delete glances-on-lts
show-version: ## Show Glances version number
./venv/bin/python -m glances -C ./conf/glances.conf -V
.PHONY: test docs docs-server venv venv-min venv-dev
$(UV_RUN) run python -m glances -C $(CONF) -V

532
NEWS.rst
View File

@ -2,6 +2,508 @@
Glances ChangeLog
==============================================================================
=============
Version 4.4.1
=============
Bug corrected:
* Restful API issue after a while (stats are no more updated) #3333
=============
Version 4.4.0
=============
Breaking changes:
* A new Python API is now available to use Glances as a Python lib in your hown development #3237
* In the process list, the long command line is now truncated by default. Use the arrow keys to show the full command line. SHIFT + arrow keys are used to switch between column sorts (TUI).
* Prometheus export format is now more user friendly (see detail in #3283)
Enhancements:
* Make a Glances API in order to use Glances as a Python lib #3237
* Add a new --fetch (neofetch like) option to display a snapshot of the current system status #3281
* Show used port in container section #2054
* Show long command line with arrow key #1553
* Sensors plugin refresh by default every 10 seconds
* Do not call update if a call is done to a specific plugin through the API #3033
* [UI] Process virtual memory display can be disable by configuration #3299
* Choose between used or available in the mem plugin #3288
* [Experimental] Add export to DuckDB database #3205
* Add Disk I/O Latency stats #1070
* Filter fields to export #3258
* Remove .keys() from loops over dicts #3253
* Remove iterator helpers #3252
Bug corrected:
* [MACOS] Glances not showing Processes on MacOS #3100
* Last dev build broke Homepage API calls ? only 1 widget still working #3322
* Cloud plugin always generate communication with 169.254.169.254, even if the plugin is disabled #3316
* API response delay (3+ minutes) when VMs are running #3317
* [WINDOWS] Glances do not display CPU stat correctly #3155
* Glances hangs if network device (NFS) is no available #3290
* Fix prometheus export format #3283
* Issue #3279 zfs cache and memory math issues #3289
* [MACOS] Glances crashes when I try to filter #3266
* Glances hang when killing process with muliple CTRL-C #3264
* Issues after disabling system and processcount plugins #3248
* Headers missing from predefined fields in TUI browser machine list #3250
* Add another check for the famous Netifaces issue - Related to #3219
* Key error 'type' in server_list_static.py (load_server_list) #3247
Continious integration and documentation:
* Glances now use uv for the dev environment #3025
* Glances is compatible with Python 3.14 #3319
* Glances provides requirements files with specific versions for each release
* Requirements files are now generated dynamically with the make requirements or requirements-upgrade target
* Add duplicate line check in pre-commit (strange behavor with some VScode extension)
* Solve issue with multiprocessing exception with Snap package
* Add a test script for identify CPU consumption of sensor plugin
* Refactor port to take into account netifaces2
* Correct issue with Chrome driver in WebUI unit test
* Upgrade export test with InfluxDB 1.12
* Fix typo of --export-process-filter help message #3314
* In the outdated feature, catch error message if Pypi server not reachable
* Add unit test for auto_unit
* Label error in docs #3286
* Put WebUI conf generator in a dedicated script
* Refactor the Makefile to generate WebUI config file for all webui targets
* Update sensors documentation #3275
* Update docker compose env quote #3273
* Update docker-compose.yml #3249
* Update API doc generation
* Update README with nice icons #3236
* Add documentation for WebUI test
Thanks to all contributors and bug reporters !
Special thanks to:
- Adi
- Bennett Kanuka
- Tim Potter
- Ariel Otilibili
- Boris Okassa
- Lawrence
- Shohei YOSHIDA
- jmwallach
- korn3r
=============
Version 4.3.3
=============
Bug corrected:
* Something in 4.3.2 broke the home assistant add-on for Glances #3238
Thanks to the FastAPI and Home Assistant community for the support.
=============
Version 4.3.2
=============
Enhancements:
* Add stats about running VMS (qemu/libvirt/kvm support through virsh) #1531
* Add support for InfluxDB 3 Core #3182
* (postgre)SQL export support / TimeScaleDB #2814
* CSV column name now include the plugin name - Related to #2394
* Make all results from amps plugins exportable #2394
* Make --stdout (csv and json) compliant with client/server mode #3235
* API history endpoints shows times without timezone #3218
* FR: Sort Sensors my name in proper number order #3132
* In the FS module, do not display threshold for volume mounted in 'ro' (read-only) #3143
* Add a new field in the process list to identifie Zombie process #3178
* Update plugin containers display and order #3186
* Implement a basic memory cache with TTL for API call (set to ~1 second) #3202
* Add container inactive_file & limit to InfluxDB2 export #3206
Bug corrected:
* [GPU] AMD Plugin: Operation not permitted #3125
* Container memory stats not displayed #3142
* [WEBUI] Irix mode (per core instead of per CPU percentage) not togglable #3158
* Related to iteritems, itervalues, and iterkeys are not more needed in Python 3 #3181
* Glances Central Browser should use name instead of IP adress for redirection #3103
* Glances breaks if Podman container is started while it is running #3199
Continious integration and documentation:
* Add a new option --print-completion to generate shell tab completion - #3111
* Improve Restful API documentation embeded in FastAPI #2632
* Upgrade JS libs #3147
* Improve unittest for CSV export #3150
* Improve unittest for InfluxDB plugin #3149
* Code refactoring - Rename plugin class to <Plugin name>Plugin instead of PluginModel #3169
* Refactor code to limit the complexity of update_views method in plugins #3171
Thanks to all contributors and bug reporters !
Special thanks to:
- Ariel Otilibili
- kenrmayfield
=============
Version 4.3.1
=============
Enhancements:
* [WebUI] Top processes extended stats and processes filter in Web server mode #410
* I'd like a feature to make the forground color for colored background white #3119
* -disable-bg in ~/.config/glances.conf #3113
* Entry point in the API to get extended process stats #3095
* Replace netifaces by netifaces-plus dependencies #3053
* Replace docker by containers in glances-grafana-flux.json #3118
Bug corrected:
* default_config_dir: Fix config path to include glances/ directory #3106
* Cannot set warning/critical temperature for a specific sensor needs test #3102
* Try to reduce latency between stat's update and view - #3086
* Error on Cloud plugin initialisation make TUI crash #3085
Continious integration:
* Add Selenium to test WebUI #3044
Thanks to all contributors and bug reporters !
Special thanks to:
- Alexander Kuznetsov
- Jonathan Chemla
- mizulike
===============
Version 4.3.0.8
===============
Bug corrected:
* IP plugin broken with Netifaces2 #3076
* WebUI if is notresponsive on mobile #3059 (second run)
===============
Version 4.3.0.7
===============
Bug corrected:
* WebUI if is notresponsive on mobile #3059
===============
Version 4.3.0.6
===============
Bug corrected:
* Browser mode do not working with the sensors plugin #3069
* netifaces is deprecated, use netifaces-plus or netifaces2 #3055
Continuous integration and documentation:
* Update alpine Docker tag to v3.21 #3061
===============
Version 4.3.0.5
===============
Bug corrected:
* WebUI errors in 4.3.0.4 on iPad Air (and Browser with low resolution) #3057
===============
Version 4.3.0.4
===============
Continuous integration and documentation:
* Pin Python version in Ubuntu image to 3.12
===============
Version 4.3.0.3
===============
Continuous integration and documentation:
* Pin Alpine image to 3.20 (3.21 is not compliant with Netifaces) Related to #3053
===============
Version 4.3.0.2
===============
Enhancements:
* Revert "Replace netifaces by netifaces-plus" #3053 because it break build on Alpine Image
===============
Version 4.3.0.1
===============
Enhancements:
* Replace netifaces by netifaces-plus #3053
Bug corrected:
* CONTAINERS section missing in 4.3.0 WebUI #3052
===============
Version 4.3.0
===============
Enhancements:
* Web Based Glances Central Browser #1121
* Ability to specify hide or show for smart plugin #2996
* Thread mode ('j' hotkey) is not taken into accound in the WebUI #3019
* [WEBUI] Clear old alert messages in the WebUI #3042
* Raise an (Alert) Event for a group of sensors #3049
* Allow processlist columns to be selected in config file #1524
* Allow containers columns to be selected in config file #2722
* [WebUI] Unecessary space between Processcount and processlist #3032
* Add comparable NVML_LIB check for Windows #3000
* Change the default path for graph export to /tmp/glances
* Improve CCS of WebUI #3024
Bug corrected:
* Thresholds not displayed in the WebUI for the DiskIO plugin #1498
* FS module alias configuration do not taken into account everytime #3010
* Unexpected behaviour while running glances in docker with --export influxdb2 #2904
* Correct issue when key name contains space - Related to #2983
* Issue with ports plugin (for URL request) #3008
* Network problem when no bitrate available #3014
* SyntaxError: f-string: unmatched '[' in server list (on the DEVELOP branch only) #3018
* Uptime for Docker containers not working #3021
* WebUI doesn't display valid time for process list #2902
* Bug In the Web-UI, Timestamps for 'Warning or critical alerts' are showing incorrect month #3023
* Correct display issue on Containers plugin in WebUI #3028
Continuous integration and documentation:
* Bumped minimal Python version to 3.9 #3005
* Make the glances/outputs/static/js/uiconfig.json generated automaticaly from the make webui task
* Update unit-test for Glances Central Browser
* Add unit-test for new entry point in the API (plugin/item/key)
* Add a target to start Glances with Htop features
* Try new build and publish to Pypi CI actions
Thanks to all contributors and bug reporters !
Special thanks to:
* Ariel Otilibili for code quality improvements #2801
===============
Version 4.2.1
===============
Enhancements:
* [WEBUI] Came back to default Black Theme / Reduce font size #2993
* Improve hide_zero option #2958
Bug corrected:
* Possible memory leak #2976
* Docker/Podman shoud not flood log file with ERROR if containers list can not be retreived #2994
* Using "-w" option gives error: NameError: name 'Any' is not defined #2992
* Non blocking error message when Glances starts from a container (alpine-dev image) #2991
Continuous integration and documentation:
* Migrate from setup.py to pyproject.yml #2956
* Make pyproject.toml's version dynamic #2990
Thanks to all contributors and bug reporters !
Special thanks to:
* @branchvincent for pyproject migration
===============
Version 4.2.0
===============
Enhancements:
* [WEBUI] Migration to bootstrap 5 #2914
* New Ubuntu Multipass VM orchestartor plugin #2252
* Show only active Disk I/O (and network interface) #2929
* Make the central client UI configurable (example: GPU status) #1289
* Please make py-orjson optional: it pulls in dependency on Rust #2930
* Use defusedxml lib #2979
* Do not display Unknown information in the cloud plugin #2485
* Filter Docker containers - #2962
* Add retain to availability topic in MQTT plugin #2974
* Make fields labelled in Green easier to see #2882
Bug corrected:
* In TUI, when processes are filtered, column are not aligned #2980
* Can't kill process. Standalone, Ubuntu 24.04 #2942
* Internal Server Error #2943
* Timezone for warning/errors is incorrect #2901
* Error while initializing the containers plugin ('type' object is not subscriptable) #2922
* url_prefix do not work in Glances < 4.2.0 - Correct issue with mount #2912
* Raid plugin breaks with inactive raid0 arrays #2908
* Crash when terminal is resized #2872
* Check if server name is not null in the Glances browser - Related to #2861
* Only display VMs with a running status (in the Vms plugin)
Continuous integration and documentation:
* Incomplete pipx install to allow webui + containers #2955
* Stick FastAPI version to 0.82.0 or higher (latest is better) - Related to #2926
* api/4/vms returns a dict, thus breaking make test-restful #2918
* Migration to Alpine 3.20 and Python 3.12 for Alpine Docker
Improve code quality (thanks to Ariel Otilibili !):
* Merge pull request #2959 from ariel-anieli/plugins-port-alerts
* Merge pull request #2957 from ariel-anieli/plugin-port-msg
* Merge pull request #2954 from ariel-anieli/makefile
* Merge pull request #2941 from ariel-anieli/refactor-alert
* Merge pull request #2950 from ariel-anieli/revert-commit-01823df9
* Merge pull request #2932 from ariel-anieli/refactorize-display-plugin
* Merge pull request #2924 from ariel-anieli/makefile
* Merge pull request #2919 from ariel-anieli/refactor-plugin-model-msg-curse
* Merge pull request #2917 from ariel-anieli/makefile
* Merge pull request #2915 from ariel-anieli/refactor-process-thread
* Merge pull request #2913 from ariel-anieli/makefile
* Merge pull request #2910 from ariel-anieli/makefile
* Merge pull request #2900 from ariel-anieli/issue-2801-catch-key
* Merge pull request #2907 from ariel-anieli/refactorize-makefile
* Merge pull request #2891 from ariel-anieli/issue-2801-plugin-msg-curse
* Merge pull request #2884 from ariel-anieli/issue-2801-plugin-update
Thanks to all contributors and bug reporters !
Special thanks to:
* Ariel Otilibili, he has made an incredible work to improve Glances code quality !
* RazCrimson, thanks for all your contributions !
* Bharath Vignesh J K
* Neveda
* ey-jo
===============
Version 4.1.2
===============
Bug corrected:
* AttributeError: 'CpuPercent' object has no attribute 'cpu_percent' #2859
===============
Version 4.1.1
===============
Bug corrected:
* Sensors data is not exported using InfluxDB2 exporter #2856
===============
Version 4.1.0
===============
Enhancements:
* Call process_iter.clear_cache() (PsUtil 6+) when Glances user force a refresh (F5 or CTRL-R) #2753
* PsUtil 6+ no longer check PID reused #2755
* Add support for automatically hiding network interfaces that are down or that don't have any IP addresses #2799
Bug corrected:
* API: Network module is disabled but appears in endpoint "all" #2815
* API is not compatible with requests containing special/encoding char #2820
* 'j' hot key crashes Glances #2831
* Raspberry PI - CPU info is not correct #2616
* Graph export is broken if there is no graph section in Glances configuration file #2839
* Glances API status check returns Error 405 - Method Not Allowed #2841
* Rootless podman containers cause glances to fail with KeyError #2827
* --export-process-filter Filter using complete command #2824
* Exception when Glances is ran with limited plugin list #2822
* Disable separator option do not work #2823
Continuous integration and documentation:
* test test_107_fs_plugin_method fails on aarch64-linux #2819
Thanks to all contributors and bug reporters !
Special thanks to:
* Bharath Vignesh J K
* RazCrimson
* Vadim Small
===============
Version 4.0.8
===============
* Make CORS option configurable security webui #2812
* When Glances is installed via venv, default configuration file is not used documentation packaging #2803
* GET /1272f6e9e8f9d6bfd6de.png results in 404 bug webui #2781 by Emporea was closed May 25, 2024
* Screen frequently flickers when outputting to local display bug needs test #2490
* Retire ujson for being in maintenance mode dependencies enhancement #2791
===============
Version 4.0.7
===============
* cpu_hz_current not available on NetBSD #2792
* SensorType change in REST API breaks compatibility in 4.0.4 #2788
===============
Version 4.0.6
===============
* No GPU info on Web View #2796
===============
Version 4.0.5
===============
* SensorType change in REST API breaks compatibility in 4.0.4 #2788
* Please make pydantic optional dependency, not required one #2777
* Update the Grafana dashboard #2780
* 4.0.4 - On Glances startup "ERROR -- Can not init battery class #2776
* In codeSpace (with Python 3.8), an error occurs in ./unittest-restful.py #2773
Use Ruff as default Linter.
===============
Version 4.0.4
===============
Hostfix release for support sensors plugin on python 3.8
===============
Version 4.0.3
===============
Additional fixes for Sensor plugin
===============
Version 4.0.2
===============
* hotfix: plugin(sensors) - race conditions btw fan_speed & temperature… #2766
* fix: include requirements.txt and SECURITY.md for pypi dist #2761
Thanks to RazCrimson for the sensors patch !
===============
Version 4.0.1
===============
Correct issue with CI (miss pydantic dep).
===============
Version 4.0.0
===============
@ -11,7 +513,7 @@ See release note in Wiki format: https://github.com/nicolargo/glances/wiki/Glanc
**BREAKING CHANGES:**
* The minimal Python version is 3.8
* The Glances API version 3 is replaced by the version 4. So Restfull API URL is now /api/4/ #2610
* The Glances API version 3 is replaced by the version 4. So Restful API URL is now /api/4/ #2610
* Alias definition change in the configuration file #1735
Glances version 3.x and lower:
@ -36,9 +538,9 @@ Minimal requirements for Glances version 4 are:
* packaging
* ujson
* pydantic
* fastapi (for WebUI / RestFull API)
* uvicorn (for WebUI / RestFull API)
* jinja2 (for WebUI / RestFull API)
* fastapi (for WebUI / RestFul API)
* uvicorn (for WebUI / RestFul API)
* jinja2 (for WebUI / RestFul API)
Majors changes between Glances version 3 and version 4:
@ -98,7 +600,7 @@ Bug corrected:
CI and documentation:
* New logo for Glances version 4.0 #2713
* Update api.rst documentation #2496
* Update api-restful.rst documentation #2496
* Change Renovate config #2729
* Docker compose password unrecognized arguments when applying docs #2698
* Docker includes OS Release Volume mount info #2473
@ -113,7 +615,7 @@ Many thinks to the contributors:
* Christoph Zimmermann
* RazCrimson
* Robin Candau
* Github GPG acces
* Github GPG access
* Continuous Integration
* Georgiy Timchenko
* turbocrime
@ -287,7 +789,7 @@ Documentation and CI:
* 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
* Add a simple run script. Entry point for IDE debugger
Cyber security update:
@ -316,7 +818,7 @@ And also a big thanks to @RazCrimson (https://github.com/RazCrimson) for the sup
Version 3.3.0.4
===============
Refactor the Docker images factory, from now, only Alpine image wll be provided.
Refactor the Docker images factory, from now, only Alpine image will be provided.
The following Docker images (nicolargo/glances) are availables:
@ -364,9 +866,9 @@ Bug corrected:
* Correct issue with the regexp filter (use fullmatch instead of match)
* Errors when running Glances as web service #1702
* Apply alias to Duplicate sensor name #1686
* Make the hide function in sensors section compliant with lower/upercase #1590
* Make the hide function in sensors section compliant with lower/uppercase #1590
* Web UI truncates the days part of CPU time counter of the process list #2108
* Correct alignement issue with the diskio plugin (Console UI)
* Correct alignment issue with the diskio plugin (Console UI)
Documentation and CI:
@ -476,7 +978,7 @@ Bugs corrected:
* Threading.Event.isSet is deprecated in Python 3.10 #2017
* Fix code scanning alert - Clear-text logging of sensitive information security #2006
* The gpu temperature unit are displayed incorrectly in web ui bug #2002
* Doc for 'alert' Restfull/JSON API response documentation #1994
* Doc for 'alert' Restful/JSON API response documentation #1994
* Show the spinning state of a disk documentation #1993
* Web server status check endpoint enhancement #1988
* --time parameter being ignored for client/server mode bug #1978
@ -571,7 +1073,7 @@ Bugs corrected:
* [3.2.0/3.2.1] keybinding not working anymore #1904
* InfluxDB/InfluxDB2 Export object has no attribute hostname #1899
Documentation: The "make docs" generate RestFull/API documentation file.
Documentation: The "make docs" generate RestFul/API documentation file.
===============
Version 3.2.1
@ -633,7 +1135,7 @@ Bugs corrected:
* Docker containers information missing with Docker 20.10.x #1878
* Get system sensors temperatures thresholds #1864
Contibutors for this version:
Contributors for this version:
* Nicolargo
* Markus Pöschl
@ -1240,7 +1742,7 @@ Enhancements and new features:
* Add ZeroMQ exporter (issue #939)
* Add CouchDB exporter (issue #928)
* Add hotspot Wifi information (issue #937)
* Add default interface speed and automatic rate thresolds (issue #718)
* Add default interface speed and automatic rate thresholds (issue #718)
* Highlight max stats in the processes list (issue #878)
* Docker alerts and actions (issue #875)
* Glances API returns the processes PPID (issue #926)
@ -1598,7 +2100,7 @@ Version 2.1
* Add Glances log message (in the /tmp/glances.log file)
The default log level is INFO, you can switch to the DEBUG mode using the -d option on the command line.
* Add RESTful API to the Web server mode
RESTful API doc: https://github.com/nicolargo/glances/wiki/The-Glances-RESTFULL-JSON-API
RESTful API doc: https://github.com/nicolargo/glances/wiki/The-Glances-RESTFUL-JSON-API
* Improve SNMP fallback mode for Cisco IOS, VMware ESXi
* Add --theme-white feature to optimize display for white background
* Experimental history feature (--enable-history option on the command line)

385
README-pypi.rst Normal file
View File

@ -0,0 +1,385 @@
Glances 🌟
==========
**Glances** is an open-source system cross-platform monitoring tool.
It allows real-time monitoring of various aspects of your system such as
CPU, memory, disk, network usage etc. It also allows monitoring of running processes,
logged in users, temperatures, voltages, fan speeds etc.
It also supports container monitoring, it supports different container management
systems such as Docker, LXC. The information is presented in an easy to read dashboard
and can also be used for remote monitoring of systems via a web interface or command
line interface. It is easy to install and use and can be customized to show only
the information that you are interested in.
In client/server mode, remote monitoring could be done via terminal,
Web interface or API (XML-RPC and RESTful).
Stats can also be exported to files or external time/value databases, CSV or direct
output to STDOUT.
Glances is written in Python and uses libraries to grab information from
your system. It is based on an open architecture where developers can
add new plugins or exports modules.
Usage 👋
========
For the standalone mode, just run:
.. code-block:: console
$ glances
.. image:: https://github.com/nicolargo/glances/raw/refs/heads/master/docs/_static/glances-responsive-webdesign.png
For the Web server mode, run:
.. code-block:: console
$ glances -w
and enter the URL ``http://<ip>:61208`` in your favorite web browser.
In this mode, a HTTP/Restful API is exposed, see document `RestfulApi`_ for more details.
.. image:: https://github.com/nicolargo/glances/raw/refs/heads/master/docs/_static/screenshot-web.png
For the client/server mode (remote monitoring through XML-RPC), run the following command on the server:
.. code-block:: console
$ glances -s
and this one on the client:
.. code-block:: console
$ glances -c <ip>
You can also detect and display all Glances servers available on your
network (or defined in the configuration file) in TUI:
.. code-block:: console
$ glances --browser
or WebUI:
.. code-block:: console
$ glances -w --browser
It possible to display raw stats on stdout:
.. code-block:: console
$ glances --stdout cpu.user,mem.used,load
cpu.user: 30.7
mem.used: 3278204928
load: {'cpucore': 4, 'min1': 0.21, 'min5': 0.4, 'min15': 0.27}
cpu.user: 3.4
mem.used: 3275251712
load: {'cpucore': 4, 'min1': 0.19, 'min5': 0.39, 'min15': 0.27}
...
or in a CSV format thanks to the stdout-csv option:
.. code-block:: console
$ glances --stdout-csv now,cpu.user,mem.used,load
now,cpu.user,mem.used,load.cpucore,load.min1,load.min5,load.min15
2018-12-08 22:04:20 CEST,7.3,5948149760,4,1.04,0.99,1.04
2018-12-08 22:04:23 CEST,5.4,5949136896,4,1.04,0.99,1.04
...
or in a JSON format thanks to the stdout-json option (attribute not supported in this mode in order to have a real JSON object in output):
.. code-block:: console
$ glances --stdout-json cpu,mem
cpu: {"total": 29.0, "user": 24.7, "nice": 0.0, "system": 3.8, "idle": 71.4, "iowait": 0.0, "irq": 0.0, "softirq": 0.0, "steal": 0.0, "guest": 0.0, "guest_nice": 0.0, "time_since_update": 1, "cpucore": 4, "ctx_switches": 0, "interrupts": 0, "soft_interrupts": 0, "syscalls": 0}
mem: {"total": 7837949952, "available": 2919079936, "percent": 62.8, "used": 4918870016, "free": 2919079936, "active": 2841214976, "inactive": 3340550144, "buffers": 546799616, "cached": 3068141568, "shared": 788156416}
...
Last but not least, you can use the fetch mode to get a quick look of a machine:
.. code-block:: console
$ glances --fetch
Results look like this:
.. image:: https://github.com/nicolargo/glances/raw/refs/heads/master/docs/_static/screenshot-fetch.png
Use Glances as a Python library 📚
==================================
You can access the Glances API by importing the `glances.api` module and creating an
instance of the `GlancesAPI` class. This instance provides access to all Glances plugins
and their fields. For example, to access the CPU plugin and its total field, you can
use the following code:
.. code-block:: python
>>> from glances import api
>>> gl = api.GlancesAPI()
>>> gl.cpu
{'cpucore': 16,
'ctx_switches': 1214157811,
'guest': 0.0,
'idle': 91.4,
'interrupts': 991768733,
'iowait': 0.3,
'irq': 0.0,
'nice': 0.0,
'soft_interrupts': 423297898,
'steal': 0.0,
'syscalls': 0,
'system': 5.4,
'total': 7.3,
'user': 3.0}
>>> gl.cpu["total"]
7.3
>>> gl.mem["used"]
12498582144
>>> gl.auto_unit(gl.mem["used"])
11.6G
If the stats return a list of items (like network interfaces or processes), you can
access them by their name:
.. code-block:: python
>>> gl.network.keys()
['wlp0s20f3', 'veth33b370c', 'veth19c7711']
>>> gl.network["wlp0s20f3"]
{'alias': None,
'bytes_all': 362,
'bytes_all_gauge': 9242285709,
'bytes_all_rate_per_sec': 1032.0,
'bytes_recv': 210,
'bytes_recv_gauge': 7420522678,
'bytes_recv_rate_per_sec': 599.0,
'bytes_sent': 152,
'bytes_sent_gauge': 1821763031,
'bytes_sent_rate_per_sec': 433.0,
'interface_name': 'wlp0s20f3',
'key': 'interface_name',
'speed': 0,
'time_since_update': 0.3504955768585205}
For a complete example of how to use Glances as a library, have a look to the `PythonApi`_.
Documentation 📜
================
For complete documentation have a look at the readthedocs_ website.
If you have any question (after RTFM! and the `FAQ`_), please post it on the official Reddit `forum`_ or in GitHub `Discussions`_.
Gateway to other services 🌐
============================
Glances can export stats to:
- ``CSV`` file
- ``JSON`` file
- ``InfluxDB`` server
- ``Cassandra`` server
- ``CouchDB`` server
- ``OpenTSDB`` server
- ``Prometheus`` server
- ``StatsD`` server
- ``ElasticSearch`` server
- ``PostgreSQL/TimeScale`` server
- ``RabbitMQ/ActiveMQ`` broker
- ``ZeroMQ`` broker
- ``Kafka`` broker
- ``Riemann`` server
- ``Graphite`` server
- ``RESTful`` endpoint
Installation 🚀
===============
There are several methods to test/install Glances on your system. Choose your weapon!
PyPI: Pip, the standard way
---------------------------
Glances is on ``PyPI``. By using PyPI, you will be using the latest stable version.
To install Glances, simply use the ``pip`` command line.
Warning: on modern Linux operating systems, you may have an externally-managed-environment
error message when you try to use ``pip``. In this case, go to the the PipX section below.
.. code-block:: console
pip install --user glances
*Note*: Python headers are required to install `psutil`_, a Glances
dependency. For example, on Debian/Ubuntu **the simplest** is
``apt install python3-psutil`` or alternatively need to install first
the *python-dev* package and gcc (*python-devel* on Fedora/CentOS/RHEL).
For Windows, just install psutil from the binary installation file.
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, see features list bellow):
.. code-block:: console
pip install --user 'glances[all]'
Features list:
- all: install dependencies for all features
- action: install dependencies for action feature
- browser: install dependencies for Glances centram browser
- cloud: install dependencies for cloud plugin
- containers: install dependencies for container plugin
- export: install dependencies for all exports modules
- gpu: install dependencies for GPU plugin
- graph: install dependencies for graph export
- ip: install dependencies for IP public option
- raid: install dependencies for RAID plugin
- sensors: install dependencies for sensors plugin
- smart: install dependencies for smart plugin
- snmp: install dependencies for SNMP
- sparklines: install dependencies for sparklines option
- web: install dependencies for Webserver (WebUI) and Web API
- wifi: install dependencies for Wifi plugin
To upgrade Glances to the latest version:
.. code-block:: console
pip install --user --upgrade glances
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
PyPI: PipX, the alternative way
-------------------------------
Install PipX on your system (apt install pipx on Ubuntu).
Install Glances (with all features):
.. code-block:: console
pipx install 'glances[all]'
The glances script will be installed in the ~/.local/bin folder.
Shell tab completion 🔍
=======================
Glances 4.3.2 and higher includes shell tab autocompletion thanks to the --print-completion option.
For example, on a Linux operating system with bash shell:
.. code-block:: console
$ mkdir -p ${XDG_DATA_HOME:="$HOME/.local/share"}/bash-completion
$ glances --print-completion bash > ${XDG_DATA_HOME:="$HOME/.local/share"}/bash-completion/glances
$ source ${XDG_DATA_HOME:="$HOME/.local/share"}/bash-completion/glances
Following shells are supported: bash, zsh and tcsh.
Requirements 🧩
===============
Glances is developed in Python. A minimal Python version 3.10 or higher
should be installed on your system.
*Note for Python 2 users*
Glances version 4 or higher do not support Python 2 (and Python 3 < 3.10).
Please uses Glances version 3.4.x if you need Python 2 support.
Dependencies:
- ``psutil`` (better with latest version)
- ``defusedxml`` (in order to monkey patch xmlrpc)
- ``packaging`` (for the version comparison)
- ``windows-curses`` (Windows Curses implementation) [Windows-only]
- ``shtab`` (Shell autocompletion) [All but Windows]
- ``jinja2`` (for fetch mode and templating)
Extra dependencies:
- ``batinfo`` (for battery monitoring)
- ``bernhard`` (for the Riemann export module)
- ``cassandra-driver`` (for the Cassandra export module)
- ``chevron`` (for the action script feature)
- ``docker`` (for the Containers Docker monitoring support)
- ``elasticsearch`` (for the Elastic Search export module)
- ``FastAPI`` and ``Uvicorn`` (for Web server mode)
- ``graphitesender`` (For the Graphite export module)
- ``hddtemp`` (for HDD temperature monitoring support) [Linux-only]
- ``influxdb`` (for the InfluxDB version 1 export module)
- ``influxdb-client`` (for the InfluxDB version 2 export module)
- ``kafka-python`` (for the Kafka export module)
- ``nvidia-ml-py`` (for the GPU plugin)
- ``pycouchdb`` (for the CouchDB export module)
- ``pika`` (for the RabbitMQ/ActiveMQ export module)
- ``podman`` (for the Containers Podman monitoring support)
- ``potsdb`` (for the OpenTSDB export module)
- ``prometheus_client`` (for the Prometheus export module)
- ``psycopg[binary]`` (for the PostgreSQL/TimeScale export module)
- ``pygal`` (for the graph export module)
- ``pymdstat`` (for RAID support) [Linux-only]
- ``pymongo`` (for the MongoDB export module)
- ``pysnmp-lextudio`` (for SNMP support)
- ``pySMART.smartx`` (for HDD Smart support) [Linux-only]
- ``pyzmq`` (for the ZeroMQ export module)
- ``requests`` (for the Ports, Cloud plugins and RESTful export module)
- ``sparklines`` (for the Quick Plugin sparklines option)
- ``statsd`` (for the StatsD export module)
- ``wifi`` (for the wifi plugin) [Linux-only]
- ``zeroconf`` (for the autodiscover mode)
Project sponsorship 🙌
======================
You can help me to achieve my goals of improving this open-source project
or just say "thank you" by:
- sponsor me using one-time or monthly tier Github sponsors_ page
- send me some pieces of bitcoin: 185KN9FCix3svJYp7JQM7hRMfSKyeaJR4X
- buy me a gift on my wishlist_ page
Any and all contributions are greatly appreciated.
Authors and Contributors 🔥
===========================
Nicolas Hennion (@nicolargo) <nicolas@nicolargo.com>
.. image:: https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40nicolargo
:target: https://twitter.com/nicolargo
License 📜
==========
Glances is distributed under the LGPL version 3 license. See ``COPYING`` for more details.
.. _psutil: https://github.com/giampaolo/psutil
.. _readthedocs: https://glances.readthedocs.io/
.. _forum: https://www.reddit.com/r/glances/
.. _sponsors: https://github.com/sponsors/nicolargo
.. _wishlist: https://www.amazon.fr/hz/wishlist/ls/BWAAQKWFR3FI?ref_=wl_share
.. _PythonApi: https://glances.readthedocs.io/en/develop/api/python.html
.. _RestfulApi: https://glances.readthedocs.io/en/develop/api/restful.html
.. _FAQ: https://github.com/nicolargo/glances/blob/develop/docs/faq.rst
.. _Discussions: https://github.com/nicolargo/glances/discussions

View File

@ -1,10 +1,18 @@
===============================
Glances - An eye on your system
===============================
.. raw:: html
| |pypi| |test| |contibutors| |quality|
| |starts| |docker| |pypistat|
| |sponsors| |twitter|
<div align="center">
.. image:: ./docs/_static/glances-responsive-webdesign.png
.. raw:: html
<h1>Glances</h1>
An Eye on your System
| |pypi| |test| |contributors| |quality|
| |starts| |docker| |pypistat| |sponsors|
| |reddit|
.. |pypi| image:: https://img.shields.io/pypi/v/glances.svg
:target: https://pypi.python.org/pypi/Glances
@ -25,9 +33,9 @@ Glances - An eye on your system
:target: https://github.com/nicolargo/glances/actions
:alt: Linux tests (GitHub Actions)
.. |contibutors| image:: https://img.shields.io/github/contributors/nicolargo/glances
.. |contributors| 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
:alt: Contributors
.. |quality| image:: https://scrutinizer-ci.com/g/nicolargo/glances/badges/quality-score.png?b=develop
:target: https://scrutinizer-ci.com/g/nicolargo/glances/?branch=develop
@ -37,12 +45,20 @@ Glances - An eye on your system
:target: https://github.com/sponsors/nicolargo
:alt: Sponsors
.. |twitter| image:: https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40nicolargo
.. |twitter| image:: https://img.shields.io/badge/X-000000?style=for-the-badge&logo=x&logoColor=white
:target: https://twitter.com/nicolargo
:alt: @nicolargo
Summary
=======
.. |reddit| image:: https://img.shields.io/badge/Reddit-FF4500?style=for-the-badge&logo=reddit&logoColor=white
:target: https://www.reddit.com/r/glances/
:alt: @reddit
.. raw:: html
</div>
Summary 🌟
==========
**Glances** is an open-source system cross-platform monitoring tool.
It allows real-time monitoring of various aspects of your system such as
@ -54,100 +70,199 @@ and can also be used for remote monitoring of systems via a web interface or com
line interface. It is easy to install and use and can be customized to show only
the information that you are interested in.
.. image:: https://raw.githubusercontent.com/nicolargo/glances/develop/docs/_static/glances-summary.png
In client/server mode, remote monitoring could be done via terminal,
Web interface or API (XML-RPC and RESTful).
Stats can also be exported to files or external time/value databases, CSV or direct
output to STDOUT.
.. image:: https://raw.githubusercontent.com/nicolargo/glances/develop/docs/_static/glances-responsive-webdesign.png
Glances is written in Python and uses libraries to grab information from
your system. It is based on an open architecture where developers can
add new plugins or exports modules.
Project sponsorship
===================
Usage 👋
========
You can help me to achieve my goals of improving this open-source project
or just say "thank you" by:
For the standalone mode, just run:
- sponsor me using one-time or monthly tier Github sponsors_ page
- send me some pieces of bitcoin: 185KN9FCix3svJYp7JQM7hRMfSKyeaJR4X
- buy me a gift on my wishlist_ page
.. code-block:: console
Any and all contributions are greatly appreciated.
$ glances
Requirements
============
.. image:: ./docs/_static/glances-summary.png
- ``python>=3.8`` (use Glances 3.4.x for lower Python version)
- ``psutil`` (better with latest version)
- ``defusedxml`` (in order to monkey patch xmlrpc)
- ``packaging`` (for the version comparison)
- ``ujson`` (an optimized alternative to the standard json module)
- ``pydantic`` (for the data validation support)
For the Web server mode, run:
*Note for Python 2 users*
.. code-block:: console
Glances version 4 or higher do not support Python 2 (and Python 3 < 3.8).
Please uses Glances version 3.4.x if you need Python 2 support.
$ glances -w
Optional dependencies:
and enter the URL ``http://<ip>:61208`` in your favorite web browser.
- ``batinfo`` (for battery monitoring)
- ``bernhard`` (for the Riemann export module)
- ``cassandra-driver`` (for the Cassandra export module)
- ``chevron`` (for the action script feature)
- ``docker`` (for the Containers Docker monitoring support)
- ``elasticsearch`` (for the Elastic Search export module)
- ``FastAPI`` and ``Uvicorn`` (for Web server mode)
- ``graphitesender`` (For the Graphite export module)
- ``hddtemp`` (for HDD temperature monitoring support) [Linux-only]
- ``influxdb`` (for the InfluxDB version 1 export module)
- ``influxdb-client`` (for the InfluxDB version 2 export module)
- ``jinja2`` (for templating, used under the hood by FastAPI)
- ``kafka-python`` (for the Kafka export module)
- ``netifaces`` (for the IP plugin)
- ``nvidia-ml-py`` (for the GPU plugin)
- ``pycouchdb`` (for the CouchDB export module)
- ``pika`` (for the RabbitMQ/ActiveMQ export module)
- ``podman`` (for the Containers Podman monitoring support)
- ``potsdb`` (for the OpenTSDB export module)
- ``prometheus_client`` (for the Prometheus export module)
- ``py-cpuinfo`` (for the Quicklook CPU info module)
- ``pygal`` (for the graph export module)
- ``pymdstat`` (for RAID support) [Linux-only]
- ``pymongo`` (for the MongoDB export module)
- ``pysnmp-lextudio`` (for SNMP support)
- ``pySMART.smartx`` (for HDD Smart support) [Linux-only]
- ``pyzmq`` (for the ZeroMQ export module)
- ``requests`` (for the Ports, Cloud plugins and RESTful export module)
- ``sparklines`` (for the Quick Plugin sparklines option)
- ``statsd`` (for the StatsD export module)
- ``wifi`` (for the wifi plugin) [Linux-only]
- ``zeroconf`` (for the autodiscover mode)
In this mode, a HTTP/Restful API is exposed, see document `RestfulApi`_ for more details.
Installation
============
.. image:: ./docs/_static/screenshot-web.png
For the client/server mode (remote monitoring through XML-RPC), run the following command on the server:
.. code-block:: console
$ glances -s
and this one on the client:
.. code-block:: console
$ glances -c <ip>
You can also detect and display all Glances servers available on your
network (or defined in the configuration file) in TUI:
.. code-block:: console
$ glances --browser
or WebUI:
.. code-block:: console
$ glances -w --browser
It possible to display raw stats on stdout:
.. code-block:: console
$ glances --stdout cpu.user,mem.used,load
cpu.user: 30.7
mem.used: 3278204928
load: {'cpucore': 4, 'min1': 0.21, 'min5': 0.4, 'min15': 0.27}
cpu.user: 3.4
mem.used: 3275251712
load: {'cpucore': 4, 'min1': 0.19, 'min5': 0.39, 'min15': 0.27}
...
or in a CSV format thanks to the stdout-csv option:
.. code-block:: console
$ glances --stdout-csv now,cpu.user,mem.used,load
now,cpu.user,mem.used,load.cpucore,load.min1,load.min5,load.min15
2018-12-08 22:04:20 CEST,7.3,5948149760,4,1.04,0.99,1.04
2018-12-08 22:04:23 CEST,5.4,5949136896,4,1.04,0.99,1.04
...
or in a JSON format thanks to the stdout-json option (attribute not supported in this mode in order to have a real JSON object in output):
.. code-block:: console
$ glances --stdout-json cpu,mem
cpu: {"total": 29.0, "user": 24.7, "nice": 0.0, "system": 3.8, "idle": 71.4, "iowait": 0.0, "irq": 0.0, "softirq": 0.0, "steal": 0.0, "guest": 0.0, "guest_nice": 0.0, "time_since_update": 1, "cpucore": 4, "ctx_switches": 0, "interrupts": 0, "soft_interrupts": 0, "syscalls": 0}
mem: {"total": 7837949952, "available": 2919079936, "percent": 62.8, "used": 4918870016, "free": 2919079936, "active": 2841214976, "inactive": 3340550144, "buffers": 546799616, "cached": 3068141568, "shared": 788156416}
...
Last but not least, you can use the fetch mode to get a quick look of a machine:
.. code-block:: console
$ glances --fetch
Results look like this:
.. image:: ./docs/_static/screenshot-fetch.png
Use Glances as a Python library 📚
==================================
You can access the Glances API by importing the `glances.api` module and creating an
instance of the `GlancesAPI` class. This instance provides access to all Glances plugins
and their fields. For example, to access the CPU plugin and its total field, you can
use the following code:
.. code-block:: python
>>> from glances import api
>>> gl = api.GlancesAPI()
>>> gl.cpu
{'cpucore': 16,
'ctx_switches': 1214157811,
'guest': 0.0,
'idle': 91.4,
'interrupts': 991768733,
'iowait': 0.3,
'irq': 0.0,
'nice': 0.0,
'soft_interrupts': 423297898,
'steal': 0.0,
'syscalls': 0,
'system': 5.4,
'total': 7.3,
'user': 3.0}
>>> gl.cpu.get("total")
7.3
>>> gl.mem.get("used")
12498582144
>>> gl.auto_unit(gl.mem.get("used"))
11.6G
If the stats return a list of items (like network interfaces or processes), you can
access them by their name:
.. code-block:: python
>>> gl.network.keys()
['wlp0s20f3', 'veth33b370c', 'veth19c7711']
>>> gl.network.get("wlp0s20f3")
{'alias': None,
'bytes_all': 362,
'bytes_all_gauge': 9242285709,
'bytes_all_rate_per_sec': 1032.0,
'bytes_recv': 210,
'bytes_recv_gauge': 7420522678,
'bytes_recv_rate_per_sec': 599.0,
'bytes_sent': 152,
'bytes_sent_gauge': 1821763031,
'bytes_sent_rate_per_sec': 433.0,
'interface_name': 'wlp0s20f3',
'key': 'interface_name',
'speed': 0,
'time_since_update': 0.3504955768585205}
For a complete example of how to use Glances as a library, have a look to the `PythonApi`_.
Documentation 📜
================
For complete documentation have a look at the readthedocs_ website.
If you have any question (after RTFM! and the `FAQ`_), please post it on the official Reddit `forum`_ or in GitHub `Discussions`_.
Gateway to other services 🌐
============================
Glances can export stats to:
- files: ``CSV`` and ``JSON``
- databases: ``InfluxDB``, ``ElasticSearch``, ``PostgreSQL/TimeScale``, ``Cassandra``, ``CouchDB``, ``OpenTSDB``, ``Prometheus``, ``StatsD``, ``Riemann`` and ``Graphite``
- brokers: ``RabbitMQ/ActiveMQ``, ``NATS``, ``ZeroMQ`` and ``Kafka``
- others: ``RESTful`` endpoint
Installation 🚀
===============
There are several methods to test/install Glances on your system. Choose your weapon!
PyPI: Pip, the standard way
---------------------------
Glances is on ``PyPI``. By using PyPI, you will be using the latest
stable version.
Glances is on ``PyPI``. By using PyPI, you will be using the latest stable version.
To install Glances, simply use the ``pip`` command line.
Warning: on modern Linux operating systems, you may have an externally-managed-environment
error message when you try to use ``pip``. In this case, go to the the PipX section bellow.
To install Glances, simply use the ``pip`` command line in an virtual environment.
.. code-block:: console
pip install --user glances
cd ~
python3 -m venv ~/.venv
source ~/.venv/bin/activate
pip install glances
*Note*: Python headers are required to install `psutil`_, a Glances
dependency. For example, on Debian/Ubuntu **the simplest** is
@ -155,38 +270,55 @@ dependency. For example, on Debian/Ubuntu **the simplest** is
the *python-dev* package and gcc (*python-devel* on Fedora/CentOS/RHEL).
For Windows, just install psutil from the binary installation file.
By default, Glances is installed without the Web interface dependencies.
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]'
pip install 'glances[web]'
For a full installation (with all features):
For a full installation (with all features, see features list bellow):
.. code-block:: console
pip install --user 'glances[all]'
pip install 'glances[all]'
Features list:
- all: install dependencies for all features
- action: install dependencies for action feature
- browser: install dependencies for Glances centram browser
- cloud: install dependencies for cloud plugin
- containers: install dependencies for container plugin
- export: install dependencies for all exports modules
- gpu: install dependencies for GPU plugin
- graph: install dependencies for graph export
- ip: install dependencies for IP public option
- raid: install dependencies for RAID plugin
- sensors: install dependencies for sensors plugin
- smart: install dependencies for smart plugin
- snmp: install dependencies for SNMP
- sparklines: install dependencies for sparklines option
- web: install dependencies for Webserver (WebUI) and Web API
- wifi: install dependencies for Wifi plugin
To upgrade Glances to the latest version:
.. code-block:: console
pip install --user --upgrade glances
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
pip install --upgrade glances
PyPI: PipX, the alternative way
-------------------------------
Install PipX on your system (apt install pipx on Ubuntu).
Install PipX on your system. For example on Ubuntu/Debian:
Install Glances (with all features):
.. code-block:: console
sudo apt install pipx
Then install Glances (with all features):
.. code-block:: console
@ -194,19 +326,19 @@ Install Glances (with all features):
The glances script will be installed in the ~/.local/bin folder.
Docker: the cloudy way
----------------------
Glances Docker images are availables. You can use it to monitor your
server and all your containers !
Get the Glances container:
To upgrade Glances to the latest version:
.. code-block:: console
docker pull nicolargo/glances:latest-full
pipx upgrade glances
The following tags are availables:
Docker: the cloudy way
----------------------
Glances Docker images are available. You can use it to monitor your
server and all your containers !
The following tags are available:
- *latest-full* for a full Alpine Glances image (latest release) with all dependencies
- *latest* for a basic Alpine Glances (latest release) version with minimal dependencies (FastAPI and Docker)
@ -223,8 +355,6 @@ Run last version of Glances container in *console mode*:
By default, the /etc/glances/glances.conf file is used (based on docker-compose/glances.conf).
By default, the /etc/glances/glances.conf file is used (based on docker-compose/glances.conf).
Additionally, if you want to use your own glances.conf file, you can
create your own Dockerfile:
@ -252,13 +382,32 @@ Run the container in *Web server mode*:
For a full list of options, see the Glances `Docker`_ documentation page.
It is also possible to use a simple Docker compose file (see in ./docker-compose/docker-compose.yml):
.. code-block:: console
cd ./docker-compose
docker-compose up
It will start a Glances server with WebUI.
Brew: The missing package manager
---------------------------------
For Linux and Mac OS, it is also possible to install Glances with `Brew`_:
.. code-block:: console
brew install glances
GNU/Linux package
-----------------
`Glances` is available on many Linux distributions, so you should be
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 and only basics plugins are enabled.
able to install it using your favorite package manager. Nevetheless,
i do not recommend it. Be aware that when you use this method the operating
system `package`_ for `Glances`may not be the latest version and only basics
plugins are enabled.
Note: The Debian package (and all other Debian-based distributions) do
not include anymore the JS statics files used by the Web interface
@ -269,13 +418,30 @@ higher, the path to the statics file is configurable (see ``issue2612``).
FreeBSD
-------
To install the binary package:
On FreeBSD, package name depends on the Python version.
Check for Python version:
.. code-block:: console
# pkg install py39-glances
# python --version
To install Glances from ports:
Install the Glances package:
.. code-block:: console
# pkg install pyXY-glances
Where X and Y are the Major and Minor Values of your Python System.
.. code-block:: console
# Example for Python 3.11.3: pkg install py311-glances
**NOTE:** Check Glances Binary Package Version for your System Architecture.
You must have the Correct Python Version Installed which corresponds to the Glances Binary Package.
To install Glances from Ports:
.. code-block:: console
@ -285,9 +451,7 @@ To install Glances from ports:
macOS
-----
If you do not want to use the glancesautoinstall script, follow this procedure.
macOS users can install Glances using ``Homebrew`` or ``MacPorts``.
MacOS users can install Glances using ``Homebrew`` or ``MacPorts``.
Homebrew
````````
@ -307,11 +471,7 @@ Windows
-------
Install `Python`_ for Windows (Python 3.4+ ship with pip) and
then run the following command:
.. code-block:: console
$ pip install glances
follow the Glances Pip install procedure.
Android
-------
@ -345,9 +505,7 @@ To install Glances from source:
.. code-block:: console
$ wget https://github.com/nicolargo/glances/archive/vX.Y.tar.gz -O - | tar xz
$ cd glances-*
# python setup.py install
$ pip install https://github.com/nicolargo/glances/archive/vX.Y.tar.gz
*Note*: Python headers are required to install psutil.
@ -367,94 +525,77 @@ Ansible
A Glances ``Ansible`` role is available: https://galaxy.ansible.com/zaxos/glances-ansible-role/
Usage
=====
Shell tab completion 🔍
=======================
For the standalone mode, just run:
Glances 4.3.2 and higher includes shell tab autocompletion thanks to the --print-completion option.
For example, on a Linux operating system with bash shell:
.. code-block:: console
$ glances
$ mkdir -p ${XDG_DATA_HOME:="$HOME/.local/share"}/bash-completion
$ glances --print-completion bash > ${XDG_DATA_HOME:="$HOME/.local/share"}/bash-completion/glances
$ source ${XDG_DATA_HOME:="$HOME/.local/share"}/bash-completion/glances
For the Web server mode, run:
Following shells are supported: bash, zsh and tcsh.
.. code-block:: console
Requirements 🧩
===============
$ glances -w
Glances is developed in Python. A minimal Python version 3.10 or higher
should be installed on your system.
and enter the URL ``http://<ip>:61208`` in your favorite web browser.
*Note for Python 2 users*
For the client/server mode, run:
Glances version 4 or higher do not support Python 2 (and Python 3 < 3.10).
Please uses Glances version 3.4.x if you need Python 2 support.
.. code-block:: console
Dependencies:
$ glances -s
- ``psutil`` (better with latest version)
- ``defusedxml`` (in order to monkey patch xmlrpc)
- ``packaging`` (for the version comparison)
- ``windows-curses`` (Windows Curses implementation) [Windows-only]
- ``shtab`` (Shell autocompletion) [All but Windows]
- ``jinja2`` (for fetch mode and templating)
on the server side and run:
Extra dependencies:
.. code-block:: console
- ``batinfo`` (for battery monitoring)
- ``bernhard`` (for the Riemann export module)
- ``cassandra-driver`` (for the Cassandra export module)
- ``chevron`` (for the action script feature)
- ``docker`` (for the Containers Docker monitoring support)
- ``elasticsearch`` (for the Elastic Search export module)
- ``FastAPI`` and ``Uvicorn`` (for Web server mode)
- ``graphitesender`` (For the Graphite export module)
- ``hddtemp`` (for HDD temperature monitoring support) [Linux-only]
- ``influxdb`` (for the InfluxDB version 1 export module)
- ``influxdb-client`` (for the InfluxDB version 2 export module)
- ``kafka-python`` (for the Kafka export module)
- ``nats-py`` (for the NATS export module)
- ``nvidia-ml-py`` (for the GPU plugin)
- ``pycouchdb`` (for the CouchDB export module)
- ``pika`` (for the RabbitMQ/ActiveMQ export module)
- ``podman`` (for the Containers Podman monitoring support)
- ``potsdb`` (for the OpenTSDB export module)
- ``prometheus_client`` (for the Prometheus export module)
- ``psycopg[binary]`` (for the PostgreSQL/TimeScale export module)
- ``pygal`` (for the graph export module)
- ``pymdstat`` (for RAID support) [Linux-only]
- ``pymongo`` (for the MongoDB export module)
- ``pysnmp-lextudio`` (for SNMP support)
- ``pySMART.smartx`` (for HDD Smart support) [Linux-only]
- ``pyzmq`` (for the ZeroMQ export module)
- ``requests`` (for the Ports, Cloud plugins and RESTful export module)
- ``sparklines`` (for the Quick Plugin sparklines option)
- ``statsd`` (for the StatsD export module)
- ``wifi`` (for the wifi plugin) [Linux-only]
- ``zeroconf`` (for the autodiscover mode)
$ glances -c <ip>
on the client one.
You can also detect and display all Glances servers available on your
network or defined in the configuration file:
.. code-block:: console
$ glances --browser
You can also display raw stats on stdout:
.. code-block:: console
$ glances --stdout cpu.user,mem.used,load
cpu.user: 30.7
mem.used: 3278204928
load: {'cpucore': 4, 'min1': 0.21, 'min5': 0.4, 'min15': 0.27}
cpu.user: 3.4
mem.used: 3275251712
load: {'cpucore': 4, 'min1': 0.19, 'min5': 0.39, 'min15': 0.27}
...
or in a CSV format thanks to the stdout-csv option:
.. code-block:: console
$ glances --stdout-csv now,cpu.user,mem.used,load
now,cpu.user,mem.used,load.cpucore,load.min1,load.min5,load.min15
2018-12-08 22:04:20 CEST,7.3,5948149760,4,1.04,0.99,1.04
2018-12-08 22:04:23 CEST,5.4,5949136896,4,1.04,0.99,1.04
...
or in a JSON format thanks to the stdout-json option (attribute not supported in this mode in order to have a real JSON object in output):
.. code-block:: console
$ glances --stdout-json cpu,mem
cpu: {"total": 29.0, "user": 24.7, "nice": 0.0, "system": 3.8, "idle": 71.4, "iowait": 0.0, "irq": 0.0, "softirq": 0.0, "steal": 0.0, "guest": 0.0, "guest_nice": 0.0, "time_since_update": 1, "cpucore": 4, "ctx_switches": 0, "interrupts": 0, "soft_interrupts": 0, "syscalls": 0}
mem: {"total": 7837949952, "available": 2919079936, "percent": 62.8, "used": 4918870016, "free": 2919079936, "active": 2841214976, "inactive": 3340550144, "buffers": 546799616, "cached": 3068141568, "shared": 788156416}
...
and RTFM, always.
Documentation
=============
For complete documentation have a look at the readthedocs_ website.
If you have any question (after RTFM!), please post it on the official Q&A `forum`_.
Gateway to other services
=========================
Glances can export stats to: ``CSV`` file, ``JSON`` file, ``InfluxDB``, ``Cassandra``, ``CouchDB``,
``OpenTSDB``, ``Prometheus``, ``StatsD``, ``ElasticSearch``, ``RabbitMQ/ActiveMQ``,
``ZeroMQ``, ``Kafka``, ``Riemann``, ``Graphite`` and ``RESTful`` server.
How to contribute ?
===================
How to contribute ? 🤝
======================
If you want to contribute to the Glances project, read this `wiki`_ page.
@ -463,30 +604,53 @@ There is also a chat dedicated to the Glances developers:
.. image:: https://badges.gitter.im/Join%20Chat.svg
:target: https://gitter.im/nicolargo/glances?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
Author
======
Project sponsorship 🙌
======================
You can help me to achieve my goals of improving this open-source project
or just say "thank you" by:
- sponsor me using one-time or monthly tier Github sponsors_ page
- send me some pieces of bitcoin: 185KN9FCix3svJYp7JQM7hRMfSKyeaJR4X
- buy me a gift on my wishlist_ page
Any and all contributions are greatly appreciated.
Authors and Contributors 🔥
===========================
Nicolas Hennion (@nicolargo) <nicolas@nicolargo.com>
.. image:: https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40nicolargo
:target: https://twitter.com/nicolargo
License
=======
License 📜
==========
Glances is distributed under the LGPL version 3 license. See ``COPYING`` for more details.
More stars ! 🌟
===============
Please give us a star on `GitHub`_ if you like this project.
.. image:: https://api.star-history.com/svg?repos=nicolargo/glances&type=Date
:target: https://www.star-history.com/#nicolargo/glances&Date
:alt: Star history
.. _psutil: https://github.com/giampaolo/psutil
.. _glancesautoinstall: https://github.com/nicolargo/glancesautoinstall
.. _Brew: https://formulae.brew.sh/formula/glances
.. _Python: https://www.python.org/getit/
.. _Termux: https://play.google.com/store/apps/details?id=com.termux
.. _readthedocs: https://glances.readthedocs.io/
.. _forum: https://groups.google.com/forum/?hl=en#!forum/glances-users
.. _forum: https://www.reddit.com/r/glances/
.. _wiki: https://github.com/nicolargo/glances/wiki/How-to-contribute-to-Glances-%3F
.. _package: https://repology.org/project/glances/versions
.. _sponsors: https://github.com/sponsors/nicolargo
.. _wishlist: https://www.amazon.fr/hz/wishlist/ls/BWAAQKWFR3FI?ref_=wl_share
.. _issue2021: https://github.com/nicolargo/glances/issues/2021
.. _issue2021comment: https://github.com/nicolargo/glances/issues/2021#issuecomment-1197831157
.. _issue2612: https://github.com/nicolargo/glances/issues/2612
.. _Docker: https://github.com/nicolargo/glances/blob/develop/docs/docker.rst
.. _Docker: https://github.com/nicolargo/glances/blob/master/docs/docker.rst
.. _GitHub: https://github.com/nicolargo/glances
.. _PythonApi: https://glances.readthedocs.io/en/develop/api/python.html
.. _RestfulApi: https://glances.readthedocs.io/en/develop/api/restful.html
.. _FAQ: https://github.com/nicolargo/glances/blob/develop/docs/faq.rst
.. _Discussions: https://github.com/nicolargo/glances/discussions

View File

@ -2,13 +2,10 @@
## Supported Versions
Use this section to tell people about which versions of your project are
currently being supported with security updates.
| Version | Support security updates |
| ------- | ------------------------ |
| 3.x | :white_check_mark: |
| < 3.0 | :x: |
| 4.x | :white_check_mark: |
| < 4.0 | :x: |
## Reporting a Vulnerability
@ -31,4 +28,3 @@ If there are any vulnerabilities in {{cookiecutter.project_name}}, don't hesitat
4. Please do not disclose the vulnerability publicly until a fix is released!
Once we have either a) published a fix, or b) declined to address the vulnerability for whatever reason, you are free to publicly disclose it.

237
all-requirements.txt Normal file
View File

@ -0,0 +1,237 @@
# This file was autogenerated by uv via the following command:
# uv export --no-emit-workspace --no-hashes --all-extras --no-group dev --output-file all-requirements.txt
annotated-doc==0.0.4
# via fastapi
annotated-types==0.7.0
# via pydantic
anyio==4.12.0
# via
# elasticsearch
# starlette
batinfo==0.4.2 ; sys_platform == 'linux'
# via glances
bernhard==0.2.6
# via glances
cassandra-driver==3.29.3
# via glances
certifi==2025.11.12
# via
# elastic-transport
# influxdb-client
# influxdb3-python
# requests
cffi==2.0.0 ; implementation_name == 'pypy' or platform_python_implementation != 'PyPy'
# via
# cryptography
# pyzmq
chardet==5.2.0
# via pysmart
charset-normalizer==3.4.4
# via requests
chevron==0.14.0
# via glances
click==8.1.8
# via
# geomet
# uvicorn
colorama==0.4.6 ; sys_platform == 'win32'
# via click
cryptography==46.0.3
# via pysnmpcrypto
defusedxml==0.7.1
# via glances
dnspython==2.8.0
# via pymongo
docker==7.1.0
# via glances
elastic-transport==9.2.1
# via elasticsearch
elasticsearch==9.2.1
# via glances
exceptiongroup==1.2.2 ; python_full_version < '3.11'
# via anyio
fastapi==0.128.0
# via glances
geomet==1.1.0
# via cassandra-driver
graphitesender==0.11.2
# via glances
h11==0.16.0
# via uvicorn
humanfriendly==10.0
# via pysmart
ibm-cloud-sdk-core==3.24.2
# via ibmcloudant
ibmcloudant==0.11.2
# via glances
idna==3.11
# via
# anyio
# requests
ifaddr==0.2.0
# via zeroconf
importlib-metadata==8.7.1
# via pygal
influxdb==5.3.2
# via glances
influxdb-client==1.49.0
# via glances
influxdb3-python==0.16.0
# via glances
jinja2==3.1.6
# via
# glances
# pysmi-lextudio
kafka-python==2.3.0
# via glances
markupsafe==3.0.3
# via jinja2
msgpack==1.1.2
# via influxdb
nats-py==2.12.0
# via glances
nvidia-ml-py==13.590.44
# via glances
packaging==25.0
# via glances
paho-mqtt==2.1.0
# via glances
pbkdf2==1.3
# via wifi
pika==1.3.2
# via glances
ply==3.11
# via pysmi-lextudio
podman==5.6.0
# via glances
potsdb==1.0.3
# via glances
prometheus-client==0.23.1
# via glances
protobuf==6.33.2
# via bernhard
psutil==7.2.1
# via glances
psycopg==3.3.2
# via glances
psycopg-binary==3.3.2 ; implementation_name != 'pypy'
# via psycopg
pyarrow==22.0.0
# via influxdb3-python
pyasn1==0.6.1
# via pysnmp-lextudio
pycparser==2.23 ; (implementation_name != 'PyPy' and platform_python_implementation != 'PyPy') or (implementation_name == 'pypy' and platform_python_implementation == 'PyPy')
# via cffi
pydantic==2.12.5
# via fastapi
pydantic-core==2.41.5
# via pydantic
pygal==3.1.0
# via glances
pyjwt==2.10.1
# via
# ibm-cloud-sdk-core
# ibmcloudant
pymdstat==0.4.3
# via glances
pymongo==4.15.5
# via glances
pyreadline3==3.5.4 ; sys_platform == 'win32'
# via humanfriendly
pysmart==1.4.2
# via glances
pysmi-lextudio==1.4.3
# via pysnmp-lextudio
pysnmp-lextudio==6.1.2
# via glances
pysnmpcrypto==0.0.4
# via pysnmp-lextudio
python-dateutil==2.9.0.post0
# via
# elasticsearch
# glances
# ibm-cloud-sdk-core
# ibmcloudant
# influxdb
# influxdb-client
# influxdb3-python
pytz==2025.2
# via influxdb
pywin32==311 ; sys_platform == 'win32'
# via docker
pyzmq==27.1.0
# via glances
reactivex==4.1.0
# via
# influxdb-client
# influxdb3-python
requests==2.32.5
# via
# docker
# glances
# ibm-cloud-sdk-core
# ibmcloudant
# influxdb
# podman
# pysmi-lextudio
setuptools==80.9.0
# via
# influxdb-client
# wifi
shtab==1.8.0 ; sys_platform != 'win32'
# via glances
six==1.17.0
# via
# glances
# influxdb
# python-dateutil
sniffio==1.3.1
# via
# elastic-transport
# elasticsearch
sparklines==0.7.0
# via glances
starlette==0.50.0
# via fastapi
statsd==4.0.1
# via glances
termcolor==3.3.0
# via sparklines
tomli==2.0.2 ; python_full_version < '3.11'
# via podman
typing-extensions==4.15.0
# via
# anyio
# cryptography
# elasticsearch
# fastapi
# psycopg
# pydantic
# pydantic-core
# reactivex
# starlette
# typing-inspection
# uvicorn
typing-inspection==0.4.2
# via pydantic
tzdata==2025.3 ; sys_platform == 'win32'
# via psycopg
urllib3==2.6.2
# via
# docker
# elastic-transport
# ibm-cloud-sdk-core
# influxdb-client
# influxdb3-python
# podman
# requests
uvicorn==0.40.0
# via glances
wifi==0.3.8
# via glances
windows-curses==2.4.1 ; sys_platform == 'win32'
# via glances
zeroconf==0.148.0
# via glances
zipp==3.23.0
# via importlib-metadata

View File

@ -0,0 +1,9 @@
✨ {{ gl.system['hostname'] }}{{ ' - ' + gl.ip['address'] if gl.ip['address'] else '' }}
⚙️ {{ gl.system['hr_name'] }} | Uptime: {{ gl.uptime }}
💡 LOAD {{ '%0.2f'| format(gl.load['min1']) }} {{ '%0.2f'| format(gl.load['min5']) }} {{ '%0.2f'| format(gl.load['min15']) }}
⚡ CPU {{ gl.bar(gl.cpu['total']) }} {{ gl.cpu['total'] }}% of {{ gl.core['log'] }} cores
🧠 MEM {{ gl.bar(gl.mem['percent']) }} {{ gl.mem['percent'] }}% ({{ gl.auto_unit(gl.mem['used']) }} {{ gl.auto_unit(gl.mem['total']) }})
{% for fs in gl.fs.keys() %}💾 {% if loop.index == 1 %}DISK{% else %} {% endif %} {{ gl.bar(gl.fs[fs]['percent']) }} {{ gl.fs[fs]['percent'] }}% ({{ gl.auto_unit(gl.fs[fs]['used']) }} {{ gl.auto_unit(gl.fs[fs]['size']) }}) for {{ fs }}
{% endfor %}{% for net in gl.network.keys() %}📡 {% if loop.index == 1 %}NET{% else %} {% endif %} ↓ {{ gl.auto_unit(gl.network[net]['bytes_recv_rate_per_sec']) }}b/s ↑ {{ gl.auto_unit(gl.network[net]['bytes_sent_rate_per_sec']) }}b/s for {{ net }}
{% endfor %}

View File

@ -0,0 +1,23 @@
_____ _
/ ____| |
| | __| | __ _ _ __ ___ ___ ___
| | |_ | |/ _` | '_ \ / __/ _ \/ __|
| |__| | | (_| | | | | (_| __/\__
\_____|_|\__,_|_| |_|\___\___||___/
✨ {{ gl.system['hostname'] }}{{ ' - ' + gl.ip['address'] if gl.ip['address'] else '' }}
⚙️ {{ gl.system['hr_name'] }} | Uptime: {{ gl.uptime }}
💡 LOAD {{ '%0.2f'| format(gl.load['min1']) }} {{ '%0.2f'| format(gl.load['min5']) }} {{ '%0.2f'| format(gl.load['min15']) }}
⚡ CPU {{ gl.bar(gl.cpu['total']) }} {{ gl.cpu['total'] }}% of {{ gl.core['log'] }} cores
🧠 MEM {{ gl.bar(gl.mem['percent']) }} {{ gl.mem['percent'] }}% ({{ gl.auto_unit(gl.mem['used']) }} {{ gl.auto_unit(gl.mem['total']) }})
{% for fs in gl.fs.keys() %}💾 {% if loop.index == 1 %}DISK{% else %} {% endif %} {{ gl.bar(gl.fs[fs]['percent']) }} {{ gl.fs[fs]['percent'] }}% ({{ gl.auto_unit(gl.fs[fs]['used']) }} {{ gl.auto_unit(gl.fs[fs]['size']) }}) for {{ fs }}
{% endfor %}{% for net in gl.network.keys() %}📡 {% if loop.index == 1 %}NET{% else %} {% endif %} ↓ {{ gl.auto_unit(gl.network[net]['bytes_recv_rate_per_sec']) }}b/s ↑ {{ gl.auto_unit(gl.network[net]['bytes_sent_rate_per_sec']) }}b/s for {{ net }}
{% endfor %}
🔥 TOP PROCESS by CPU
{% for process in gl.top_process() %}{{ loop.index }}️⃣ {{ process['name'][:20] }}{{ ' ' * (20 - process['name'][:20] | length) }} ⚡ {{ process['cpu_percent'] }}% CPU{{ ' ' * (8 - (gl.auto_unit(process['cpu_percent']) | length)) }} 🧠 {{ gl.auto_unit(process['memory_info']['rss']) }}B MEM
{% endfor %}
🔥 TOP PROCESS by MEM
{% for process in gl.top_process(sorted_by='memory_percent', sorted_by_secondary='cpu_percent') %}{{ loop.index }}️⃣ {{ process['name'][:20] }}{{ ' ' * (20 - process['name'][:20] | length) }} 🧠 {{ gl.auto_unit(process['memory_info']['rss']) }}B MEM{{ ' ' * (7 - (gl.auto_unit(process['memory_info']['rss']) | length)) }} ⚡ {{ process['cpu_percent'] }}% CPU
{% endfor %}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@ check_update=true
# 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"
#strftime_format=%Y-%m-%d %H:%M:%S %Z
# Define external directory for loading additional plugins
# The layout follows the glances standard for plugin definitions
#plugin_dir=/home/user/dev/plugins
@ -23,12 +23,22 @@ history_size=1200
##############################################################################
[outputs]
# Options for all UIs
#--------------------
# Separator in the Curses and WebUI interface (between top and others plugins)
separator=True
#separator=True
# Set the the Curses and WebUI interface left menu plugin list (comma-separated)
#left_menu=network,wifi,connections,ports,diskio,fs,irq,folders,raid,smart,sensors,now
# Limit the number of processes to display (in the WebUI)
max_processes_display=25
#max_processes_display=25
#
# Specifics options for TUI
#--------------------------
# Disable background color
#disable_bg=True
#
# Specifics options for WebUI
#----------------------------
# Set URL prefix for the WebUI and the API
# Example: url_prefix=/glances/ => http://localhost/glances/
# Note: The final / is mandatory
@ -39,11 +49,28 @@ max_processes_display=25
# You can download it in a specific folder
# thanks to https://github.com/nicolargo/glances/issues/2021
# then configure this folder with the webui_root_path key
# Default is folder where glances_restfull_api.py is hosted
# Default is folder where glances_restful_api.py is hosted
#webui_root_path=
# CORS options
# Comma separated list of origins that should be permitted to make cross-origin requests.
# Default is *
#cors_origins=*
# Indicate that cookies should be supported for cross-origin requests.
# Default is True
#cors_credentials=True
# Comma separated list of HTTP methods that should be allowed for cross-origin requests.
# Default is *
#cors_methods=*
# Comma separated list of HTTP request headers that should be supported for cross-origin requests.
# Default is *
#cors_headers=*
# Define SSL files (keyfile_password is optional)
#ssl_keyfile_password=kfp
#ssl_keyfile=./glances.local+3-key.pem
#ssl_certfile=./glances.local+3.pem
##############################################################################
# plugins
# Plugins
##############################################################################
[quicklook]
@ -104,7 +131,7 @@ user_careful=50
user_warning=70
user_critical=90
user_log=False
#user_critical_action=echo {{user}} {{value}} {{max}} > /tmp/cpu.alert
#user_critical_action=echo "{{time}} User CPU {{user}} higher than {{critical}}" > /tmp/cpu.alert
#
system_careful=50
system_warning=70
@ -158,12 +185,14 @@ temperature_critical=80
[mem]
disable=False
# Display available memory instead of used memory
#available=True
# Define RAM thresholds in %
# Default values if not defined: 50/70/90
careful=50
#careful_action_repeat=echo {{percent}} >> /tmp/memory.alert
warning=70
critical=90
#critical_action_repeat=echo "{{time}} {{percent}} higher than {{critical}}"" >> /tmp/memory.alert
[memswap]
disable=False
@ -172,6 +201,7 @@ disable=False
careful=50
warning=70
critical=90
#warning_action=echo "{{time}} {{percent}} higher than {{warning}}"" > /tmp/memory.alert
[load]
disable=False
@ -199,6 +229,15 @@ tx_critical=90
hide=docker.*,lo
# Define the list of wireless network interfaces to be show (comma-separated)
#show=docker.*
# Automatically hide interface not up (default is False)
hide_no_up=True
# Automatically hide interface with no IP address (default is False)
hide_no_ip=True
# Set hide_zero to True to automatically hide interface with no traffic
hide_zero=False
# Set hide_threshold_bytes to an integer value to automatically hide
# interface with traffic less or equal than this value
#hide_threshold_bytes=0
# It is possible to overwrite the bitrate thresholds per interface
# WLAN 0 Default limits (in bits per second aka bps) for interface bitrate
#wlan0_rx_careful=4000000
@ -209,8 +248,9 @@ hide=docker.*,lo
#wlan0_tx_warning=900000
#wlan0_tx_critical=1000000
#wlan0_tx_log=True
#wlan0_rx_critical_action=echo "{{time}} {{interface_name}} RX {{bytes_recv_rate_per_sec}}Bps" > /tmp/network.alert
# Alias for network interface name
#alias=wlp2s0:WIFI
#alias=wlp0s20f3:WIFI
[ip]
# Disable display of private IP address
@ -259,10 +299,41 @@ disable=False
# Define the list of hidden disks (comma-separated regexp)
#hide=sda2,sda5,loop.*
hide=loop.*,/dev/loop.*
# Set hide_zero to True to automatically hide disk with no read/write
hide_zero=False
# Set hide_threshold_bytes to an integer value to automatically hide
# interface with traffic less or equal than this value
#hide_threshold_bytes=0
# Define the list of disks to be show (comma-separated)
#show=sda.*
# Alias for sda1 and sdb1
#alias=sda1:SystemDisk,sdb1:DataDisk
# Default latency thresholds (in ms) (rx = read / tx = write)
rx_latency_careful=10
rx_latency_warning=20
rx_latency_critical=50
tx_latency_careful=10
tx_latency_warning=20
tx_latency_critical=50
# Set latency thresholds (latency in ms) for a given disk name (rx = read / tx = write)
# dm-0_rx_latency_careful=10
# dm-0_rx_latency_warning=20
# dm-0_rx_latency_critical=50
# dm-0_rx_latency_log=False
# dm-0_tx_latency_careful=10
# dm-0_tx_latency_warning=20
# dm-0_tx_latency_critical=50
# dm-0_tx_latency_log=False
# There is no default bitrate thresholds for disk (because it is not possible to know the disk speed)
# Set bitrate thresholds (in bytes per second) for a given disk name (rx = read / tx = write)
#dm-0_rx_careful=4000000000
#dm-0_rx_warning=5000000000
#dm-0_rx_critical=6000000000
#dm-0_rx_log=False
#dm-0_tx_careful=700000000
#dm-0_tx_warning=900000000
#dm-0_tx_critical=1000000000
#dm-0_tx_log=False
[fs]
disable=False
@ -272,15 +343,19 @@ hide=/boot.*,.*/snap.*
#show=/,/srv
# Define filesystem space thresholds in %
# Default values if not defined: 50/70/90
# It is also possible to define per mount point value
# Example: /_careful=40
careful=50
warning=70
critical=90
# It is also possible to define per mount point value
# Example: /_careful=40
#/_careful=1
#/_warning=5
#/_critical=10
#/_critical_action=echo "{{time}} {{mnt_point}} filesystem space {{percent}}% higher than {{critical}}%" > /tmp/fs.alert
# Allow additional file system types (comma-separated FS type)
#allow=shm
# Alias for root file system
#alias=/:Root
#alias=/:Root,/zfspool:ZFS
[irq]
# Documentation: https://glances.readthedocs.io/en/latest/aoa/irq.html
@ -317,12 +392,18 @@ disable=True
[raid]
# Documentation: https://glances.readthedocs.io/en/latest/aoa/raid.html
# This plugin is disabled by default
disable=False
disable=True
[smart]
# Documentation: https://glances.readthedocs.io/en/latest/aoa/smart.html
# This plugin is disabled by default
disable=True
# Define the list of sensors to hide (comma-separated regexp)
#hide=.*Hide_this_driver.*
# Define the list of sensors to show (comma-separated regexp)
#show=.*Drive_Temperature.*
# List of attributes to hide (comma separated)
#hide_attributes=Self-tests,Errors
[hddtemp]
disable=False
@ -334,27 +415,35 @@ port=7634
# Documentation: https://glances.readthedocs.io/en/latest/aoa/sensors.html
disable=False
# Set the refresh multiplicator for the sensors
# By default refresh every Glances refresh * 3 (increase to reduce CPU consumption)
#refresh=3
# By default refresh every Glances refresh * 5 (increase to reduce CPU consumption)
#refresh=5
# Hide some sensors (comma separated list of regexp)
hide=unknown.*
# Show only the following sensors (comma separated list of regexp)
#show=CPU.*
# Sensors core thresholds (in Celsius...)
# Default values are grabbed from the system
# By default values are grabbed from the system
# Overwrite thresholds for a specific sensor
# temperature_core_Ambient_careful=40
# temperature_core_Ambient_warning=60
# temperature_core_Ambient_critical=85
# temperature_core_Ambient_log=True
# temperature_core_Ambient_critical_action=echo "{{time}} {{label}} temperature {{value}}{{unit}} higher than {{critical}}{{unit}}" > /tmp/temperature.alert
# Overwrite thresholds for a specific type of sensor
#temperature_core_careful=45
#temperature_core_warning=65
#temperature_core_critical=80
# Temperatures threshold in °C for hddtemp
# Default values if not defined: 45/52/60
temperature_hdd_careful=45
temperature_hdd_warning=52
temperature_hdd_critical=60
#temperature_hdd_careful=45
#temperature_hdd_warning=52
#temperature_hdd_critical=60
# Battery threshold in %
battery_careful=80
battery_warning=90
battery_critical=95
# Fan speed threashold in RPM
# Default values if not defined: 70/80/90
#battery_careful=70
#battery_warning=80
#battery_critical=90
# Fan speed threshold in RPM
#fan_speed_careful=100
# Sensors alias
#alias=core 0:CPU Core 0,core 1:CPU Core 1
@ -370,6 +459,12 @@ disable=False
# Should be one of the following:
# cpu_percent, memory_percent, io_counters, name, cpu_times, username
#sort_key=memory_percent
# List of stats to disable (not grabed and not display)
# Stats that can be disabled: cpu_percent,memory_info,memory_percent,username,cpu_times,num_threads,nice,status,io_counters,cmdline
# Stats that can not be disable: pid,name
#disable_stats=cpu_percent,memory_info,memory_percent,username,cpu_times,num_threads,nice,status,io_counters,cmdline
# Disable display of virtual memory
#disable_virtual_memory=True
# Define CPU/MEM (per process) thresholds in %
# Default values if not defined: 50/70/90
cpu_careful=50
@ -386,13 +481,20 @@ mem_critical=90
nice_warning=-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
#
# Nice: Example 2, low priority processes escalate from careful to critical
#nice_ok=O
#nice_careful=1,2,3,4,5,6,7,8,9
#nice_warning=10,11,12,13,14
#nice_critical=15,16,17,18,19
#
# Status: define threshold regarding the process status (first letter of process status)
# R: Running, S: Sleeping, Z: Zombie (complete list here https://psutil.readthedocs.io/en/latest/#process-status-constants)
status_ok=R,W,P,I
status_critical=Z,D
# Define the list of processes to export using:
# a comma-separated list of Glances filter
#export=.*firefox.*,pid:1234
# Define a list of process to focus on (comma-separated list of Glances filter)
#focus=.*firefox.*,.*python.*
[ports]
disable=False
@ -440,6 +542,15 @@ port_default_gateway=True
#web_4_url=https://blog.nicolargo.com/nonexist
#web_4_description=Intranet
[vms]
disable=True
# Define the maximum VMs size name (default is 20 chars)
max_name_size=20
# By default, Glances only display running VMs with states:
# 'Running', 'Paused', 'Starting' or 'Restarting'
# Set the following key to True to display all VMs regarding their states
all=False
[containers]
disable=False
# Only show specific containers (comma-separated list of container name or regular expression)
@ -450,8 +561,11 @@ disable=False
; hide=telegraf
# Define the maximum docker size name (default is 20 chars)
max_name_size=20
; cpu_careful=50
# List of stats to disable (not display)
# Following stats can be disabled: name,status,uptime,cpu,mem,diskio,networkio,ports,command
disable_stats=command
# Thresholds for CPU and MEM (in %)
; cpu_careful=50
; cpu_warning=70
; cpu_critical=90
; mem_careful=20
@ -485,20 +599,30 @@ disable=False
;min_interval=6
##############################################################################
# Client/server
# Browser mode - Static servers definition
##############################################################################
[serverlist]
# Define columns (comma separated list of <plugin>:<field>:(<key>)) to grab/display
# Default is: system:hr_name,load:min5,cpu:total,mem:percent
# You can also add stats with key, like sensors:value:Ambient (key is case sensitive)
#columns=system:hr_name,load:min5,cpu:total,mem:percent,memswap:percent,sensors:value:Ambient,sensors:value:Composite
# Define the static servers list
# _protocol can be: rpc (default if not defined) or rest
# List is limited to 256 servers max (1 to 256)
#server_1_name=localhost
#server_1_alias=My local PC
#server_1_port=61209
#server_1_alias=Local WebUI
#server_1_port=61266
#server_1_protocol=rest
#server_2_name=localhost
#server_2_port=61235
#server_2_alias=My local PC
#server_2_port=61209
#server_2_protocol=rpc
#server_3_name=192.168.0.17
#server_3_alias=Another PC on my network
#server_3_port=61209
#server_4_name=pasbon
#server_1_protocol=rpc
#server_4_name=notagooddefinition
#server_4_port=61237
[passwords]
@ -517,11 +641,16 @@ disable=False
# Exports
##############################################################################
[export]
# Common section for all exporters
# Do not export following fields (comma separated list of regex)
#exclude_fields=.*_critical,.*_careful,.*_warning,.*\.key$
[graph]
# Configuration for the --export graph option
# Set the path where the graph (.svg files) will be created
# Can be overwrite by the --graph-path command line option
path=/tmp
path=/tmp/glances
# It is possible to generate the graphs automatically by setting the
# generate_every to a non zero value corresponding to the seconds between
# two generation. Set it to 0 to disable graph auto generation.
@ -535,7 +664,7 @@ style=DarkStyle
[influxdb]
# !!!
# Will be DEPRECATED in future release.
# Please have a look on the new influxdb2 export module (compatible with InfluxDB 1.8.x and 2.x)
# Please have a look on the new influxdb3 export module
# !!!
# Configuration for the --export influxdb option
# https://influxdb.com/
@ -564,7 +693,28 @@ port=8086
protocol=http
org=nicolargo
bucket=glances
token=EjFUTWe8U-MIseEAkaVIgVnej_TrnbdvEcRkaB1imstW7gapSqy6_6-8XD-yd51V0zUUpDy-kAdVD1purDLuxA==
token=PUT_YOUR_INFLUXDB2_TOKEN_HERE
# Set the interval between two exports (in seconds)
# If the interval is set to 0, the Glances refresh time is used (default behavor)
#interval=0
# Prefix will be added for all measurement name
# Ex: prefix=foo
# => foo.cpu
# => foo.mem
# You can also use dynamic values
#prefix=foo
# Following tags will be added for all measurements
# You can also use dynamic values.
# Note: hostname and name (for process) are always added as a tag
#tags=foo:bar,spam:eggs,domain:`domainname`
[influxdb3]
# Configuration for the --export influxdb3 option
# https://influxdb.com/
host=http://localhost:8181
org=nicolargo
database=glances
token=PUT_YOUR_INFLUXDB3_TOKEN_HERE
# Set the interval between two exports (in seconds)
# If the interval is set to 0, the Glances refresh time is used (default behavor)
#interval=0
@ -730,6 +880,26 @@ prefix=glances
# By default, system_name = FQDN
#system_name=mycomputer
[timescaledb]
# Configuration for the --export timescaledb option
# https://www.timescale.com/
host=localhost
port=5432
db=glances
user=postgres
password=password
# Overwrite device name (default is the FQDN)
# Most of the time, you should not overwrite this value
#hostname=mycomputer
[nats]
# Configuration for the --export nats option
# https://nats.io/
# Host is a separated list of NATS nodes
host=nats://localhost:4222
# Prefix for the subjects (default is 'glances')
prefix=glances
##############################################################################
# AMPS
# * enable: Enable (true) or disable (false) the AMP
@ -765,13 +935,13 @@ refresh=3
countmax=20
[amp_conntrack]
# Use comma separated for multiple commands (no space around the comma)
# Use && separator for multiple commands
# If the regex key is not defined, the AMP will be executed every refresh second
# and the process count will not be displayed (countmin and countmax will be ignore)
enable=false
refresh=30
one_line=false
command=sysctl net.netfilter.nf_conntrack_count;sysctl net.netfilter.nf_conntrack_max
command=sysctl net.netfilter.nf_conntrack_count && sysctl net.netfilter.nf_conntrack_max
[amp_nginx]
# Use the NGinx AMP

View File

@ -1,17 +1,395 @@
py-spy
gprof2dot
black
pyright
requirements-parser
flake8
autopep8
autoflake
ruff
codespell
memory-profiler
matplotlib
semgrep
setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability
numpy>=1.22.2 # not directly required, pinned by Snyk to avoid a vulnerability
pillow>=10.0.1 # not directly required, pinned by Snyk to avoid a vulnerability
fonttools>=4.43.0 # not directly required, pinned by Snyk to avoid a vulnerability
# This file was autogenerated by uv via the following command:
# uv export --no-hashes --only-dev --output-file dev-requirements.txt
alabaster==1.0.0
# via sphinx
annotated-types==0.7.0
# via pydantic
anyio==4.12.0
# via
# httpx
# mcp
# sse-starlette
# starlette
attrs==25.4.0
# via
# glom
# jsonschema
# outcome
# referencing
# reuse
# semgrep
# trio
babel==2.17.0
# via sphinx
boltons==21.0.0
# via
# face
# glom
# semgrep
boolean-py==5.0
# via license-expression
bracex==2.6
# via wcmatch
certifi==2025.11.12
# via
# httpcore
# httpx
# requests
# selenium
cffi==2.0.0 ; (implementation_name != 'pypy' and os_name == 'nt') or platform_python_implementation != 'PyPy'
# via
# cryptography
# trio
cfgv==3.5.0
# via pre-commit
charset-normalizer==3.4.4
# via
# python-debian
# requests
click==8.1.8
# via
# click-option-group
# reuse
# semgrep
# typer
# uvicorn
click-option-group==0.5.9
# via semgrep
codespell==2.4.1
colorama==0.4.6
# via
# click
# pytest
# semgrep
# sphinx
contourpy==1.3.2 ; python_full_version < '3.11'
# via matplotlib
contourpy==1.3.3 ; python_full_version >= '3.11'
# via matplotlib
cryptography==46.0.3
# via pyjwt
cycler==0.12.1
# via matplotlib
distlib==0.4.0
# via virtualenv
docutils==0.21.2
# via
# rstcheck-core
# sphinx
# sphinx-rtd-theme
exceptiongroup==1.2.2
# via
# anyio
# pytest
# semgrep
# trio
# trio-websocket
face==24.0.0
# via glom
filelock==3.20.2
# via virtualenv
fonttools==4.61.1
# via matplotlib
glom==22.1.0
# via semgrep
googleapis-common-protos==1.72.0
# via opentelemetry-exporter-otlp-proto-http
gprof2dot==2025.4.14
h11==0.16.0
# via
# httpcore
# uvicorn
# wsproto
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via mcp
httpx-sse==0.4.3
# via mcp
identify==2.6.15
# via pre-commit
idna==3.11
# via
# anyio
# httpx
# requests
# trio
imagesize==1.4.1
# via sphinx
importlib-metadata==8.7.1
# via opentelemetry-api
iniconfig==2.3.0
# via pytest
jinja2==3.1.6
# via
# reuse
# sphinx
jsonschema==4.25.1
# via
# mcp
# semgrep
jsonschema-specifications==2025.9.1
# via jsonschema
kiwisolver==1.4.9
# via matplotlib
license-expression==30.4.4
# via reuse
markdown-it-py==4.0.0
# via rich
markupsafe==3.0.3
# via jinja2
matplotlib==3.10.8
mcp==1.23.3
# via semgrep
mdurl==0.1.2
# via markdown-it-py
memory-profiler==0.61.0
nodeenv==1.10.0
# via
# pre-commit
# pyright
numpy==2.2.6 ; python_full_version < '3.11'
# via
# contourpy
# matplotlib
numpy==2.4.0 ; python_full_version >= '3.11'
# via
# contourpy
# matplotlib
opentelemetry-api==1.37.0
# via
# opentelemetry-exporter-otlp-proto-http
# opentelemetry-instrumentation
# opentelemetry-instrumentation-requests
# opentelemetry-sdk
# opentelemetry-semantic-conventions
# semgrep
opentelemetry-exporter-otlp-proto-common==1.37.0
# via opentelemetry-exporter-otlp-proto-http
opentelemetry-exporter-otlp-proto-http==1.37.0
# via semgrep
opentelemetry-instrumentation==0.58b0
# via opentelemetry-instrumentation-requests
opentelemetry-instrumentation-requests==0.58b0
# via semgrep
opentelemetry-proto==1.37.0
# via
# opentelemetry-exporter-otlp-proto-common
# opentelemetry-exporter-otlp-proto-http
opentelemetry-sdk==1.37.0
# via
# opentelemetry-exporter-otlp-proto-http
# semgrep
opentelemetry-semantic-conventions==0.58b0
# via
# opentelemetry-instrumentation
# opentelemetry-instrumentation-requests
# opentelemetry-sdk
opentelemetry-util-http==0.58b0
# via opentelemetry-instrumentation-requests
outcome==1.3.0.post0
# via
# trio
# trio-websocket
packaging==25.0
# via
# matplotlib
# opentelemetry-instrumentation
# pytest
# requirements-parser
# semgrep
# sphinx
# webdriver-manager
peewee==3.18.3
# via semgrep
pillow==12.1.0
# via matplotlib
platformdirs==4.5.1
# via virtualenv
pluggy==1.6.0
# via pytest
pre-commit==4.5.1
protobuf==6.33.2
# via
# googleapis-common-protos
# opentelemetry-proto
psutil==7.2.1
# via memory-profiler
py-spy==0.4.1
pycparser==2.23 ; (implementation_name != 'PyPy' and implementation_name != 'pypy' and os_name == 'nt') or (implementation_name != 'PyPy' and platform_python_implementation != 'PyPy')
# via cffi
pydantic==2.12.5
# via
# mcp
# pydantic-settings
# rstcheck-core
pydantic-core==2.41.5
# via pydantic
pydantic-settings==2.12.0
# via mcp
pygments==2.19.2
# via
# pytest
# rich
# sphinx
pyinstrument==5.1.1
pyjwt==2.10.1
# via mcp
pyparsing==3.3.1
# via matplotlib
pyright==1.1.407
pysocks==1.7.1
# via urllib3
pytest==9.0.2
python-dateutil==2.9.0.post0
# via matplotlib
python-debian==1.0.1
# via reuse
python-dotenv==1.2.1
# via
# pydantic-settings
# webdriver-manager
python-magic==0.4.27
# via reuse
python-multipart==0.0.21
# via mcp
pywin32==311 ; sys_platform == 'win32'
# via
# mcp
# semgrep
pyyaml==6.0.3
# via pre-commit
referencing==0.37.0
# via
# jsonschema
# jsonschema-specifications
requests==2.32.5
# via
# opentelemetry-exporter-otlp-proto-http
# semgrep
# sphinx
# webdriver-manager
requirements-parser==0.13.0
reuse==6.2.0
rich==13.5.3
# via
# semgrep
# typer
roman-numerals==4.1.0 ; python_full_version >= '3.11'
# via roman-numerals-py
roman-numerals-py==4.1.0 ; python_full_version >= '3.11'
# via sphinx
rpds-py==0.30.0
# via
# jsonschema
# referencing
rstcheck==6.2.5
rstcheck-core==1.2.2
# via rstcheck
ruamel-yaml==0.19.1
# via semgrep
ruamel-yaml-clib==0.2.14
# via semgrep
ruff==0.14.10
selenium==4.39.0
semgrep==1.146.0
setuptools==80.9.0
shellingham==1.5.4
# via typer
six==1.17.0
# via python-dateutil
sniffio==1.3.1
# via trio
snowballstemmer==3.0.1
# via sphinx
sortedcontainers==2.4.0
# via trio
sphinx==8.1.3 ; python_full_version < '3.11'
# via
# sphinx-rtd-theme
# sphinxcontrib-jquery
sphinx==8.2.3 ; python_full_version >= '3.11'
# via
# sphinx-rtd-theme
# sphinxcontrib-jquery
sphinx-rtd-theme==3.0.2
sphinxcontrib-applehelp==2.0.0
# via sphinx
sphinxcontrib-devhelp==2.0.0
# via sphinx
sphinxcontrib-htmlhelp==2.1.0
# via sphinx
sphinxcontrib-jquery==4.1
# via sphinx-rtd-theme
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==2.0.0
# via sphinx
sphinxcontrib-serializinghtml==2.0.0
# via sphinx
sse-starlette==3.1.2
# via mcp
starlette==0.50.0
# via
# mcp
# sse-starlette
tomli==2.0.2
# via
# pytest
# semgrep
# sphinx
tomlkit==0.13.3
# via reuse
trio==0.32.0
# via
# selenium
# trio-websocket
trio-websocket==0.12.2
# via selenium
typer==0.21.0
# via rstcheck
typing-extensions==4.15.0
# via
# anyio
# cryptography
# mcp
# opentelemetry-api
# opentelemetry-exporter-otlp-proto-http
# opentelemetry-sdk
# opentelemetry-semantic-conventions
# pydantic
# pydantic-core
# pyright
# referencing
# selenium
# semgrep
# starlette
# typer
# typing-inspection
# uvicorn
# virtualenv
typing-inspection==0.4.2
# via
# mcp
# pydantic
# pydantic-settings
urllib3==2.6.2
# via
# requests
# selenium
# semgrep
uvicorn==0.40.0 ; sys_platform != 'emscripten'
# via mcp
virtualenv==20.35.4
# via pre-commit
wcmatch==8.5.2
# via semgrep
webdriver-manager==4.0.2
websocket-client==1.9.0
# via selenium
wrapt==1.17.3
# via opentelemetry-instrumentation
wsproto==1.3.2
# via trio-websocket
zipp==3.23.0
# via importlib-metadata

View File

@ -1,5 +0,0 @@
sphinx
sphinx_rtd_theme
ujson
reuse
setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability

View File

@ -1,3 +0,0 @@
FROM glances:local-alpine-minimal as glancesminimal
COPY glances.conf /glances/conf/glances.conf
CMD python -m glances -C /glances/conf/glances.conf $GLANCES_OPT

View File

@ -1,40 +0,0 @@
version: "3.9"
services:
reverse-proxy:
image: traefik
command: --api --docker
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
whoami:
image: emilevauge/whoami
labels:
- "traefik.frontend.rule=Host:whoami.docker.localhost"
monitoring:
image: nicolargo/glances:dev
restart: unless-stopped
pid: host
privileged: true
network_mode: "host"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro"
- "./glances.conf:/glances/conf/glances.conf"
environment:
- TZ=${TZ}
- "GLANCES_OPT=-C /glances/conf/glances.conf -w"
# Uncomment for GPU compatibilty (Nvidia) inside the container
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
labels:
- "traefik.port=61208"
- "traefik.frontend.rule=Host:glances.docker.localhost"

View File

@ -1,25 +1,55 @@
version: '3.9'
services:
glances:
build:
context: ./
dockerfile: Dockerfile
# See all images tags here: https://hub.docker.com/r/nicolargo/glances/tags
image: nicolargo/glances:latest-full
restart: always
pid: "host"
privileged: true
network_mode: "host"
read_only: true
privileged: false
# Uncomment next line for SATA or NVME smartctl monitoring
# cap_add:
# Uncomment next line for SATA smartctl monitoring
# - SYS_RAWIO
# Uncomment next line for NVME smartctl monitoring
# - SYS_ADMIN
# devices:
# - "/dev/nvme0"
volumes:
- "/:/rootfs:ro"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro"
- "./glances.conf:/glances/conf/glances.conf"
# Uncomment for proper distro information in upper panel.
# # Works only for distros that do have this file (most of distros do).
# - "/etc/os-release:/etc/os-release:ro"
tmpfs:
- /tmp
environment:
- TZ=${TZ}
- "GLANCES_OPT=-C /glances/conf/glances.conf -w"
# Uncomment for GPU compatibilty (Nvidia) inside the container
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
# Please set to your local timezone (or use local ${TZ} environment variable if set on your host)
- TZ=Europe/Paris
- GLANCES_OPT=-C /glances/conf/glances.conf -w --enable-plugin smart
- PYTHONPYCACHEPREFIX=/tmp/py_caches
# # Uncomment for GPU compatibility (Nvidia) inside the container
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
# Uncomment to protect Glances WebUI by a login/password (add --password to GLANCES_OPT)
# secrets:
# - source: glances_password
# target: /root/.config/glances/<login>.pwd
# secrets:
# glances_password:
# file: ./secrets/glances_password

232
docker-compose/glances.conf Executable file → Normal file
View File

@ -13,7 +13,7 @@ check_update=False
# 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"
#strftime_format=%Y-%m-%d %H:%M:%S %Z
# Define external directory for loading additional plugins
# The layout follows the glances standard for plugin definitions
#plugin_dir=/home/user/dev/plugins
@ -23,12 +23,22 @@ history_size=1200
##############################################################################
[outputs]
# Options for all UIs
#--------------------
# Separator in the Curses and WebUI interface (between top and others plugins)
separator=True
#separator=True
# Set the the Curses and WebUI interface left menu plugin list (comma-separated)
#left_menu=network,wifi,connections,ports,diskio,fs,irq,folders,raid,smart,sensors,now
# Limit the number of processes to display (in the WebUI)
max_processes_display=25
#
# Specifics options for TUI
#--------------------------
# Disable background color
#disable_bg=True
#
# Specifics options for WebUI
#----------------------------
# Set URL prefix for the WebUI and the API
# Example: url_prefix=/glances/ => http://localhost/glances/
# Note: The final / is mandatory
@ -39,11 +49,28 @@ max_processes_display=25
# You can download it in a specific folder
# thanks to https://github.com/nicolargo/glances/issues/2021
# then configure this folder with the webui_root_path key
# Default is folder where glances_restfull_api.py is hosted
# Default is folder where glances_restful_api.py is hosted
#webui_root_path=
# CORS options
# Comma separated list of origins that should be permitted to make cross-origin requests.
# Default is *
#cors_origins=*
# Indicate that cookies should be supported for cross-origin requests.
# Default is True
#cors_credentials=True
# Comma separated list of HTTP methods that should be allowed for cross-origin requests.
# Default is *
#cors_methods=*
# Comma separated list of HTTP request headers that should be supported for cross-origin requests.
# Default is *
#cors_headers=*
# Define SSL files (keyfile_password is optional)
#ssl_keyfile_password=kfp
#ssl_keyfile=./glances.local+3-key.pem
#ssl_certfile=./glances.local+3.pem
##############################################################################
# plugins
# Plugins
##############################################################################
[quicklook]
@ -104,7 +131,7 @@ user_careful=50
user_warning=70
user_critical=90
user_log=False
#user_critical_action=echo {{user}} {{value}} {{max}} > /tmp/cpu.alert
#user_critical_action=echo "{{time}} User CPU {{user}} higher than {{critical}}" > /tmp/cpu.alert
#
system_careful=50
system_warning=70
@ -158,12 +185,14 @@ temperature_critical=80
[mem]
disable=False
# Display available memory instead of used memory
#available=True
# Define RAM thresholds in %
# Default values if not defined: 50/70/90
careful=50
#careful_action_repeat=echo {{percent}} >> /tmp/memory.alert
warning=70
critical=90
#critical_action_repeat=echo "{{time}} {{percent}} higher than {{critical}}"" >> /tmp/memory.alert
[memswap]
disable=False
@ -172,6 +201,7 @@ disable=False
careful=50
warning=70
critical=90
#warning_action=echo "{{time}} {{percent}} higher than {{warning}}"" > /tmp/memory.alert
[load]
disable=False
@ -199,6 +229,15 @@ tx_critical=90
#hide=docker.*,lo
# Define the list of wireless network interfaces to be show (comma-separated)
#show=docker.*
# Automatically hide interface not up (default is False)
hide_no_up=True
# Automatically hide interface with no IP address (default is False)
hide_no_ip=True
# Set hide_zero to True to automatically hide interface with no traffic
hide_zero=False
# Set hide_threshold_bytes to an integer value to automatically hide
# interface with traffic less or equal than this value
#hide_threshold_bytes=0
# It is possible to overwrite the bitrate thresholds per interface
# WLAN 0 Default limits (in bits per second aka bps) for interface bitrate
#wlan0_rx_careful=4000000
@ -209,8 +248,9 @@ tx_critical=90
#wlan0_tx_warning=900000
#wlan0_tx_critical=1000000
#wlan0_tx_log=True
#wlan0_rx_critical_action=echo "{{time}} {{interface_name}} RX {{bytes_recv_rate_per_sec}}Bps" > /tmp/network.alert
# Alias for network interface name
#alias=wlp2s0:WIFI
#alias=wlp0s20f3:WIFI
[ip]
# Disable display of private IP address
@ -259,10 +299,41 @@ disable=False
# Define the list of hidden disks (comma-separated regexp)
#hide=sda2,sda5,loop.*
hide=loop.*,/dev/loop.*
# Set hide_zero to True to automatically hide disk with no read/write
hide_zero=False
# Set hide_threshold_bytes to an integer value to automatically hide
# interface with traffic less or equal than this value
#hide_threshold_bytes=0
# Define the list of disks to be show (comma-separated)
#show=sda.*
# Alias for sda1 and sdb1
#alias=sda1:SystemDisk,sdb1:DataDisk
# Default latency thresholds (in ms) (rx = read / tx = write)
rx_latency_careful=10
rx_latency_warning=20
rx_latency_critical=50
tx_latency_careful=10
tx_latency_warning=20
tx_latency_critical=50
# Set latency thresholds (latency in ms) for a given disk name (rx = read / tx = write)
# dm-0_rx_latency_careful=10
# dm-0_rx_latency_warning=20
# dm-0_rx_latency_critical=50
# dm-0_rx_latency_log=False
# dm-0_tx_latency_careful=10
# dm-0_tx_latency_warning=20
# dm-0_tx_latency_critical=50
# dm-0_tx_latency_log=False
# There is no default bitrate thresholds for disk (because it is not possible to know the disk speed)
# Set bitrate thresholds (in bytes per second) for a given disk name (rx = read / tx = write)
#dm-0_rx_careful=4000000000
#dm-0_rx_warning=5000000000
#dm-0_rx_critical=6000000000
#dm-0_rx_log=False
#dm-0_tx_careful=700000000
#dm-0_tx_warning=900000000
#dm-0_tx_critical=1000000000
#dm-0_tx_log=False
[fs]
disable=False
@ -272,15 +343,19 @@ hide=/boot.*,.*/snap.*
#show=/,/srv
# Define filesystem space thresholds in %
# Default values if not defined: 50/70/90
# It is also possible to define per mount point value
# Example: /_careful=40
careful=50
warning=70
critical=90
# It is also possible to define per mount point value
# Example: /_careful=40
#/_careful=1
#/_warning=5
#/_critical=10
#/_critical_action=echo "{{time}} {{mnt_point}} filesystem space {{percent}}% higher than {{critical}}%" > /tmp/fs.alert
# Allow additional file system types (comma-separated FS type)
#allow=shm
# Alias for root file system
#alias=/:Root
#alias=/:Root,/zsfpool:ZSF
[irq]
# Documentation: https://glances.readthedocs.io/en/latest/aoa/irq.html
@ -323,6 +398,12 @@ disable=True
# Documentation: https://glances.readthedocs.io/en/latest/aoa/smart.html
# This plugin is disabled by default
disable=True
# Define the list of sensors to hide (comma-separated regexp)
#hide=.*Hide_this_driver.*
# Define the list of sensors to show (comma-separated regexp)
#show=.*Drive_Temperature.*
# List of attributes to hide (comma separated)
#hide_attributes=Self-tests,Errors
[hddtemp]
disable=False
@ -334,27 +415,35 @@ port=7634
# Documentation: https://glances.readthedocs.io/en/latest/aoa/sensors.html
disable=False
# Set the refresh multiplicator for the sensors
# By default refresh every Glances refresh * 3 (increase to reduce CPU consumption)
#refresh=3
# By default refresh every Glances refresh * 5 (increase to reduce CPU consumption)
#refresh=5
# Hide some sensors (comma separated list of regexp)
hide=unknown.*
# Show only the following sensors (comma separated list of regexp)
#show=CPU.*
# Sensors core thresholds (in Celsius...)
# Default values are grabbed from the system
# By default values are grabbed from the system
# Overwrite thresholds for a specific sensor
# temperature_core_Ambient_careful=40
# temperature_core_Ambient_warning=60
# temperature_core_Ambient_critical=85
# temperature_core_Ambient_log=True
# temperature_core_Ambient_critical_action=echo "{{time}} {{label}} temperature {{value}}{{unit}} higher than {{critical}}{{unit}}" > /tmp/temperature.alert
# Overwrite thresholds for a specific type of sensor
#temperature_core_careful=45
#temperature_core_warning=65
#temperature_core_critical=80
# Temperatures threshold in °C for hddtemp
# Default values if not defined: 45/52/60
temperature_hdd_careful=45
temperature_hdd_warning=52
temperature_hdd_critical=60
#temperature_hdd_careful=45
#temperature_hdd_warning=52
#temperature_hdd_critical=60
# Battery threshold in %
battery_careful=80
battery_warning=90
battery_critical=95
# Fan speed threashold in RPM
# Default values if not defined: 70/80/90
#battery_careful=70
#battery_warning=80
#battery_critical=90
# Fan speed threshold in RPM
#fan_speed_careful=100
# Sensors alias
#alias=core 0:CPU Core 0,core 1:CPU Core 1
@ -370,6 +459,12 @@ disable=False
# Should be one of the following:
# cpu_percent, memory_percent, io_counters, name, cpu_times, username
#sort_key=memory_percent
# List of stats to disable (not grabed and not display)
# Stats that can be disabled: cpu_percent,memory_info,memory_percent,username,cpu_times,num_threads,nice,status,io_counters,cmdline
# Stats that can not be disable: pid,name
#disable_stats=cpu_percent,memory_info,memory_percent,username,cpu_times,num_threads,nice,status,io_counters,cmdline
# Disable display of virtual memory
#disable_virtual_memory=True
# Define CPU/MEM (per process) thresholds in %
# Default values if not defined: 50/70/90
cpu_careful=50
@ -386,13 +481,20 @@ mem_critical=90
nice_warning=-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
#
# Nice: Example 2, low priority processes escalate from careful to critical
#nice_ok=O
#nice_careful=1,2,3,4,5,6,7,8,9
#nice_warning=10,11,12,13,14
#nice_critical=15,16,17,18,19
#
# Status: define threshold regarding the process status (first letter of process status)
# R: Running, S: Sleeping, Z: Zombie (complete list here https://psutil.readthedocs.io/en/latest/#process-status-constants)
status_ok=R,W,P,I
status_critical=Z,D
# Define the list of processes to export using:
# a comma-separated list of Glances filter
#export=.*firefox.*,pid:1234
# Define a list of process to focus on (comma-separated list of Glances filter)
#focus=.*firefox.*,.*python.*
[ports]
disable=False
@ -440,6 +542,15 @@ port_default_gateway=False
#web_4_url=https://blog.nicolargo.com/nonexist
#web_4_description=Intranet
[vms]
disable=True
# Define the maximum VMs size name (default is 20 chars)
max_name_size=20
# By default, Glances only display running VMs with states:
# 'Running', 'Paused', 'Starting' or 'Restarting'
# Set the following key to True to display all VMs regarding their states
all=False
[containers]
disable=False
# Only show specific containers (comma-separated list of container name or regular expression)
@ -450,8 +561,11 @@ disable=False
; hide=telegraf
# Define the maximum docker size name (default is 20 chars)
max_name_size=20
; cpu_careful=50
# List of stats to disable (not display)
# Following stats can be disabled: name,status,uptime,cpu,mem,diskio,networkio,ports,command
disable_stats=command
# Thresholds for CPU and MEM (in %)
; cpu_careful=50
; cpu_warning=70
; cpu_critical=90
; mem_careful=20
@ -485,20 +599,30 @@ disable=False
;min_interval=6
##############################################################################
# Client/server
# Browser mode - Static servers definition
##############################################################################
[serverlist]
# Define columns (comma separated list of <plugin>:<field>:(<key>)) to grab/display
# Default is: system:hr_name,load:min5,cpu:total,mem:percent
# You can also add stats with key, like sensors:value:Ambient (key is case sensitive)
#columns=system:hr_name,load:min5,cpu:total,mem:percent,memswap:percent,sensors:value:Ambient,sensors:value:Composite
# Define the static servers list
# _protocol can be: rpc (default if not defined) or rest
# List is limited to 256 servers max (1 to 256)
#server_1_name=localhost
#server_1_alias=My local PC
#server_1_port=61209
#server_1_alias=Local WebUI
#server_1_port=61266
#server_1_protocol=rest
#server_2_name=localhost
#server_2_port=61235
#server_2_alias=My local PC
#server_2_port=61209
#server_2_protocol=rpc
#server_3_name=192.168.0.17
#server_3_alias=Another PC on my network
#server_3_port=61209
#server_4_name=pasbon
#server_1_protocol=rpc
#server_4_name=notagooddefinition
#server_4_port=61237
[passwords]
@ -517,11 +641,16 @@ disable=False
# Exports
##############################################################################
[export]
# Common section for all exporters
# Do not export following fields (comma separated list of regex)
#exclude_fields=.*_critical,.*_careful,.*_warning,.*\.key$
[graph]
# Configuration for the --export graph option
# Set the path where the graph (.svg files) will be created
# Can be overwrite by the --graph-path command line option
path=/tmp
path=/tmp/glances
# It is possible to generate the graphs automatically by setting the
# generate_every to a non zero value corresponding to the seconds between
# two generation. Set it to 0 to disable graph auto generation.
@ -535,7 +664,7 @@ style=DarkStyle
[influxdb]
# !!!
# Will be DEPRECATED in future release.
# Please have a look on the new influxdb2 export module (compatible with InfluxDB 1.8.x and 2.x)
# Please have a look on the new influxdb3 export module
# !!!
# Configuration for the --export influxdb option
# https://influxdb.com/
@ -564,7 +693,28 @@ port=8086
protocol=http
org=nicolargo
bucket=glances
token=EjFUTWe8U-MIseEAkaVIgVnej_TrnbdvEcRkaB1imstW7gapSqy6_6-8XD-yd51V0zUUpDy-kAdVD1purDLuxA==
token=PUT_YOUR_INFLUXDB2_TOKEN_HERE
# Set the interval between two exports (in seconds)
# If the interval is set to 0, the Glances refresh time is used (default behavor)
#interval=0
# Prefix will be added for all measurement name
# Ex: prefix=foo
# => foo.cpu
# => foo.mem
# You can also use dynamic values
#prefix=foo
# Following tags will be added for all measurements
# You can also use dynamic values.
# Note: hostname and name (for process) are always added as a tag
#tags=foo:bar,spam:eggs,domain:`domainname`
[influxdb3]
# Configuration for the --export influxdb3 option
# https://influxdb.com/
host=http://localhost:8181
org=nicolargo
database=glances
token=PUT_YOUR_INFLUXDB3_TOKEN_HERE
# Set the interval between two exports (in seconds)
# If the interval is set to 0, the Glances refresh time is used (default behavor)
#interval=0
@ -730,6 +880,26 @@ prefix=glances
# By default, system_name = FQDN
#system_name=mycomputer
[timescaledb]
# Configuration for the --export timescaledb option
# https://www.timescale.com/
host=localhost
port=5432
db=glances
user=postgres
password=password
# Overwrite device name (default is the FQDN)
# Most of the time, you should not overwrite this value
#hostname=mycomputer
[nats]
# Configuration for the --export nats option
# https://nats.io/
# Host is a separated list of NATS nodes
host=nats://localhost:4222
# Prefix for the subjects (default is 'glances')
prefix=glances
##############################################################################
# AMPS
# * enable: Enable (true) or disable (false) the AMP
@ -765,13 +935,13 @@ refresh=3
countmax=20
[amp_conntrack]
# Use comma separated for multiple commands (no space around the comma)
# Use && separator for multiple commands
# If the regex key is not defined, the AMP will be executed every refresh second
# and the process count will not be displayed (countmin and countmax will be ignore)
enable=false
refresh=30
one_line=false
command=sysctl net.netfilter.nf_conntrack_count;sysctl net.netfilter.nf_conntrack_max
command=sysctl net.netfilter.nf_conntrack_count && sysctl net.netfilter.nf_conntrack_max
[amp_nginx]
# Use the NGinx AMP

View File

@ -9,13 +9,12 @@
# WARNING: the Alpine image version and Python version should be set.
# Alpine 3.18 tag is a link to the latest 3.18.x version.
# Be aware that if you change the Alpine version, you may have to change the Python version.
ARG IMAGE_VERSION=3.19
ARG PYTHON_VERSION=3.11
ARG IMAGE_VERSION=3.23
ARG PYTHON_VERSION=3.12
##############################################################################
# Base layer to be used for building dependencies and the release images
FROM alpine:${IMAGE_VERSION} as base
FROM alpine:${IMAGE_VERSION} AS base
# Upgrade the system
RUN apk update \
@ -35,7 +34,7 @@ RUN apk add --no-cache \
# BUILD Stages
##############################################################################
# BUILD: Base image shared by all build images
FROM base as build
FROM base AS build
ARG PYTHON_VERSION
RUN apk add --no-cache \
@ -56,31 +55,27 @@ RUN apk add --no-cache \
pkgconfig \
libffi-dev \
openssl-dev \
cmake # Issue: https://github.com/nicolargo/glances/issues/2735
RUN python${PYTHON_VERSION} -m venv venv-build
RUN /venv-build/bin/python${PYTHON_VERSION} -m pip install --upgrade pip
cmake
# for cmake: Issue: https://github.com/nicolargo/glances/issues/2735
RUN python${PYTHON_VERSION} -m venv venv-build
RUN /venv-build/bin/python${PYTHON_VERSION} -m pip install --upgrade pip
RUN python${PYTHON_VERSION} -m venv --without-pip venv
COPY requirements.txt docker-requirements.txt webui-requirements.txt optional-requirements.txt ./
COPY pyproject.toml docker-requirements.txt all-requirements.txt ./
##############################################################################
# BUILD: Install the minimal image deps
FROM build as buildMinimal
FROM build AS buildminimal
ARG PYTHON_VERSION
RUN /venv-build/bin/python${PYTHON_VERSION} -m pip install --target="/venv/lib/python${PYTHON_VERSION}/site-packages" \
-r requirements.txt \
-r docker-requirements.txt \
-r webui-requirements.txt
-r docker-requirements.txt
##############################################################################
# BUILD: Install all the deps
FROM build as buildFull
FROM build AS buildfull
ARG PYTHON_VERSION
# Required for optional dependency cassandra-driver
@ -89,14 +84,13 @@ ARG CASS_DRIVER_NO_CYTHON=1
ARG CARGO_NET_GIT_FETCH_WITH_CLI=true
RUN /venv-build/bin/python${PYTHON_VERSION} -m pip install --target="/venv/lib/python${PYTHON_VERSION}/site-packages" \
-r requirements.txt \
-r optional-requirements.txt
-r all-requirements.txt
##############################################################################
# RELEASE Stages
##############################################################################
# Base image shared by all releases
FROM base as release
FROM base AS release
ARG PYTHON_VERSION
# Copy source code and config file
@ -108,36 +102,48 @@ COPY docker-bin.sh /usr/local/bin/glances
RUN chmod a+x /usr/local/bin/glances
ENV PATH="/venv/bin:$PATH"
# Copy binary and update PATH
COPY docker-bin.sh /usr/local/bin/glances
RUN chmod a+x /usr/local/bin/glances
ENV PATH="/venv/bin:$PATH"
# EXPOSE PORT (XMLRPC / WebUI)
EXPOSE 61209 61208
# Add glances user
# RUN addgroup -g 1000 glances && \
# adduser -D -u 1000 -G glances glances && \
# chown -R glances:glances /app
# Define default command.
WORKDIR /app
CMD /venv/bin/python3 -m glances $GLANCES_OPT
ENV PYTHON_VERSION=${PYTHON_VERSION}
CMD ["/bin/sh", "-c", "/venv/bin/python${PYTHON_VERSION} -m glances ${GLANCES_OPT}"]
################################################################################
# RELEASE: minimal
FROM release as minimal
FROM release AS minimal
COPY --from=buildMinimal /venv /venv
COPY --from=buildminimal /venv /venv
# USER glances
################################################################################
# RELEASE: full
FROM release as full
FROM release AS full
RUN apk add --no-cache libzmq
COPY --from=buildFull /venv /venv
COPY --from=buildfull /venv /venv
# USER glances
################################################################################
# RELEASE: dev - to be compatible with CI
FROM full as dev
FROM full AS dev
# Forward access and error logs to Docker's log collector
RUN ln -sf /dev/stdout /tmp/glances-root.log \
&& ln -sf /dev/stderr /var/log/error.log
# Add the specific logger configuration file for Docker dev
# All logs will be forwarded to stdout
COPY ./docker-files/docker-logger.json /app
ENV LOG_CFG=/app/docker-logger.json
# USER glances
WORKDIR /app
ENV PYTHON_VERSION=${PYTHON_VERSION}
CMD ["/bin/sh", "-c", "/venv/bin/python${PYTHON_VERSION} -m glances ${GLANCES_OPT}"]

View File

@ -0,0 +1,24 @@
{
"version": 1,
"disable_existing_loggers": "False",
"root": { "level": "INFO", "handlers": ["console"] },
"formatters": {
"standard": { "format": "%(asctime)s -- %(levelname)s -- %(message)s" },
"short": { "format": "%(levelname)s -- %(message)s" },
"long": {
"format": "%(asctime)s -- %(levelname)s -- %(message)s (%(funcName)s in %(filename)s)"
},
"free": { "format": "%(message)s" }
},
"handlers": {
"console": { "class": "logging.StreamHandler", "formatter": "standard" }
},
"loggers": {
"debug": { "handlers": ["console"], "level": "DEBUG" },
"verbose": { "handlers": ["console"], "level": "INFO" },
"standard": { "handlers": ["console"], "level": "INFO" },
"requests": { "handlers": ["console"], "level": "ERROR" },
"elasticsearch": { "handlers": ["console"], "level": "ERROR" },
"elasticsearch.trace": { "handlers": ["console"], "level": "ERROR" }
}
}

View File

@ -13,7 +13,7 @@ ARG PYTHON_VERSION=3.12
##############################################################################
# Base layer to be used for building dependencies and the release images
FROM ubuntu:${IMAGE_VERSION} as base
FROM ubuntu:${IMAGE_VERSION} AS base
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
@ -32,7 +32,7 @@ RUN apt-get update \
# BUILD Stages
##############################################################################
# BUILD: Base image shared by all build images
FROM base as build
FROM base AS build
ARG PYTHON_VERSION
ARG DEBIAN_FRONTEND=noninteractive
@ -55,32 +55,29 @@ RUN apt-get clean \
RUN python3 -m venv --without-pip venv
COPY requirements.txt docker-requirements.txt webui-requirements.txt optional-requirements.txt ./
COPY pyproject.toml docker-requirements.txt all-requirements.txt ./
##############################################################################
# BUILD: Install the minimal image deps
FROM build as buildMinimal
FROM build AS buildminimal
ARG PYTHON_VERSION
RUN python3 -m pip install --target="/venv/lib/python${PYTHON_VERSION}/site-packages" \
-r requirements.txt \
-r docker-requirements.txt \
-r webui-requirements.txt
-r docker-requirements.txt
##############################################################################
# BUILD: Install all the deps
FROM build as buildFull
FROM build AS buildfull
ARG PYTHON_VERSION
RUN python3 -m pip install --target="/venv/lib/python${PYTHON_VERSION}/site-packages" \
-r requirements.txt \
-r optional-requirements.txt
-r all-requirements.txt
##############################################################################
# RELEASE Stages
##############################################################################
# Base image shared by all releases
FROM base as release
FROM base AS release
ARG PYTHON_VERSION
# Copy Glances source code and config file
@ -92,28 +89,34 @@ COPY docker-bin.sh /usr/local/bin/glances
RUN chmod a+x /usr/local/bin/glances
ENV PATH="/venv/bin:$PATH"
# Copy binary and update PATH
COPY docker-bin.sh /usr/local/bin/glances
RUN chmod a+x /usr/local/bin/glances
ENV PATH="/venv/bin:$PATH"
# EXPOSE PORT (XMLRPC / WebUI)
EXPOSE 61209 61208
# Add glances user
# NOTE: If used, the Glances Docker plugin do not work...
# UID and GUID 1000 are already configured for the ubuntu user
# Create anew one with UID and GUID 1001
# RUN groupadd -g 1001 glances && \
# useradd -u 1001 -g glances glances && \
# chown -R glances:glances /app
# Define default command.
WORKDIR /app
CMD /venv/bin/python3 -m glances $GLANCES_OPT
ENV PYTHON_VERSION=${PYTHON_VERSION}
CMD ["/bin/sh", "-c", "/venv/bin/python${PYTHON_VERSION} -m glances ${GLANCES_OPT}"]
################################################################################
# RELEASE: minimal
FROM release as minimal
FROM release AS minimal
ARG PYTHON_VERSION
COPY --from=buildMinimal /venv /venv
# USER glances
################################################################################
# RELEASE: full
FROM release as full
FROM release AS full
ARG PYTHON_VERSION
RUN apt-get update \
@ -121,13 +124,22 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=buildFull /venv /venv
COPY --from=buildfull /venv /venv
# USER glances
################################################################################
# RELEASE: dev - to be compatible with CI
FROM full as dev
FROM full AS dev
ARG PYTHON_VERSION
# Forward access and error logs to Docker's log collector
RUN ln -sf /dev/stdout /tmp/glances-root.log \
&& ln -sf /dev/stderr /var/log/error.log
# Add the specific logger configuration file for Docker dev
# All logs will be forwarded to stdout
COPY ./docker-files/docker-logger.json /app
ENV LOG_CFG=/app/docker-logger.json
# USER glances
WORKDIR /app
ENV PYTHON_VERSION=${PYTHON_VERSION}
CMD ["/bin/sh", "-c", "/venv/bin/python${PYTHON_VERSION} -m glances ${GLANCES_OPT}"]

View File

@ -1,10 +1,83 @@
# install with base requirements file
-r requirements.txt
docker>=6.1.1; python_version >= "3.7"
podman; python_version >= "3.6"
packaging; python_version >= "3.7"
python-dateutil
six
urllib3
requests
# This file was autogenerated by uv via the following command:
# uv export --no-emit-workspace --no-hashes --no-group dev --extra containers --extra web --output-file docker-requirements.txt
annotated-doc==0.0.4
# via fastapi
annotated-types==0.7.0
# via pydantic
anyio==4.12.0
# via starlette
certifi==2025.11.12
# via requests
charset-normalizer==3.4.4
# via requests
click==8.1.8
# via uvicorn
colorama==0.4.6 ; sys_platform == 'win32'
# via click
defusedxml==0.7.1
# via glances
docker==7.1.0
# via glances
exceptiongroup==1.2.2 ; python_full_version < '3.11'
# via anyio
fastapi==0.128.0
# via glances
h11==0.16.0
# via uvicorn
idna==3.11
# via
# anyio
# requests
jinja2==3.1.6
# via glances
markupsafe==3.0.3
# via jinja2
packaging==25.0
# via glances
podman==5.6.0
# via glances
psutil==7.2.1
# via glances
pydantic==2.12.5
# via fastapi
pydantic-core==2.41.5
# via pydantic
python-dateutil==2.9.0.post0
# via glances
pywin32==311 ; sys_platform == 'win32'
# via docker
requests==2.32.5
# via
# docker
# glances
# podman
shtab==1.8.0 ; sys_platform != 'win32'
# via glances
six==1.17.0
# via
# glances
# python-dateutil
starlette==0.50.0
# via fastapi
tomli==2.0.2 ; python_full_version < '3.11'
# via podman
typing-extensions==4.15.0
# via
# anyio
# fastapi
# pydantic
# pydantic-core
# starlette
# typing-inspection
# uvicorn
typing-inspection==0.4.2
# via pydantic
urllib3==2.6.2
# via
# docker
# podman
# requests
uvicorn==0.40.0
# via glances
windows-curses==2.4.1 ; sys_platform == 'win32'
# via glances

View File

@ -3,7 +3,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = ../venv-dev/bin/sphinx-build
SPHINXBUILD = ../.venv/bin/sphinx-build
PAPER =
BUILDDIR = _build

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 76 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 33 KiB

File diff suppressed because one or more lines are too long

BIN
docs/_static/screenshot-fetch.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -3,7 +3,7 @@
Actions
=======
Glances can trigger actions on events.
Glances can trigger actions on events for warning and critical thresholds.
By ``action``, we mean all shell command line. For example, if you want
to execute the ``foo.py`` script if the last 5 minutes load are critical
@ -18,6 +18,13 @@ then add the ``_action`` line to the Glances configuration file:
All the stats are available in the command line through the use of the
`Mustache`_ syntax. `Chevron`_ is required to render the mustache's template syntax.
Additionaly to the stats of the current plugin, the following variables are
also available:
- ``{{time}}``: current time in ISO format
- ``{{critical}}``: critical threshold value
- ``{{warning}}``: warning threshold value
- ``{{careful}}``: careful threshold value
Another example would be to create a log file
containing used vs total disk space if a space trigger warning is
reached:
@ -26,7 +33,7 @@ reached:
[fs]
warning=70
warning_action=echo {{mnt_point}} {{used}}/{{size}} > /tmp/fs.alert
warning_action=echo "{{time}} {{mnt_point}} {{used}}/{{size}}" > /tmp/fs.alert
A last example would be to create a log file containing the total user disk
space usage for a device and notify by email each time a space trigger
@ -36,13 +43,11 @@ critical is reached:
[fs]
critical=90
critical_action_repeat=echo {{device_name}} {{percent}} > /tmp/fs.alert && python /etc/glances/actions.d/fs-critical.py
critical_action_repeat=echo "{{time}} {{device_name}} {{percent}}" > /tmp/fs.alert && python /etc/glances/actions.d/fs-critical.py
.. note::
Use && as separator for multiple commands
Within ``/etc/glances/actions.d/fs-critical.py``:
.. code-block:: python
@ -63,7 +68,7 @@ Within ``/etc/glances/actions.d/fs-critical.py``:
.. note::
You can use all the stats for the current plugin. See
https://github.com/nicolargo/glances/wiki/The-Glances-RESTFULL-JSON-API
https://github.com/nicolargo/glances/wiki/The-Glances-RESTFUL-JSON-API
for the stats list.
It is also possible to repeat action until the end of the alert.

View File

@ -61,9 +61,11 @@ For example:
enable=false
refresh=30
one_line=false
command=sysctl net.netfilter.nf_conntrack_count;sysctl net.netfilter.nf_conntrack_max
command=sysctl net.netfilter.nf_conntrack_count && sysctl net.netfilter.nf_conntrack_max
For security reason, pipe is not directly allowed in a AMP command but you create a sheel
Note: for multiple command, please use the '&&'' separator.
For security reason, pipe is not directly allowed in a AMP command but you create a shell
script with your command:
.. code-block:: ini

View File

@ -3,7 +3,7 @@
CLOUD
=====
This plugin diplays information about the cloud provider if your host is running on OpenStack.
This plugin displays information about the cloud provider if your host is running on OpenStack.
The plugin use the standard OpenStack `metadata`_ service to retrieve the information.

View File

@ -31,6 +31,9 @@ under the ``[containers]`` section:
#show=showthisone,andthose.*
# Define the maximum containers size name (default is 20 chars)
max_name_size=20
# List of stats to disable (not display)
# Following stats can be disabled: name,status,uptime,cpu,mem,diskio,networkio,ports,command
disable_stats=command
# Global containers' thresholds for CPU and MEM (in %)
cpu_careful=50
cpu_warning=70

View File

@ -53,7 +53,7 @@ To switch to per-CPU stats, just hit the ``1`` key:
.. image:: ../_static/per-cpu.png
In this case, Glances will show on line per logical CPU on the system.
If you have multiple core, it is possible to define the maximun number
If you have multiple core, it is possible to define the maximum number
of CPU to display. The top 'max_cpu_display' will be display and an
extra line with the mean of all others CPU will be added.

View File

@ -5,21 +5,16 @@ Disk I/O
.. image:: ../_static/diskio.png
Glances displays the disk I/O throughput. The unit is adapted
dynamically.
You can display:
Glances displays the disk I/O throughput, count and mean latency:
- bytes per second (default behavior / Bytes/s, KBytes/s, MBytes/s, etc)
- requests per second (using --diskio-iops option or *B* hotkey)
- mean latency (using --diskio-latency option or *L* hotkey)
There is no alert on this information.
It's possible to define:
It's also possible to define:
- a list of disk to show (white list)
- a list of disks to hide
- aliases for disk name
- aliases for disk name (use \ to espace special characters)
under the ``[diskio]`` section in the configuration file.
@ -42,4 +37,38 @@ Filtering is based on regular expression. Please be sure that your regular
expression works as expected. You can use an online tool like `regex101`_ in
order to test your regular expression.
It is also possible to define thesholds for latency and bytes read and write per second:
.. code-block:: ini
[diskio]
# Alias for sda1 and sdb1
#alias=sda1:SystemDisk,sdb1:DataDisk
# Default latency thresholds (in ms) (rx = read / tx = write)
rx_latency_careful=10
rx_latency_warning=20
rx_latency_critical=50
tx_latency_careful=10
tx_latency_warning=20
tx_latency_critical=50
# Set thresholds (in bytes per second) for a given disk name (rx = read / tx = write)
dm-0_rx_careful=4000000000
dm-0_rx_warning=5000000000
dm-0_rx_critical=6000000000
dm-0_rx_log=True
dm-0_tx_careful=700000000
dm-0_tx_warning=900000000
dm-0_tx_critical=1000000000
dm-0_tx_log=True
You also can automatically hide disk with no read or write using the
``hide_zero`` configuration key. The optional ``hide_threshold_bytes`` option
can also be used to set a threshold higher than zero.
.. code-block:: ini
[diskio]
hide_zero=True
hide_threshold_bytes=0
.. _regex101: https://regex101.com/

View File

@ -35,6 +35,11 @@ system:
[fs]
allow=shm
With the above configuration key, it is also possible to monitor NFS
mount points (allow=nfs). Be aware that this can slow down the
performance of the plugin if the NFS server is not reachable. In this
case, the plugin will wait for a 2 seconds timeout.
Also, you can hide mount points using regular expressions.
To hide all mount points starting with /boot and /snap:

View File

@ -57,7 +57,7 @@ Example:
**NOTE:** Setting low values for `public_refresh_interval` will result in frequent
HTTP requests to the onlive service defined in public_api. Recommended range: 120-600 seconds.
Glances uses online services in order to get the IP addresses and the additional informations.
Glances uses online services in order to get the IP addresses and the additional information.
Your IP address could be blocked if too many requests are done.

View File

@ -41,6 +41,7 @@ Legend:
hddtemp
ps
containers
vms
amps
events
actions

View File

@ -39,7 +39,7 @@ Trend Status
======== ==============================================================
``-`` Mean 15 lasts values equal mean 15 previous values
```` Mean 15 lasts values is lower mean 15 previous values
```` Mean 15 lasts values is higher mean 15 previous valuess
```` Mean 15 lasts values is higher mean 15 previous values
======== ==============================================================
Legend:

View File

@ -27,7 +27,7 @@ Stats description:
is in RAM.
- **inactive**: (UNIX): memory that is marked as not used.
- **buffers**: (Linux, BSD): cache for things like file system metadata.
- **cached**: (Linux, BSD): cache for various things.
- **cached**: (Linux, BSD): cache for various things (including ZFS cache).
Additional stats available in through the API:
@ -41,6 +41,10 @@ Additional stats available in through the API:
- **shared**: (BSD): memory that may be simultaneously accessed by multiple
processes.
It is possible to display the available memory instead of the used memory
by setting the ``available`` option to ``True`` in the configuration file
under the ``[mem]`` section.
A character is also displayed just after the MEM header and shows the
trend value:
@ -49,7 +53,7 @@ Trend Status
======== ==============================================================
``-`` Mean 15 lasts values equal mean 15 previous values
```` Mean 15 lasts values is lower mean 15 previous values
```` Mean 15 lasts values is higher mean 15 previous valuess
```` Mean 15 lasts values is higher mean 15 previous values
======== ==============================================================
Alerts are only set for used memory and used swap.

View File

@ -17,8 +17,10 @@ In this case thresholds values are define in bps.
Additionally, you can define:
- a list of network interfaces to hide
- automatically hide interfaces not up
- automatically hide interfaces without IP address
- per-interface limit values
- aliases for interface name
- aliases for interface name (use \ to espace special characters)
The configuration should be done in the ``[network]`` section of the
Glances configuration file.
@ -41,8 +43,14 @@ virtual docker interface (docker0, docker1, ...):
hide=docker.*,lo
# Define the list of network interfaces to show (comma-separated regexp)
#show=eth0,eth1
# Automatically hide interface not up (default is False)
hide_no_up=True
# Automatically hide interface with no IP address (default is False)
hide_no_ip=True
# Set hide_zero to True to automatically hide interface with no traffic
hide_zero=False
# WLAN 0 alias
wlan0_alias=Wireless IF
alias=wlan0:Wireless IF
# It is possible to overwrite the bitrate thresholds per interface
# WLAN 0 Default limits (in bits per second aka bps) for interface bitrate
wlan0_rx_careful=4000000
@ -58,4 +66,14 @@ Filtering is based on regular expression. Please be sure that your regular
expression works as expected. You can use an online tool like `regex101`_ in
order to test your regular expression.
.. _regex101: https://regex101.com/
You also can automatically hide interface with no traffic using the
``hide_zero`` configuration key. The optional ``hide_threshold_bytes`` option
can also be used to set a threshold higher than zero.
.. code-block:: ini
[network]
hide_zero=True
hide_threshold_bytes=0
.. _regex101: https://regex101.com/

View File

@ -102,7 +102,8 @@ Columns display
``CPU%`` % of CPU used by the process
If Irix/Solaris mode is off ('0' key), the value
is divided by logical core number
is divided by logical core number (the column
name became CPUi)
``MEM%`` % of MEM used by the process (RES divided by
the total RAM you have)
``VIRT`` Virtual Memory Size
@ -123,6 +124,7 @@ Columns display
The non-swapped physical memory a process is
using (what's currently in the physical memory).
``PID`` Process ID (column is replaced by NPROCS in accumulated mode)
``NPROCS`` Number of process + childs (only in accumulated mode)
``USER`` User ID
``THR`` Threads number of the process
``TIME+`` Cumulative CPU time used by the process
@ -147,12 +149,24 @@ Columns display
pressing on the ``'/'`` key
========================= ==============================================
Disable display of virtual memory
---------------------------------
It's possible to disable the display of the VIRT column (virtual memory) by adding the
``disable_virtual_memory=True`` option in the ``[processlist]`` section of the configuration
file (glances.conf):
.. code-block:: ini
[processlist]
disable_virtual_memory=True
Process filtering
-----------------
It's possible to filter the processes list using the ``ENTER`` key.
Filter syntax is the following (examples):
Glances filter syntax is the following (examples):
- ``python``: Filter processes name or command line starting with
*python* (regexp)
@ -161,6 +175,25 @@ Filter syntax is the following (examples):
- ``username:nicolargo``: Processes of nicolargo user (key:regexp)
- ``cmdline:\/usr\/bin.*``: Processes starting by */usr/bin*
Process focus
-------------
It's also possible to select a processes list to focus on.
A list of Glances filters (see upper) can be define from the command line:
.. code-block:: bash
glances --process-focus .*python.*,.*firefox.*
or the glances.conf file:
.. code-block:: ini
[processlist]
focus=.*python.*,.*firefox.*
Extended info
-------------

View File

@ -8,7 +8,14 @@ RAID
*Dependency: this plugin uses the optional pymdstat Python lib*
This plugin is disable by default, please use the --enable-plugin raid option
to enable it.
to enable it or enable it in the glances.conf file:
.. code-block:: ini
[raid]
# Documentation: https://glances.readthedocs.io/en/latest/aoa/raid.html
# This plugin is disabled by default
disable=False
In the terminal interface, click on ``R`` to enable/disable it.

View File

@ -13,30 +13,45 @@ Glances can display the sensors information using ``psutil``,
- hard disk temperature
- battery capacity
There is no alert on this information.
Limit values and sensors alias names can be defined in the configuration
file under the ``[sensors]`` section.
Limit can be defined for a specific sensor, a type of sensor or defineby the system
thresholds (default behavor).
.. code-block:: ini
[sensors]
# Sensors core thresholds (in Celsius...)
# By default values are grabbed from the system
# Overwrite thresholds for a specific sensor
temperature_core_Ambient_careful=45
temperature_core_Ambient_warning=65
temperature_core_Ambient_critical=80
temperature_core_Ambient_log=False
# Overwrite thresholds for a specific type of sensor
#temperature_core_careful=45
#temperature_core_warning=65
#temperature_core_critical=80
#alias=temp1:Motherboard 0,core 0:CPU Core 0
.. note 1::
Limit values and sensors alias names can be defined in the
configuration file under the ``[sensors]`` section.
.. note 2::
The support for multiple batteries is only available if
you have the batinfo Python lib installed on your system
because for the moment PSUtil only support one battery.
.. note 3::
.. note 2::
If a sensors has temperature and fan speed with the same name unit,
it is possible to alias it using:
unitname_temperature_core_alias=Alias for temp
unitname_fan_speed_alias=Alias for fan speed
alias=unitname_temperature_core_alias:Alias for temp,unitname_fan_speed_alias:Alias for fan speed
.. note 4::
.. note 3::
If a sensors has multiple identical features names (see #2280), then
Glances will add a suffix to the feature name.
For example, if you have one sensor with two Composite features, the
second one will be named Composite_1.
.. note 5::
.. note 4::
The plugin could crash on some operating system (FreeBSD) with the
TCP or UDP blackhole option > 0 (see issue #2106). In this case, you
should disable the sensors (--disable-plugin sensors or from the

View File

@ -22,3 +22,33 @@ How to read the information:
.. warning::
This plugin needs administrator rights. Please run Glances as root/admin.
Also, you can hide driver using regular expressions.
To hide device you should use the hide option:
.. code-block:: ini
[smart]
hide=.*Hide_this_device.*
It is also possible to configure a white list of devices to display.
Example to show only the specified drive:
.. code-block:: ini
[smart]
show=.*Show_this_device.*
Filtering is based on regular expression. Please be sure that your regular
expression works as expected. You can use an online tool like `regex101`_ in
order to test your regular expression.
.. _regex101: https://regex101.com/
You can also hide attributes, for example Self-tests, Errors, etc. Use a comma separated list.
.. code-block:: ini
[smart]
hide_attributes=attribute_name1,attribute_name2

36
docs/aoa/vms.rst Normal file
View File

@ -0,0 +1,36 @@
.. _vms:
VMs
===
Glances ``vms`` plugin is designed to display stats about VMs ran on the host.
It's actually support two engines: `Multipass` and `Virsh`.
No Python dependency is needed but Multipass and Virsh binary should be available:
- multipass should be executable from /snap/bin/multipass
- virsh should be executable from /usr/bin/virsh
Note: CPU information is not availble for Multipass VM. Load is not available for Virsh VM.
Configuration file options:
.. code-block:: ini
[vms]
disable=True
# Define the maximum VMs size name (default is 20 chars)
max_name_size=20
# By default, Glances only display running VMs with states:
# 'Running', 'Paused', 'Starting' or 'Restarting'
# Set the following key to True to display all VMs regarding their states
all=False
You can use all the variables ({{foo}}) available in the containers plugin.
Filtering (for hide or show) is based on regular expression. Please be sure that your regular
expression works as expected. You can use an online tool like `regex101`_ in
order to test your regular expression.
.. _Multipass: https://canonical.com/multipass
.. _Virsh: https://www.libvirt.org/manpages/virsh.html

1
docs/api/openapi.json Normal file

File diff suppressed because one or more lines are too long

1570
docs/api/python.rst Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,5 @@
#!/bin/sh
make clean
make html
LC_ALL=C make man

View File

@ -18,6 +18,10 @@ Command-Line Options
enable debug mode
.. option:: --print-completion
generate shell tab completion scripts for Glances CLI
.. option:: -C CONF_FILE, --config CONF_FILE
path to the configuration file
@ -120,7 +124,8 @@ Command-Line Options
.. option:: --browser
start the client browser (list of servers)
start TUI Central Glances Browser
use --browser -w to start WebUI Central Glances Browser
.. option:: --disable-autodiscover
@ -347,7 +352,7 @@ The following commands (key pressed) are supported while in Glances:
Show/hide RAID plugin
``s``
Show/hide sensors stats
Show/hide sensors plugin
``S``
Enable/disable spark lines
@ -364,6 +369,9 @@ The following commands (key pressed) are supported while in Glances:
``U``
View cumulative network I/O
``V``
Show/hide VMS plugin
``w``
Delete finished warning log messages
@ -408,12 +416,18 @@ The following commands (key pressed) are supported while in Glances:
``F5`` or ``CTRL-R``
Refresh user interface
``LEFT``
``SHIFT-LEFT``
Navigation left through the process sort
``RIGHT``
``SHIFT-RIGHT``
Navigation right through the process sort
``LEFT``
Navigation left through the process name
``RIGHT``
Navigation right through the process name
``UP``
Up in the processes list

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# Glances documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 1 10:53:59 2016.
@ -12,8 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
import sys
from datetime import datetime
# If extensions (or modules to document with autodoc) are in another directory,
@ -27,7 +26,6 @@ sys.path.insert(0, os.path.abspath('..'))
# WARNING: Do not move this import before the sys.path.insert() call.
from glances import __version__
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
@ -60,7 +58,7 @@ try:
year = datetime.utcfromtimestamp(int(os.environ['SOURCE_DATE_EPOCH'])).year
except (KeyError, ValueError):
year = datetime.now().year
copyright = '%d, %s' % (year, author)
copyright = f'{year}, {author}'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@ -125,8 +123,7 @@ html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
}
html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
@ -166,14 +163,7 @@ html_static_path = ['_static']
# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'links.html',
'searchbox.html'
]
}
html_sidebars = {'**': ['about.html', 'navigation.html', 'links.html', 'searchbox.html']}
# Additional templates that should be rendered to pages, maps page names to
# template names.
@ -227,13 +217,10 @@ htmlhelp_basename = 'Glancesdoc'
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
# Latex figure (float) alignment
# 'figure_align': 'htbp',
}
@ -242,8 +229,7 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Glances.tex', 'Glances Documentation',
'Nicolas Hennion', 'manual'),
(master_doc, 'Glances.tex', 'Glances Documentation', 'Nicolas Hennion', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@ -271,10 +257,7 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('glances', 'glances', 'An eye on your system',
'', 1)
]
man_pages = [('glances', 'glances', 'An eye on your system', '', 1)]
# If true, show URL addresses after external links.
# man_show_urls = False
@ -286,9 +269,15 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Glances', 'Glances Documentation',
author, 'Glances', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
'Glances',
'Glances Documentation',
author,
'Glances',
'One line description of project.',
'Miscellaneous',
),
]
# Documents to append as an appendix to all manuals.

View File

@ -17,10 +17,11 @@ Location
You can place your ``glances.conf`` file in the following locations:
==================== =============================================================
``Linux``, ``SunOS`` ~/.config/glances/, /etc/glances/, /usr/share/docs/glances/
``*BSD`` ~/.config/glances/, /usr/local/etc/glances/, /usr/share/docs/glances/
``macOS`` ~/.config/glances/, ~/Library/Application Support/glances/, /usr/local/etc/glances/, /usr/share/docs/glances/
``Linux``, ``SunOS`` ~/.config/glances/, /etc/glances/, /usr/share/doc/glances/
``*BSD`` ~/.config/glances/, /usr/local/etc/glances/, /usr/share/doc/glances/
``macOS`` ~/.config/glances/, ~/Library/Application Support/glances/, /usr/local/etc/glances/, /usr/share/doc/glances/
``Windows`` %APPDATA%\\glances\\glances.conf
``All`` + <venv_root_folder>/share/doc/glances/
==================== =============================================================
- On Windows XP, ``%APPDATA%`` is: ``C:\Documents and Settings\<USERNAME>\Application Data``.
@ -44,10 +45,10 @@ A first section (called global) is available:
# It is also possible to overwrite it in each plugin section
refresh=2
# Should Glances check if a newer version is available on PyPI ?
check_update=false
check_update=true
# History size (maximum number of values)
# Default is 28800: 1 day with 1 point every 3 seconds
history_size=28800
# 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"
# Define external directory for loading additional plugins
@ -59,17 +60,45 @@ than a second one concerning the user interface:
.. code-block:: ini
[outputs]
# Options for all UIs
#--------------------
# Separator in the Curses and WebUI interface (between top and others plugins)
separator=True
# Set the the Curses and WebUI interface left menu plugin list (comma-separated)
#left_menu=network,wifi,connections,ports,diskio,fs,irq,folders,raid,smart,sensors,now
# Limit the number of processes to display (for the WebUI)
# Limit the number of processes to display (in the WebUI)
max_processes_display=25
# Set the URL prefix (for the WebUI and the API)
# Options for WebUI
#------------------
# Set URL prefix for the WebUI and the API
# Example: url_prefix=/glances/ => http://localhost/glances/
# The final / is mandatory
# Note: The final / is mandatory
# Default is no prefix (/)
#url_prefix=/glances/
# Set root path for WebUI statics files
# Why ? On Debian system, WebUI statics files are not provided.
# You can download it in a specific folder
# thanks to https://github.com/nicolargo/glances/issues/2021
# then configure this folder with the webui_root_path key
# Default is folder where glances_restful_api.py is hosted
#webui_root_path=
# CORS options
# Comma separated list of origins that should be permitted to make cross-origin requests.
# Default is *
#cors_origins=*
# Indicate that cookies should be supported for cross-origin requests.
# Default is True
#cors_credentials=True
# Comma separated list of HTTP methods that should be allowed for cross-origin requests.
# Default is *
#cors_methods=*
# Comma separated list of HTTP request headers that should be supported for cross-origin requests.
# Default is *
#cors_headers=*
# Define SSL files (keyfile_password is optional)
#ssl_keyfile=./glances.local+3-key.pem
#ssl_keyfile_password=kfp
#ssl_certfile=./glances.local+3.pem
Each plugin, export module, and application monitoring process (AMP) can
have a section. Below is an example for the CPU plugin:

View File

@ -79,7 +79,7 @@ Alternatively, you can specify something along the same lines with docker run op
.. code-block:: console
docker run -v `pwd`/glances.conf:/glances/conf/glances.conf -v /var/run/docker.sock:/var/run/docker.sock:ro -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro --pid host -it docker.io/nicolargo/glances
docker run -v `pwd`/glances.conf:/etc/glances/glances.conf -v /var/run/docker.sock:/var/run/docker.sock:ro -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro --pid host -it docker.io/nicolargo/glances
Where \`pwd\`/glances.conf is a local directory containing your glances.conf file.
@ -187,7 +187,7 @@ and make it visible to your container by adding it to ``docker-compose.yml`` as
image: nicolargo/glances:latest
restart: always
environment:
- GLANCES_OPT="-w --password"
- "GLANCES_OPT=-w --password"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
# Uncomment the below line if you want glances to display host OS detail instead of container's

View File

@ -3,8 +3,51 @@
F.A.Q
=====
*Any encoding issue ?*
Any encoding issue ?
--------------------
Try to run Glances with the following command line:
LANG=en_US.UTF-8 LC_ALL= glances
Container memory stats not displayed ?
--------------------------------------
On ARM64, Docker needs to be configured to allow access to the memory stats.
Edit the /boot/firmware/cmdline.txt and add the following configuration key:
cgroup_enable=memory
Netifaces issue ?
-----------------
Previously, Glances uses Netifaces to get network interfaces information.
Now, Glances uses Netifaces2.
Please uninstall Netifaces and install Netifaces2 instead.
Extra note: Glances 4.5 or higher do not use Netifaces/Netifaces2 anymore.
On Debian/Ubuntu Operating Systems, Webserver display a blank screen ?
----------------------------------------------------------------------
For some reason, the Glances Debian/Ubuntu packages do not include the Web UI static files.
Please read: https://github.com/nicolargo/glances/issues/2021 for workaround and more information.
Glances said that my computer has no free memory, is it normal ?
----------------------------------------------------------------
On Linux, Glances shows by default the free memory.
Free memory can be low, it's a "normal" behavior because Linux uses free memory for disk caching
to improve performance. More information can be found here: https://linuxatemyram.com/.
If you want to display the "available" memory instead of the "free" memory, you can uses the
the following configuration key in the Glances configuration file:
[mem]
# Display available memory instead of used memory
available=True

46
docs/fetch.rst Normal file
View File

@ -0,0 +1,46 @@
.. _fetch:
Fetch
=====
The fetch mode is used to get and share a quick look of a machine using the
``fetch`` option. In this mode, current stats are displayed on the console in
a fancy way.
.. code-block:: console
$ glances --fetch
Results look like this:
.. image:: _static/screenshot-fetch.png
It is also possible to use a custom template with the ``--fetch-template </path/to/template.jinja>`` option.
Some examples are provided in the ``conf/fetch-templates/`` directory. Please feel free to
customize them or create your own template (contribution via PR are welcome).
The format of the template is based on the Jinja2 templating engine and can use all the stats
available in Glances through the ``gl`` variable (an instance of the :ref:`Glances Python API<api>`).
For example, the default template is define as:
.. code-block:: jinja
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✨ {{ gl.system['hostname'] }}{{ ' - ' + gl.ip['address'] if gl.ip['address'] else '' }}
⚙️ {{ gl.system['hr_name'] }} | Uptime: {{ gl.uptime }}
💡 LOAD {{ '%0.2f'| format(gl.load['min1']) }} {{ '%0.2f'| format(gl.load['min5']) }} {{ '%0.2f'| format(gl.load['min15']) }}
⚡ CPU {{ gl.bar(gl.cpu['total']) }} {{ gl.cpu['total'] }}% of {{ gl.core['log'] }} cores
🧠 MEM {{ gl.bar(gl.mem['percent']) }} {{ gl.mem['percent'] }}% ({{ gl.auto_unit(gl.mem['used']) }} {{ gl.auto_unit(gl.mem['total']) }})
{% for fs in gl.fs.keys() %}💾 {% if loop.index == 1 %}DISK{% else %} {% endif %} {{ gl.bar(gl.fs[fs]['percent']) }} {{ gl.fs[fs]['percent'] }}% ({{ gl.auto_unit(gl.fs[fs]['used']) }} {{ gl.auto_unit(gl.fs[fs]['size']) }}) for {{ fs }}
{% endfor %}{% for net in gl.network.keys() %}📡 {% if loop.index == 1 %}NET{% else %} {% endif %} ↓ {{ gl.auto_unit(gl.network[net]['bytes_recv_rate_per_sec']) }}b/s ↑ {{ gl.auto_unit(gl.network[net]['bytes_sent_rate_per_sec']) }}b/s for {{ net }}
{% endfor %}
🔥 TOP PROCESS by CPU
{% for process in gl.top_process() %}{{ loop.index }}️⃣ {{ process['name'][:20] }}{{ ' ' * (20 - process['name'][:20] | length) }} ⚡ {{ process['cpu_percent'] }}% CPU{{ ' ' * (8 - (gl.auto_unit(process['cpu_percent']) | length)) }} 🧠 {{ gl.auto_unit(process['memory_info']['rss']) }}B MEM
{% endfor %}
🔥 TOP PROCESS by MEM
{% for process in gl.top_process(sorted_by='memory_percent', sorted_by_secondary='cpu_percent') %}{{ loop.index }}️⃣ {{ process['name'][:20] }}{{ ' ' * (20 - process['name'][:20] | length) }} 🧠 {{ gl.auto_unit(process['memory_info']['rss']) }}B MEM{{ ' ' * (7 - (gl.auto_unit(process['memory_info']['rss']) | length)) }} ⚡ {{ process['cpu_percent'] }}% CPU
{% endfor %}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

View File

@ -34,16 +34,17 @@ CONFIGURATION
EXAMPLES
--------
Monitor local machine (standalone mode):
Monitor local machine, also called standalone mode,
with the Text-based user interface (TUI):
$ glances
To monitor the local machine with the web interface (Web UI),
To monitor the local machine with the Web user interface (WebUI),
, run the following command line:
$ glances -w
then, open a web browser to the provided URL.
then, open a Web Browser to the provided URL.
Monitor local machine and export stats to a CSV file:
@ -71,10 +72,16 @@ Connect to a Glances server and export stats to a StatsD server:
$ glances -c <ip_server> --export statsd
Start the client browser (browser mode):
Start the TUI Central Glances Browser:
$ glances --browser
Start the WebUI Central Glances Browser (new in Glances 4.3 or higher):
$ glances --browser -w
If you do not want to see the local Glances Web Server in the browser list please use --disable-autodiscover option.
AUTHOR
------

110
docs/gw/duckdb.rst Normal file
View File

@ -0,0 +1,110 @@
.. _duckdb:
DuckDB
===========
DuckDB is an in-process SQL OLAP database management system.
You can export statistics to a ``DuckDB`` server.
The connection should be defined in the Glances configuration file as
following:
.. code-block:: ini
[duckdb]
# database defines where data are stored, can be one of:
# /path/to/glances.db (see https://duckdb.org/docs/stable/clients/python/dbapi#file-based-connection)
# :memory:glances (see https://duckdb.org/docs/stable/clients/python/dbapi#in-memory-connection)
# Or anyone else supported by the API (see https://duckdb.org/docs/stable/clients/python/dbapi)
database=/tmp/glances.db
and run Glances with:
.. code-block:: console
$ glances --export duckdb
Data model
-----------
The data model is composed of one table per Glances plugin.
Example:
.. code-block:: python
>>> import duckdb
>>> db = duckdb.connect(database='/tmp/glances.db', read_only=True)
>>> db.sql("SELECT * from cpu")
┌─────────────────────┬─────────────────┬────────┬────────┬────────┬───┬────────────────────┬─────────────────────┬──────────────────────┬──────────────────────┬──────────────────────┐
│ time │ hostname_id │ total │ user │ nice │ … │ cpu_iowait_warning │ cpu_iowait_critical │ cpu_ctx_switches_c… │ cpu_ctx_switches_w… │ cpu_ctx_switches_c… │
│ time with time zone │ varchar │ double │ double │ double │ │ double │ double │ double │ double │ double │
├─────────────────────┼─────────────────┼────────┼────────┼────────┼───┼────────────────────┼─────────────────────┼──────────────────────┼──────────────────────┼──────────────────────┤
│ 11:50:25+00 │ nicolargo-xps15 │ 8.0 │ 5.6 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:50:27+00 │ nicolargo-xps15 │ 4.3 │ 3.2 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:50:29+00 │ nicolargo-xps15 │ 4.3 │ 3.2 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:50:31+00 │ nicolargo-xps15 │ 14.9 │ 15.7 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:50:33+00 │ nicolargo-xps15 │ 14.9 │ 15.7 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:50:35+00 │ nicolargo-xps15 │ 8.2 │ 7.8 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:50:37+00 │ nicolargo-xps15 │ 8.2 │ 7.8 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:50:39+00 │ nicolargo-xps15 │ 12.7 │ 10.3 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:50:41+00 │ nicolargo-xps15 │ 12.7 │ 10.3 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:50:43+00 │ nicolargo-xps15 │ 12.2 │ 10.3 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ · │ · │ · │ · │ · │ · │ · │ · │ · │ · │ · │
│ · │ · │ · │ · │ · │ · │ · │ · │ · │ · │ · │
│ · │ · │ · │ · │ · │ · │ · │ · │ · │ · │ · │
│ 11:51:29+00 │ nicolargo-xps15 │ 10.1 │ 7.4 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:51:32+00 │ nicolargo-xps15 │ 10.1 │ 7.4 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:51:34+00 │ nicolargo-xps15 │ 6.6 │ 4.9 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:51:36+00 │ nicolargo-xps15 │ 6.6 │ 4.9 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:51:38+00 │ nicolargo-xps15 │ 9.9 │ 7.5 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:51:40+00 │ nicolargo-xps15 │ 9.9 │ 7.5 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:51:42+00 │ nicolargo-xps15 │ 4.0 │ 3.1 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:51:44+00 │ nicolargo-xps15 │ 4.0 │ 3.1 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:51:46+00 │ nicolargo-xps15 │ 11.1 │ 8.8 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
│ 11:51:48+00 │ nicolargo-xps15 │ 11.1 │ 8.8 │ 0.0 │ … │ 5.625 │ 6.25 │ 640000.0 │ 720000.0 │ 800000.0 │
├─────────────────────┴─────────────────┴────────┴────────┴────────┴───┴────────────────────┴─────────────────────┴──────────────────────┴──────────────────────┴──────────────────────┤
│ 41 rows (20 shown) 47 columns (10 shown) │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
>>> db.sql("SELECT * from cpu").fetchall()[0]
(datetime.time(11, 50, 25, tzinfo=datetime.timezone.utc), 'nicolargo-xps15', 8.0, 5.6, 0.0, 2.3, 91.9, 0.1, 0.0, 0.0, 0.0, 0, 0, 0, 0, 16, 2.4103684425354004, 90724823, 0, 63323797, 0, 30704572, 0, 0, 0, 1200.0, 65.0, 75.0, 85.0, True, 50.0, 70.0, 90.0, True, 50.0, 70.0, 90.0, True, 50.0, 70.0, 90.0, 5.0, 5.625, 6.25, 640000.0, 720000.0, 800000.0)
>>> db.sql("SELECT * from network")
┌─────────────────────┬─────────────────┬────────────────┬────────────┬────────────┬───┬─────────────────────┬────────────────┬────────────────────┬────────────────────┬───────────────────┐
│ time │ hostname_id │ key_id │ bytes_sent │ bytes_recv │ … │ network_tx_critical │ network_hide │ network_hide_no_up │ network_hide_no_ip │ network_hide_zero │
│ time with time zone │ varchar │ varchar │ int64 │ int64 │ │ double │ varchar │ boolean │ boolean │ boolean │
├─────────────────────┼─────────────────┼────────────────┼────────────┼────────────┼───┼─────────────────────┼────────────────┼────────────────────┼────────────────────┼───────────────────┤
│ 11:50:25+00 │ nicolargo-xps15 │ interface_name │ 407761 │ 32730 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:50:27+00 │ nicolargo-xps15 │ interface_name │ 2877 │ 4857 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:50:29+00 │ nicolargo-xps15 │ interface_name │ 44504 │ 32555 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:50:31+00 │ nicolargo-xps15 │ interface_name │ 1092285 │ 48600 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:50:33+00 │ nicolargo-xps15 │ interface_name │ 150119 │ 43805 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:50:35+00 │ nicolargo-xps15 │ interface_name │ 34424 │ 14825 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:50:37+00 │ nicolargo-xps15 │ interface_name │ 19382 │ 33614 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:50:39+00 │ nicolargo-xps15 │ interface_name │ 53060 │ 39780 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:50:41+00 │ nicolargo-xps15 │ interface_name │ 371914 │ 78626 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:50:43+00 │ nicolargo-xps15 │ interface_name │ 82356 │ 60612 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ · │ · │ · │ · │ · │ · │ · │ · │ · │ · │ · │
│ · │ · │ · │ · │ · │ · │ · │ · │ · │ · │ · │
│ · │ · │ · │ · │ · │ · │ · │ · │ · │ · │ · │
│ 11:51:29+00 │ nicolargo-xps15 │ interface_name │ 3766 │ 9977 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:51:32+00 │ nicolargo-xps15 │ interface_name │ 188036 │ 18668 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:51:34+00 │ nicolargo-xps15 │ interface_name │ 543 │ 2451 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:51:36+00 │ nicolargo-xps15 │ interface_name │ 8247 │ 7275 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:51:38+00 │ nicolargo-xps15 │ interface_name │ 7252 │ 986 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:51:40+00 │ nicolargo-xps15 │ interface_name │ 172 │ 132 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:51:42+00 │ nicolargo-xps15 │ interface_name │ 8080 │ 6640 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:51:44+00 │ nicolargo-xps15 │ interface_name │ 19660 │ 17830 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:51:46+00 │ nicolargo-xps15 │ interface_name │ 1007030 │ 84170 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
│ 11:51:48+00 │ nicolargo-xps15 │ interface_name │ 128947 │ 18087 │ … │ 90.0 │ [docker.*, lo] │ true │ true │ true │
├─────────────────────┴─────────────────┴────────────────┴────────────┴────────────┴───┴─────────────────────┴────────────────┴────────────────────┴────────────────────┴───────────────────┤
│ 41 rows (20 shown) 28 columns (10 shown) │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
.. _duckdb: https://duckdb.org/

View File

@ -3,8 +3,24 @@
Gateway To Other Services
=========================
Glances can exports stats to a CSV file. Also, it can act as a gateway
to providing stats to multiple services (see list below).
Glances can exports stats in files or to other services like databases, message queues, etc.
Each exporter has its own configuration options, which can be set in the Glances
configuration file (`glances.conf`).
A common options section is also available:
is the `exclude_fields` option, which allows you to specify
.. code-block:: ini
[export]
# Common section for all exporters
# Do not export following fields (comma separated list of regex)
exclude_fields=.*_critical,.*_careful,.*_warning,.*\.key$
This section describes the available exporters and how to configure them:
.. toctree::
:maxdepth: 2
@ -14,15 +30,18 @@ to providing stats to multiple services (see list below).
couchdb
elastic
graph
graphite
influxdb
json
kafka
mqtt
mongodb
nats
opentsdb
prometheus
rabbitmq
restful
riemann
statsd
timescaledb
zeromq

View File

@ -17,19 +17,19 @@ Glances InfluxDB data model:
+---------------+-----------------------+-----------------------+
| Measurement | Fields | Tags |
+===============+=======================+=======================+
| cpu | user | hostname |
| cpu | user | hostname |
| | system | |
| | iowait... | |
+---------------+-----------------------+-----------------------+
| network | read_bytes | hostname |
| | write_bytes | disk_name |
| | time_since_update... | |
|  | | |
| | | |
+---------------+-----------------------+-----------------------+
| diskio | rx | hostname |
| | tx | interface_name |
| | time_since_update... | |
|  | | |
| | | |
+---------------+-----------------------+-----------------------+
| docker | cpu_percent | hostname |
| | memory_usage... | name |
@ -78,7 +78,7 @@ configuration file (no limit on columns number).
Note: if you want to use SSL, please set 'protocol=https'.
InfluxDB v2 (from InfluxDB v1.8.x/Flux and InfluxDB v2.x)
InfluxDB v2 (from InfluxDB v1.8.x/Flux and InfluxDB <v3.x)
---------------------------------------------------------
Note: The InfluxDB v2 client (https://pypi.org/project/influxdb-client/)
@ -90,12 +90,14 @@ following:
.. code-block:: ini
[influxdb2]
# Configuration for the --export influxdb2 option
# https://influxdb.com/
host=localhost
port=8086
protocol=http
org=nicolargo
bucket=glances
token=EjFUTWe8U-MIseEAkaVIgVnej_TrnbdvEcRkaB1imstW7gapSqy6_6-8XD-yd51V0zUUpDy-kAdVD1purDLuxA==
token=PUT_YOUR_INFLUXDB2_TOKEN_HERE
# Set the interval between two exports (in seconds)
# If the interval is set to 0, the Glances refresh time is used (default behavor)
#interval=0
@ -107,7 +109,7 @@ following:
#prefix=foo
# Following tags will be added for all measurements
# You can also use dynamic values.
# Note: hostname is always added as a tag
# Note: hostname and name (for process) are always added as a tag
#tags=foo:bar,spam:eggs,domain:`domainname`
and run Glances with:
@ -118,6 +120,46 @@ and run Glances with:
Note: if you want to use SSL, please set 'protocol=https'.
InfluxDB v3 (for InfluxDB 3.x)
------------------------------
Note: The InfluxDB v3 client (https://pypi.org/project/influxdb3-python/)
is only available for Python 3.8 or higher.
The connection should be defined in the Glances configuration file as
following:
.. code-block:: ini
[influxdb3]
# Configuration for the --export influxdb3 option
# https://influxdb.com/
host=http://localhost:8181
org=nicolargo
database=glances
token=PUT_YOUR_INFLUXDB3_TOKEN_HERE
# Set the interval between two exports (in seconds)
# If the interval is set to 0, the Glances refresh time is used (default behavor)
#interval=0
# Prefix will be added for all measurement name
# Ex: prefix=foo
# => foo.cpu
# => foo.mem
# You can also use dynamic values
#prefix=foo
# Following tags will be added for all measurements
# You can also use dynamic values.
# Note: hostname and name (for process) are always added as a tag
#tags=foo:bar,spam:eggs,domain:`domainname`
and run Glances with:
.. code-block:: console
$ glances --export influxdb3
Note: if you want to use SSL, please set host with 'https' scheme instead of 'http'.
Grafana
-------

68
docs/gw/nats.rst Normal file
View File

@ -0,0 +1,68 @@
.. _nats:
NATS
====
NATS is a message broker.
You can export statistics to a ``NATS`` server.
The connection should be defined in the Glances configuration file as
following:
.. code-block:: ini
[nats]
host=nats://localhost:4222
prefix=glances
and run Glances with:
.. code-block:: console
$ glances --export nats
Data model
-----------
Glances stats are published as JSON messagesto the following subjects:
<prefix>.<plugin>
Example:
CPU stats are published to glances.cpu
So a simple Python client will subscribe to this subject with:
import asyncio
import nats
async def main():
nc = nats.NATS()
await nc.connect(servers=["nats://localhost:4222"])
future = asyncio.Future()
async def cb(msg):
nonlocal future
future.set_result(msg)
await nc.subscribe("glances.cpu", cb=cb)
# Wait for message to come in
print("Waiting (max 30 seconds) for a message on 'glances' subject...")
msg = await asyncio.wait_for(future, 30)
print(msg.subject, msg.data)
if __name__ == '__main__':
asyncio.run(main())
To subscribe to all Glannces stats use wildcard:
await nc.subscribe("glances.*", cb=cb)

48
docs/gw/timescaledb.rst Normal file
View File

@ -0,0 +1,48 @@
.. _timescale:
TimeScaleDB
===========
TimescaleDB is a time-series database built on top of PostgreSQL.
You can export statistics to a ``TimescaleDB`` server.
The connection should be defined in the Glances configuration file as
following:
.. code-block:: ini
[timescaledb]
host=localhost
port=5432
db=glances
user=postgres
password=password
and run Glances with:
.. code-block:: console
$ glances --export timescaledb
Data model
-----------
Each plugin will create an `hypertable`_ in the TimescaleDB database.
Tables are partitionned by time (using the ``time`` column).
Tables are segmented by hostname (in order to have multiple host stored in the Glances database).
For plugin with a key (example network where the key is the interface name), the key will
be added as a column in the table (named key_id) and added to the timescaledb.segmentby option.
Current limitations
-------------------
Sensors, Fs and DiskIO plugins are not supported by the TimescaleDB exporter.
In the cpu plugin, the user field is exported as user_cpu (user_percpu in the percpu plugin)
because user is a reserved keyword in PostgreSQL.
.. _hypertable: https://docs.tigerdata.com/use-timescale/latest/hypertables/

View File

@ -11,12 +11,11 @@ information depending on the terminal size.
It can also work in client/server mode. Remote monitoring can be
done via terminal, Web interface, or API (XMLRPC and RESTful).
Glances is written in Python and uses the `psutil`_ library to get
information from your system.
Stats can also be exported to :ref:`files or external databases<gw>`.
Stats can also be exported to external time/value databases.
.. _psutil: https://github.com/giampaolo/psutil
It is also possible to use it in your own Python scripts thanks to
the :ref:`Glances API<api>` or in any other application through
the :ref:`RESTful API<api_restful>`.
Table of Contents
=================
@ -30,7 +29,11 @@ Table of Contents
config
aoa/index
gw/index
api
api/python
api/restful
docker
faq
support
.. _psutil: https://github.com/giampaolo/psutil

View File

@ -34,5 +34,19 @@ To upgrade Glances and all its dependencies to the latest versions:
For additional installation methods, read the official `README`_ file.
Shell tab completion
====================
Glances 4.3.2 and higher includes shell tab autocompletion thanks to the --print-completion option.
For example, on a Linux operating system with Bash shell:
.. code-block:: console
$ glances --print-completion bash | sudo tee -a /etc/bash_completion.d/glances
$ source /etc/bash_completion.d/glances
Following shells are supported: bash, zsh and tcsh.
.. _psutil: https://github.com/giampaolo/psutil
.. _README: https://github.com/nicolargo/glances/blob/master/README.rst

View File

@ -1,3 +1,4 @@
'\" t
.\" Man page generated from reStructuredText.
.
.
@ -27,7 +28,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" "May 12, 2024" "4.0.0" "Glances"
.TH "GLANCES" "1" "Jan 03, 2026" "4.4.2_dev1" "Glances"
.SH NAME
glances \- An eye on your system
.SH SYNOPSIS
@ -63,6 +64,11 @@ enable debug mode
.UNINDENT
.INDENT 0.0
.TP
.B \-\-print\-completion
generate shell tab completion scripts for Glances CLI
.UNINDENT
.INDENT 0.0
.TP
.B \-C CONF_FILE, \-\-config CONF_FILE
path to the configuration file
.UNINDENT
@ -189,7 +195,8 @@ run Glances in server mode
.INDENT 0.0
.TP
.B \-\-browser
start the client browser (list of servers)
start TUI Central Glances Browser
use browser \-w to start WebUI Central Glances Browser
.UNINDENT
.INDENT 0.0
.TP
@ -451,7 +458,7 @@ Reset history
Show/hide RAID plugin
.TP
.B \fBs\fP
Show/hide sensors stats
Show/hide sensors plugin
.TP
.B \fBS\fP
Enable/disable spark lines
@ -468,6 +475,9 @@ Sort processes by USER
.B \fBU\fP
View cumulative network I/O
.TP
.B \fBV\fP
Show/hide VMS plugin
.TP
.B \fBw\fP
Delete finished warning log messages
.TP
@ -512,12 +522,18 @@ Switch between process command line or command name
.B \fBF5\fP or \fBCTRL\-R\fP
Refresh user interface
.TP
.B \fBLEFT\fP
.B \fBSHIFT\-LEFT\fP
Navigation left through the process sort
.TP
.B \fBRIGHT\fP
.B \fBSHIFT\-RIGHT\fP
Navigation right through the process sort
.TP
.B \fBLEFT\fP
Navigation left through the process name
.TP
.B \fBRIGHT\fP
Navigation right through the process name
.TP
.B \fBUP\fP
Up in the processes list
.TP
@ -558,25 +574,24 @@ A template is available in the \fB/usr{,/local}/share/doc/glances\fP
.sp
You can place your \fBglances.conf\fP file in the following locations:
.TS
center;
|l|l|.
_
box center;
l|l.
T{
\fBLinux\fP, \fBSunOS\fP
T} T{
~/.config/glances/, /etc/glances/, /usr/share/docs/glances/
~/.config/glances/, /etc/glances/, /usr/share/doc/glances/
T}
_
T{
\fB*BSD\fP
T} T{
~/.config/glances/, /usr/local/etc/glances/, /usr/share/docs/glances/
~/.config/glances/, /usr/local/etc/glances/, /usr/share/doc/glances/
T}
_
T{
\fBmacOS\fP
T} T{
~/.config/glances/, ~/Library/Application Support/glances/, /usr/local/etc/glances/, /usr/share/docs/glances/
~/.config/glances/, ~/Library/Application Support/glances/, /usr/local/etc/glances/, /usr/share/doc/glances/
T}
_
T{
@ -585,6 +600,14 @@ T} T{
%APPDATA%\eglances\eglances.conf
T}
_
T{
\fBAll\fP
T} T{
.INDENT 0.0
.IP \(bu 2
<venv_root_folder>/share/doc/glances/
.UNINDENT
T}
.TE
.INDENT 0.0
.IP \(bu 2
@ -603,25 +626,23 @@ A first section (called global) is available:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
[global]
# Refresh rate (default is a minimum of 2 seconds)
# Can be overwritten by the \-t <sec> option
# It is also possible to overwrite it in each plugin section
refresh=2
# Should Glances check if a newer version is available on PyPI ?
check_update=false
check_update=true
# History size (maximum number of values)
# Default is 28800: 1 day with 1 point every 3 seconds
history_size=28800
# 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=\(dq%Y\-%m\-%d %H:%M:%S %Z\(dq
# Define external directory for loading additional plugins
# The layout follows the glances standard for plugin definitions
#plugin_dir=/home/user/dev/plugins
.ft P
.fi
.EE
.UNINDENT
.UNINDENT
.sp
@ -629,22 +650,48 @@ than a second one concerning the user interface:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
[outputs]
# Options for all UIs
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
# Separator in the Curses and WebUI interface (between top and others plugins)
separator=True
# Set the the Curses and WebUI interface left menu plugin list (comma\-separated)
#left_menu=network,wifi,connections,ports,diskio,fs,irq,folders,raid,smart,sensors,now
# Limit the number of processes to display (for the WebUI)
# Limit the number of processes to display (in the WebUI)
max_processes_display=25
# Set the URL prefix (for the WebUI and the API)
# Options for WebUI
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
# Set URL prefix for the WebUI and the API
# Example: url_prefix=/glances/ => http://localhost/glances/
# The final / is mandatory
# Note: The final / is mandatory
# Default is no prefix (/)
#url_prefix=/glances/
.ft P
.fi
# Set root path for WebUI statics files
# Why ? On Debian system, WebUI statics files are not provided.
# You can download it in a specific folder
# thanks to https://github.com/nicolargo/glances/issues/2021
# then configure this folder with the webui_root_path key
# Default is folder where glances_restful_api.py is hosted
#webui_root_path=
# CORS options
# Comma separated list of origins that should be permitted to make cross\-origin requests.
# Default is *
#cors_origins=*
# Indicate that cookies should be supported for cross\-origin requests.
# Default is True
#cors_credentials=True
# Comma separated list of HTTP methods that should be allowed for cross\-origin requests.
# Default is *
#cors_methods=*
# Comma separated list of HTTP request headers that should be supported for cross\-origin requests.
# Default is *
#cors_headers=*
# Define SSL files (keyfile_password is optional)
#ssl_keyfile=./glances.local+3\-key.pem
#ssl_keyfile_password=kfp
#ssl_certfile=./glances.local+3.pem
.EE
.UNINDENT
.UNINDENT
.sp
@ -653,8 +700,7 @@ have a section. Below is an example for the CPU plugin:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
[cpu]
disable=False
refresh=3
@ -670,8 +716,7 @@ system_critical=90
steal_careful=50
steal_warning=70
steal_critical=90
.ft P
.fi
.EE
.UNINDENT
.UNINDENT
.sp
@ -679,8 +724,7 @@ an InfluxDB export module:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
[influxdb]
# Configuration for the \-\-export influxdb option
# https://influxdb.com/
@ -691,8 +735,7 @@ password=root
db=glances
prefix=localhost
#tags=foo:bar,spam:eggs
.ft P
.fi
.EE
.UNINDENT
.UNINDENT
.sp
@ -700,8 +743,7 @@ or a Nginx AMP:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
[amp_nginx]
# Nginx status page should be enabled (https://easyengine.io/tutorials/nginx/status\-page/)
enable=true
@ -709,8 +751,7 @@ regex=\e/usr\e/sbin\e/nginx
refresh=60
one_line=false
status_url=http://localhost/nginx_status
.ft P
.fi
.EE
.UNINDENT
.UNINDENT
.sp
@ -720,13 +761,11 @@ of an InfluxDB export to the current hostname, use:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
[influxdb]
\&...
prefix=\(gahostname\(ga
.ft P
.fi
.EE
.UNINDENT
.UNINDENT
.sp
@ -734,13 +773,11 @@ Or if you want to add the Operating System name as a tag:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
[influxdb]
\&...
tags=system:\(gauname \-a\(ga
.ft P
.fi
.EE
.UNINDENT
.UNINDENT
.SH LOGGING
@ -763,8 +800,7 @@ format):
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
{
\(dqversion\(dq: 1,
\(dqdisable_existing_loggers\(dq: \(dqFalse\(dq,
@ -823,8 +859,7 @@ format):
}
}
}
.ft P
.fi
.EE
.UNINDENT
.UNINDENT
.sp
@ -832,11 +867,9 @@ and start Glances using the following command line:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
.EX
LOG_CFG=<path>/glances.json glances
.ft P
.fi
.EE
.UNINDENT
.UNINDENT
.sp
@ -849,14 +882,15 @@ is hosted.
.UNINDENT
.SH EXAMPLES
.sp
Monitor local machine (standalone mode):
Monitor local machine, also called standalone mode,
with the Text\-based user interface (TUI):
.INDENT 0.0
.INDENT 3.5
$ glances
.UNINDENT
.UNINDENT
.sp
To monitor the local machine with the web interface (Web UI),
To monitor the local machine with the Web user interface (WebUI),
, run the following command line:
.INDENT 0.0
.INDENT 3.5
@ -864,7 +898,7 @@ $ glances \-w
.UNINDENT
.UNINDENT
.sp
then, open a web browser to the provided URL.
then, open a Web Browser to the provided URL.
.sp
Monitor local machine and export stats to a CSV file:
.INDENT 0.0
@ -910,16 +944,25 @@ $ glances \-c <ip_server> export statsd
.UNINDENT
.UNINDENT
.sp
Start the client browser (browser mode):
Start the TUI Central Glances Browser:
.INDENT 0.0
.INDENT 3.5
$ glances browser
.UNINDENT
.UNINDENT
.sp
Start the WebUI Central Glances Browser (new in Glances 4.3 or higher):
.INDENT 0.0
.INDENT 3.5
$ glances browser \-w
.UNINDENT
.UNINDENT
.sp
If you do not want to see the local Glances Web Server in the browser list please use disable\-autodiscover option.
.SH AUTHOR
.sp
Nicolas Hennion aka Nicolargo <\X'tty: link mailto:contact@nicolargo.com'\fI\%contact@nicolargo.com\fP\X'tty: link'>
.SH COPYRIGHT
2024, Nicolas Hennion
2026, Nicolas Hennion
.\" Generated by docutils manpage writer.
.

View File

@ -4,11 +4,12 @@ Quickstart
==========
This page gives a good introduction to how to get started with Glances.
Glances offers three modes:
Glances offers multiple modes:
- Standalone
- Client/Server
- Web server
- Fetch
Standalone Mode
---------------
@ -88,8 +89,8 @@ available network interfaces) and TCP port is ``61209``.
In client/server mode, limits are set by the server side.
Central client
^^^^^^^^^^^^^^
Central Glances Browser
^^^^^^^^^^^^^^^^^^^^^^^
.. image:: _static/browser.png
@ -102,6 +103,10 @@ Example:
.. code-block:: ini
[serverlist]
# Define columns (comma separated list of <plugin>:<field>:(<key>)) to grab/display
# Default is: system:hr_name,load:min5,cpu:total,mem:percent
# You can also add stats with key, like sensors:value:Ambient (key is case sensitive)
columns=system:hr_name,load:min5,cpu:total,mem:percent,memswap:percent
# Define the static servers list
server_1_name=xps
server_1_alias=xps
@ -112,22 +117,30 @@ Example:
Glances can also detect and display all Glances servers available on
your network via the ``zeroconf`` protocol (not available on Windows):
To start the central client, use the following option:
To start the TUI Central Glances Browser, use the following option:
.. code-block:: console
client$ glances --browser
.. note::
Use ``--disable-autodiscover`` to disable the auto-discovery mode.
When the list is displayed, you can navigate through the Glances servers with
up/down keys. It is also possible to sort the server using:
- '1' is normal (do not sort)
- '2' is using sorting with ascending order (ONLINE > SNMP > PROTECTED > OFFLINE > UNKNOWN)
- '3' is using sorting with descending order (UNKNOWN > OFFLINE > PROTECTED > SNMP > ONLINE)
To start the WebUI Central Glances Browser (new in Glances 4.3 or higher), use the following option:
.. code-block:: console
client$ glances --browser -w
Open the URL (/browser) and click on the server to display stats.
.. note::
Use ``--disable-autodiscover`` to disable the auto-discovery mode.
SNMP
^^^^
@ -184,7 +197,7 @@ Here's a screenshot from Chrome on Android:
.. image:: _static/screenshot-web2.png
How do you protect your server (or Web server) with a login/password ?
------------------------------------------------------------------
----------------------------------------------------------------------
You can set a password to access the server using the ``--password``.
By default, the login is ``glances`` but you can change it with
@ -210,3 +223,22 @@ file:
# Additionally (and optionally) a default password could be defined
localhost=mylocalhostpassword
default=mydefaultpassword
Fetch mode
----------
It is also possible to get and share a quick look of a machine using the
``fetch`` mode. In this mode, current stats are display on the console in
a fancy way.
.. code-block:: console
$ glances --fetch
Results look like this:
.. image:: _static/screenshot-fetch.png
It is also possible to use a custom template with the ``--fetch-template </path/to/template.jinja>`` option.
Have a look to the :ref:`fetch documentation page<fetch>` to learn how to create your own template.

33
generate_openapi.py Normal file
View File

@ -0,0 +1,33 @@
import json
from unittest.mock import patch
from fastapi.openapi.utils import get_openapi
from glances.main import GlancesMain
# sys.path.append('./glances/outputs')
from glances.outputs.glances_restful_api import GlancesRestfulApi
# Init Glances core
testargs = ["glances", "-C", "./conf/glances.conf"]
with patch('sys.argv', testargs):
core = GlancesMain()
test_config = core.get_config()
test_args = core.get_args()
app = GlancesRestfulApi(config=test_config, args=test_args)._app
with open('./docs/api/openapi.json', 'w') as f:
json.dump(
get_openapi(
title=app.title,
version=app.version,
# Set the OenAPI version
# It's an hack to make openapi.json compatible with tools like https://editor.swagger.io/
# Please read https://fastapi.tiangolo.com/reference/fastapi/?h=openapi#fastapi.FastAPI.openapi_version
openapi_version="3.0.2",
description=app.description,
routes=app.routes,
),
f,
)

13
generate_webui_conf.py Normal file
View File

@ -0,0 +1,13 @@
import json
from glances.outputs.glances_curses import _GlancesCurses
print(
json.dumps(
{
"topMenu": list(_GlancesCurses._top),
"leftMenu": [p for p in _GlancesCurses._left_sidebar if p != "now"],
},
indent=4,
)
)

523
glances.ipynb Normal file
View File

@ -0,0 +1,523 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "592b8135-c06b-41b7-895e-9dd70787f6ac",
"metadata": {},
"source": [
"# Use Glances API in your Python code"
]
},
{
"cell_type": "markdown",
"id": "e5ec86ae-ce2b-452f-b715-54e746026a96",
"metadata": {},
"source": [
"## Init the Glances API"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "ba9b3546-65a0-4eec-942b-1855ff5c5d32",
"metadata": {},
"outputs": [],
"source": [
"from glances import api"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "e81ad928-3b61-4654-8589-13cb29e7f292",
"metadata": {},
"outputs": [],
"source": [
"gl = api.GlancesAPI()"
]
},
{
"cell_type": "markdown",
"id": "6ec912a3-0875-4cdb-8539-e84ffb27768a",
"metadata": {},
"source": [
"## Get plugins list"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "1ce57a13-a90d-4d65-b4a4-2bc45112697e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['alert',\n",
" 'ports',\n",
" 'diskio',\n",
" 'containers',\n",
" 'processcount',\n",
" 'programlist',\n",
" 'gpu',\n",
" 'percpu',\n",
" 'vms',\n",
" 'system',\n",
" 'network',\n",
" 'cpu',\n",
" 'amps',\n",
" 'processlist',\n",
" 'load',\n",
" 'sensors',\n",
" 'uptime',\n",
" 'now',\n",
" 'connections',\n",
" 'fs',\n",
" 'wifi',\n",
" 'ip',\n",
" 'help',\n",
" 'version',\n",
" 'psutilversion',\n",
" 'core',\n",
" 'mem',\n",
" 'folders',\n",
" 'quicklook',\n",
" 'memswap',\n",
" 'raid']"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.plugins()"
]
},
{
"cell_type": "markdown",
"id": "d5be2964-7a28-4b93-9dd0-1481afd2ee50",
"metadata": {},
"source": [
"## Get CPU stats"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "0d1636d2-3f3e-44d4-bb67-45487384f79f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'total': 3.8, 'user': 3.0, 'nice': 0.0, 'system': 0.8, 'idle': 96.1, 'iowait': 0.1, 'irq': 0.0, 'steal': 0.0, 'guest': 0.0, 'ctx_switches': 0, 'interrupts': 0, 'soft_interrupts': 0, 'syscalls': 0, 'cpucore': 16, 'time_since_update': 141.46278643608093, 'ctx_switches_gauge': 12830371, 'ctx_switches_rate_per_sec': 0, 'interrupts_gauge': 9800040, 'interrupts_rate_per_sec': 0, 'soft_interrupts_gauge': 3875931, 'soft_interrupts_rate_per_sec': 0, 'syscalls_gauge': 0, 'syscalls_rate_per_sec': 0}"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.cpu"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "99681a33-045e-43bf-927d-88b15872fad0",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"3.1"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.cpu.get('total')"
]
},
{
"cell_type": "markdown",
"id": "07e30de4-8f2a-4110-9c43-2a87d91dbf24",
"metadata": {},
"source": [
"## Get MEMORY stats"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "33502d93-acf9-49c5-8bcd-0a0404b47829",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'total': 16422858752, 'available': 6726169136, 'percent': 59.0, 'used': 9696689616, 'free': 541847552, 'active': 8672595968, 'inactive': 5456875520, 'buffers': 354791424, 'cached': 6520318384, 'shared': 729960448}"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.mem"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "404cd8d6-ac38-4830-8ead-4b747e0ca7b1",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"6779998768"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.mem.get('available')"
]
},
{
"cell_type": "markdown",
"id": "74e27e9f-3240-4827-a754-3538b7d68119",
"metadata": {},
"source": [
"Display it in a user friendly way:"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "fa83b40a-51e8-45fa-b478-d0fcc9de4639",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'6.28G'"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.auto_unit(gl.mem.get('available'))"
]
},
{
"cell_type": "markdown",
"id": "bfaf5b94-7c9c-4fdc-8a91-71f543cafa4b",
"metadata": {},
"source": [
"## Get NETWORK stats"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "a0ab2ce7-e9bd-4a60-9b90-095a9023dac7",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'wlp0s20f3': {'bytes_sent': 1130903, 'bytes_recv': 2213272, 'speed': 0, 'key': 'interface_name', 'interface_name': 'wlp0s20f3', 'alias': 'WIFI', 'bytes_all': 3344175, 'time_since_update': 354.35748958587646, 'bytes_recv_gauge': 1108380679, 'bytes_recv_rate_per_sec': 6245.0, 'bytes_sent_gauge': 21062113, 'bytes_sent_rate_per_sec': 3191.0, 'bytes_all_gauge': 1129442792, 'bytes_all_rate_per_sec': 9437.0}}"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.network"
]
},
{
"cell_type": "markdown",
"id": "b65f7280-d9f0-4719-9e10-8b78dc414bae",
"metadata": {},
"source": [
"Get the list of networks interfaces:"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "1a55d32a-bd7d-4dfa-b239-8875c01f205e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['wlp0s20f3']"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.network.keys()"
]
},
{
"cell_type": "markdown",
"id": "8c7e0215-e96a-4f7e-a187-9b7bee1abcf9",
"metadata": {},
"source": [
"Get stats for a specific network interface:"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "9aacfb32-c0e3-4fc7-b1d2-d216e46088cd",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'bytes_sent': 118799,\n",
" 'bytes_recv': 275052,\n",
" 'speed': 0,\n",
" 'key': 'interface_name',\n",
" 'interface_name': 'wlp0s20f3',\n",
" 'alias': 'WIFI',\n",
" 'bytes_all': 393851,\n",
" 'time_since_update': 46.24822926521301,\n",
" 'bytes_recv_gauge': 1108795793,\n",
" 'bytes_recv_rate_per_sec': 5947.0,\n",
" 'bytes_sent_gauge': 21268464,\n",
" 'bytes_sent_rate_per_sec': 2568.0,\n",
" 'bytes_all_gauge': 1130064257,\n",
" 'bytes_all_rate_per_sec': 8516.0}"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.network.get('wlp0s20f3')"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "4f5ae513-6022-4a52-8d6c-e8b62afacc24",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"5105.0"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.network.get('wlp0s20f3').get('bytes_recv_rate_per_sec')"
]
},
{
"cell_type": "markdown",
"id": "8b0bdbf4-e386-44aa-9585-1d042f0ded5d",
"metadata": {},
"source": [
"## Additional information"
]
},
{
"cell_type": "markdown",
"id": "5c52a0c7-06fb-432a-bdb7-9921f432d5a6",
"metadata": {},
"source": [
"Example for the LOAD plugin."
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "99303a2b-52a3-440f-a896-ad4951a9de34",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'min1': 1.01123046875, 'min5': 0.83447265625, 'min15': 0.76171875, 'cpucore': 16}"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.load"
]
},
{
"cell_type": "markdown",
"id": "7a560824-2787-4436-b39b-63de0c455536",
"metadata": {},
"source": [
"Get the limit configured in the glances.conf:"
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "cbbc6a81-623f-4eff-9d08-e6a8b5981660",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'min1': {'description': 'Average sum of the number of processes waiting in the run-queue plus the number currently executing over 1 minute.',\n",
" 'unit': 'float'},\n",
" 'min5': {'description': 'Average sum of the number of processes waiting in the run-queue plus the number currently executing over 5 minutes.',\n",
" 'unit': 'float'},\n",
" 'min15': {'description': 'Average sum of the number of processes waiting in the run-queue plus the number currently executing over 15 minutes.',\n",
" 'unit': 'float'},\n",
" 'cpucore': {'description': 'Total number of CPU core.', 'unit': 'number'}}"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.load.fields_description"
]
},
{
"cell_type": "markdown",
"id": "2bd51d13-77e3-48f0-aa53-af86df6425f8",
"metadata": {},
"source": [
"Get field description and unit:"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "8682edcf-a8b9-424c-976f-2a301a05be6a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'history_size': 1200.0,\n",
" 'load_disable': ['False'],\n",
" 'load_careful': 0.7,\n",
" 'load_warning': 1.0,\n",
" 'load_critical': 5.0}"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.load.get_limits()"
]
},
{
"cell_type": "raw",
"id": "3c671ff8-3a0c-48d3-8247-6081c69c19a9",
"metadata": {},
"source": [
"Get current stats views regarding limits:"
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "45e03e9b-233c-4359-bcbc-7d2f06aca1c6",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'min1': {'decoration': 'DEFAULT',\n",
" 'optional': False,\n",
" 'additional': False,\n",
" 'splittable': False,\n",
" 'hidden': False},\n",
" 'min5': {'decoration': 'OK',\n",
" 'optional': False,\n",
" 'additional': False,\n",
" 'splittable': False,\n",
" 'hidden': False},\n",
" 'min15': {'decoration': 'OK_LOG',\n",
" 'optional': False,\n",
" 'additional': False,\n",
" 'splittable': False,\n",
" 'hidden': False},\n",
" 'cpucore': {'decoration': 'DEFAULT',\n",
" 'optional': False,\n",
" 'additional': False,\n",
" 'splittable': False,\n",
" 'hidden': False}}"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gl.load.get_views()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.0"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@ -2,36 +2,3 @@ You are in the main Glances source folder. This page is **ONLY** for developers.
If you are looking for the user manual, please follow this link:
https://glances.readthedocs.io/en/stable/
===
__init__.py Global module init
__main__.py Entry point for Glances module
config.py Manage the configuration file
globals.py Share variables upon modules
main.py Main script to rule them up...
client.py Glances client
server.py Glances server
webserver.py Glances web server (Based on FastAPI)
autodiscover.py Glances autodiscover module (via zeroconf)
standalone.py Glances standalone (curses interface)
password.py Manage password for Glances client/server
stats.py The stats manager
timer.py The timer class
actions.py Manage trigger actions (via mustache)
snmp.py Glances SNMP client (via pysnmp)
...
plugins
=> Glances plugins
...
outputs
=> Glances UI
glances_curses.py The curses interface
glances_restful-api.py The HTTP/API & Web based interface
...
exports
=> Glances exports
...
amps
=> Glances Application Monitoring Processes (AMP)
...

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
@ -11,16 +10,17 @@
"""Init the Glances software."""
# Import system libs
import tracemalloc
import locale
import platform
import signal
import sys
import tracemalloc
# Global name
# Version should start and end with a numerical char
# See https://packaging.python.org/specifications/core-metadata/#version
__version__ = '4.0.0'
# Examples: 1.0.0, 1.0.0rc1, 1.1.0_dev1
__version__ = "4.4.2_dev1"
__apiversion__ = '4'
__author__ = 'Nicolas Hennion <nicolas@nicolargo.com>'
__license__ = 'LGPLv3'
@ -44,11 +44,6 @@ try:
except locale.Error:
print("Warning: Unable to set locale. Expect encoding problems.")
# Check Python version
if sys.version_info < (3, 4):
print('Glances requires at least Python 3.4 to run.')
sys.exit(1)
# Check psutil version
psutil_min_version = (5, 3, 0)
psutil_version_info = tuple([int(num) for num in psutil_version.split('.')])
@ -56,11 +51,12 @@ if psutil_version_info < psutil_min_version:
print('psutil 5.3.0 or higher is needed. Glances cannot start.')
sys.exit(1)
# Trac malloc is only available on Python 3.4 or higher
def __signal_handler(signal, frame):
logger.debug("Signal {} catched".format(signal))
def __signal_handler(sig, frame):
logger.debug(f"Signal {sig} caught")
# Avoid Glances hang when killing process with muliple CTRL-C See #3264
signal.signal(signal.SIGINT, signal.SIG_IGN)
end()
@ -79,6 +75,53 @@ def end():
sys.exit(0)
def start_main_loop(args, start_duration):
logger.debug(f"Glances started in {start_duration.get()} seconds")
if args.stop_after:
logger.info(f'Glances will be stopped in ~{args.stop_after * args.time} seconds')
def check_memleak(args, mode):
if args.memory_leak:
wait = args.stop_after * args.time * args.memory_leak * 2
print(f'Memory leak detection, please wait ~{wait} seconds...')
# First run without dump to fill the memory
mode.serve_n(args.stop_after)
# Then start the memory-leak loop
snapshot_begin = tracemalloc.take_snapshot()
else:
snapshot_begin = None
return snapshot_begin
def setup_server_mode(args, mode):
if args.stdout_issue or args.stdout_api_restful_doc or args.stdout_api_doc:
# Serve once for issue and API documentation modes
mode.serve_issue()
else:
# Serve forever
mode.serve_forever()
def maybe_trace_memleak(args, snapshot_begin):
if args.trace_malloc or args.memory_leak:
snapshot_end = tracemalloc.take_snapshot()
if args.memory_leak:
snapshot_diff = snapshot_end.compare_to(snapshot_begin, 'filename')
memory_leak = sum([s.size_diff for s in snapshot_diff])
print(f"Memory consumption: {memory_leak / 1000:.1f}KB (see log for details)")
logger.info("Memory consumption (top 5):")
for stat in snapshot_diff[:5]:
logger.info(stat)
if args.trace_malloc:
# See more options here: https://docs.python.org/3/library/tracemalloc.html
top_stats = snapshot_end.statistics("filename")
print("[ Trace malloc - Top 10 ]")
for stat in top_stats[:10]:
print(stat)
def start(config, args):
"""Start Glances."""
@ -103,47 +146,13 @@ def start(config, args):
from glances.webserver import GlancesWebServer as GlancesMode
# Init the mode
logger.info("Start {} mode".format(GlancesMode.__name__))
logger.info(f"Start {GlancesMode.__name__} mode")
mode = GlancesMode(config=config, args=args)
# Start the main loop
logger.debug("Glances started in {} seconds".format(start_duration.get()))
if args.stop_after:
logger.info('Glances will be stopped in ~{} seconds'.format(args.stop_after * args.time))
if args.memory_leak:
print(
'Memory leak detection, please wait ~{} seconds...'.format(
args.stop_after * args.time * args.memory_leak * 2
)
)
# First run without dump to fill the memory
mode.serve_n(args.stop_after)
# Then start the memory-leak loop
snapshot_begin = tracemalloc.take_snapshot()
if args.stdout_issue or args.stdout_apidoc:
# Serve once for issue/test mode
mode.serve_issue()
else:
# Serve forever
mode.serve_forever()
if args.memory_leak:
snapshot_end = tracemalloc.take_snapshot()
snapshot_diff = snapshot_end.compare_to(snapshot_begin, 'filename')
memory_leak = sum([s.size_diff for s in snapshot_diff])
print("Memory consumption: {0:.1f}KB (see log for details)".format(memory_leak / 1000))
logger.info("Memory consumption (top 5):")
for stat in snapshot_diff[:5]:
logger.info(stat)
elif args.trace_malloc:
# See more options here: https://docs.python.org/3/library/tracemalloc.html
snapshot = tracemalloc.take_snapshot()
top_stats = snapshot.statistics("filename")
print("[ Trace malloc - Top 10 ]")
for stat in top_stats[:10]:
print(stat)
start_main_loop(args, start_duration)
snapshot_begin = check_memleak(args, mode)
setup_server_mode(args, mode)
maybe_trace_memleak(args, snapshot_begin)
# Shutdown
mode.end()
@ -165,12 +174,10 @@ def main():
signal.signal(sig, __signal_handler)
# Log Glances and psutil version
logger.info('Start Glances {}'.format(__version__))
logger.info(
'{} {} ({}) and psutil {} detected'.format(
platform.python_implementation(), platform.python_version(), sys.executable, psutil_version
)
)
logger.info(f'Start Glances {__version__}')
python_impl = platform.python_implementation()
python_ver = platform.python_version()
logger.info(f'{python_impl} {python_ver} ({sys.executable}) and psutil {psutil_version} detected')
# Share global var
global core
@ -182,3 +189,6 @@ def main():
# Glances can be ran in standalone, client or server mode
start(config=core.get_config(), args=core.get_args())
# End of glances/__init__.py

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# Glances - An eye on your system
#

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
@ -10,8 +9,8 @@
"""Manage on alert actions."""
from glances.logger import logger
from glances.timer import Timer
from glances.secure import secure_popen
from glances.timer import Timer
try:
import chevron
@ -22,7 +21,7 @@ else:
chevron_tag = True
class GlancesActions(object):
class GlancesActions:
"""This class manage action if an alert is reached."""
def __init__(self, args=None):
@ -80,13 +79,13 @@ class GlancesActions(object):
else:
cmd_full = cmd
# Execute the action
logger.info("Action triggered for {} ({}): {}".format(stat_name, criticality, cmd_full))
logger.info(f"Action triggered for {stat_name} ({criticality}): {cmd_full}")
try:
ret = secure_popen(cmd_full)
except OSError as e:
logger.error("Action error for {} ({}): {}".format(stat_name, criticality, e))
logger.error(f"Action error for {stat_name} ({criticality}): {e}")
else:
logger.debug("Action result for {} ({}): {}".format(stat_name, criticality, ret))
logger.debug(f"Action result for {stat_name} ({criticality}): {ret}")
self.set(stat_name, criticality)

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
@ -23,11 +22,11 @@ If the *one_line* var is true then the AMP will be displayed in one line.
"""
from glances.globals import u
from glances.timer import Timer
from glances.logger import logger
from glances.timer import Timer
class GlancesAmp(object):
class GlancesAmp:
"""Main class for Glances AMP."""
NAME = '?'
@ -38,7 +37,7 @@ class GlancesAmp(object):
def __init__(self, name=None, args=None):
"""Init AMP class."""
logger.debug("AMP - Init {} version {}".format(self.NAME, self.VERSION))
logger.debug(f"AMP - Init {self.NAME} version {self.VERSION}")
# AMP name (= module name without glances_)
if name is None:
@ -74,7 +73,7 @@ class GlancesAmp(object):
amp_section = 'amp_' + self.amp_name
if hasattr(config, 'has_section') and config.has_section(amp_section):
logger.debug("AMP - {}: Load configuration".format(self.NAME))
logger.debug(f"AMP - {self.NAME}: Load configuration")
for param, _ in config.items(amp_section):
try:
self.configs[param] = config.get_float_value(amp_section, param)
@ -82,9 +81,9 @@ class GlancesAmp(object):
self.configs[param] = config.get_value(amp_section, param).split(',')
if len(self.configs[param]) == 1:
self.configs[param] = self.configs[param][0]
logger.debug("AMP - {}: Load parameter: {} = {}".format(self.NAME, param, self.configs[param]))
logger.debug(f"AMP - {self.NAME}: Load parameter: {param} = {self.configs[param]}")
else:
logger.debug("AMP - {}: Can not find section {} in the configuration file".format(self.NAME, self.amp_name))
logger.debug(f"AMP - {self.NAME}: Can not find section {self.amp_name} in the configuration file")
return False
if self.enable():
@ -92,13 +91,12 @@ class GlancesAmp(object):
for k in ['refresh']:
if k not in self.configs:
logger.warning(
"AMP - {}: Can not find configuration key {} in section {} (the AMP will be disabled)".format(
self.NAME, k, self.amp_name
)
f"AMP - {self.NAME}: Can not find configuration key {k} in section {self.amp_name} "
f"(the AMP will be disabled)"
)
self.configs['enable'] = 'false'
else:
logger.debug("AMP - {} is disabled".format(self.NAME))
logger.debug(f"AMP - {self.NAME} is disabled")
# Init the count to 0
self.configs['count'] = 0
@ -109,16 +107,14 @@ class GlancesAmp(object):
"""Generic method to get the item in the AMP configuration"""
if key in self.configs:
return self.configs[key]
else:
return None
return None
def enable(self):
"""Return True|False if the AMP is enabled in the configuration file (enable=true|false)."""
ret = self.get('enable')
if ret is None:
return False
else:
return ret.lower().startswith('true')
return ret.lower().startswith('true')
def regex(self):
"""Return regular expression used to identified the current application."""
@ -133,8 +129,7 @@ class GlancesAmp(object):
ret = self.get('one_line')
if ret is None:
return False
else:
return ret.lower().startswith('true')
return ret.lower().startswith('true')
def time_until_refresh(self):
"""Return time in seconds until refresh."""
@ -193,5 +188,4 @@ class GlancesAmp(object):
# Call the children update method
if self.should_update():
return self.update(process_list)
else:
return self.result()
return self.result()

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
@ -25,11 +24,9 @@ one_line=false
command=foo status
"""
from subprocess import check_output, STDOUT, CalledProcessError
from glances.globals import u, to_ascii
from glances.logger import logger
from glances.amps.amp import GlancesAmp
from glances.logger import logger
from glances.secure import secure_popen
class Amp(GlancesAmp):
@ -44,7 +41,7 @@ class Amp(GlancesAmp):
def __init__(self, name=None, args=None):
"""Init the AMP."""
self.NAME = name.capitalize()
super(Amp, self).__init__(name=name, args=args)
super().__init__(name=name, args=args)
def update(self, process_list):
"""Update the AMP"""
@ -54,7 +51,7 @@ class Amp(GlancesAmp):
try:
res = self.get('command')
except OSError as e:
logger.debug('{}: Error while executing command ({})'.format(self.NAME, e))
logger.debug(f'{self.NAME}: Error while executing command ({e})')
return self.result()
# No command found, use default message
if res is None:
@ -69,10 +66,7 @@ class Amp(GlancesAmp):
# Run command(s)
# Comma separated commands can be executed
try:
msg = ''
for cmd in res.split(';'):
msg += u(check_output(cmd.split(), stderr=STDOUT))
self.set_result(to_ascii(msg.rstrip()))
except CalledProcessError as e:
self.set_result(secure_popen(res).rstrip())
except Exception as e:
self.set_result(e.output)
return self.result()

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
@ -46,8 +45,8 @@ status_url=http://localhost/nginx_status
import requests
from glances.logger import logger
from glances.amps.amp import GlancesAmp
from glances.logger import logger
class Amp(GlancesAmp):
@ -67,7 +66,7 @@ class Amp(GlancesAmp):
"""Update the AMP"""
# Get the Nginx status
logger.debug('{}: Update stats using status URL {}'.format(self.NAME, self.get('status_url')))
res = requests.get(self.get('status_url'))
res = requests.get(self.get('status_url'), timeout=15)
if res.ok:
# u'Active connections: 1 \nserver accepts handled requests\n 1 1 1 \nReading: 0 Writing: 1 Waiting: 0 \n'
self.set_result(res.text.rstrip())

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
@ -35,18 +34,18 @@ one_line=true
systemctl_cmd=/usr/bin/systemctl --plain
"""
from subprocess import check_output, CalledProcessError
from subprocess import CalledProcessError, check_output
from glances.logger import logger
from glances.globals import iteritems, to_ascii
from glances.amps.amp import GlancesAmp
from glances.globals import to_ascii
from glances.logger import logger
class Amp(GlancesAmp):
"""Glances' Systemd AMP."""
NAME = 'Systemd'
VERSION = '1.0'
VERSION = '1.1'
DESCRIPTION = 'Get services list from systemctl (systemd)'
AUTHOR = 'Nicolargo'
EMAIL = 'contact@nicolargo.com'
@ -62,7 +61,7 @@ class Amp(GlancesAmp):
try:
res = check_output(self.get('systemctl_cmd').split())
except (OSError, CalledProcessError) as e:
logger.debug('{}: Error while executing systemctl ({})'.format(self.NAME, e))
logger.debug(f'{self.NAME}: Error while executing systemctl ({e})')
else:
status = {}
# For each line
@ -78,8 +77,8 @@ class Amp(GlancesAmp):
status[column[c]] = 1
# Build the output (string) message
output = 'Services\n'
for k, v in iteritems(status):
output += '{}: {}\n'.format(k, v)
for k, v in status.items():
output += f'{k}: {v}\n'
self.set_result(output, separator=' ')
return self.result()

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
@ -34,18 +33,16 @@ one_line=true
service_cmd=/usr/bin/service --status-all
"""
from subprocess import check_output, STDOUT
from glances.logger import logger
from glances.globals import iteritems
from glances.amps.amp import GlancesAmp
from glances.logger import logger
from glances.secure import secure_popen
class Amp(GlancesAmp):
"""Glances' Systemd AMP."""
NAME = 'SystemV'
VERSION = '1.0'
VERSION = '1.1'
DESCRIPTION = 'Get services list from service (initd)'
AUTHOR = 'Nicolargo'
EMAIL = 'contact@nicolargo.com'
@ -59,9 +56,10 @@ class Amp(GlancesAmp):
# Get the systemctl status
logger.debug('{}: Update stats using service {}'.format(self.NAME, self.get('service_cmd')))
try:
res = check_output(self.get('service_cmd').split(), stderr=STDOUT).decode('utf-8')
except OSError as e:
logger.debug('{}: Error while executing service ({})'.format(self.NAME, e))
# res = check_output(self.get('service_cmd').split(), stderr=STDOUT).decode('utf-8')
res = secure_popen(self.get('service_cmd'))
except Exception as e:
logger.debug(f'{self.NAME}: Error while executing service ({e})')
else:
status = {'running': 0, 'stopped': 0, 'upstart': 0}
# For each line
@ -78,8 +76,8 @@ class Amp(GlancesAmp):
status['upstart'] += 1
# Build the output (string) message
output = 'Services\n'
for k, v in iteritems(status):
output += '{}: {}\n'.format(k, v)
for k, v in status.items():
output += f'{k}: {v}\n'
self.set_result(output, separator=' ')
return self.result()

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
@ -13,12 +12,12 @@ import os
import re
import threading
from glances.globals import listkeys, iteritems, amps_path
from glances.globals import amps_path, listkeys
from glances.logger import logger
from glances.processes import glances_processes
class AmpsList(object):
class AmpsList:
"""This class describes the optional application monitoring process list.
The AMP list is a list of processes with a specific monitoring action.
@ -57,9 +56,9 @@ class AmpsList(object):
try:
amp = __import__(os.path.basename(amp_module))
except ImportError as e:
logger.warning("Missing Python Lib ({}), cannot load AMP {}".format(e, amp_name))
logger.warning(f"Missing Python Lib ({e}), cannot load AMP {amp_name}")
except Exception as e:
logger.warning("Cannot load AMP {} ({})".format(amp_name, e))
logger.warning(f"Cannot load AMP {amp_name} ({e})")
else:
# Add the AMP to the dictionary
# The key is the AMP name
@ -69,7 +68,7 @@ class AmpsList(object):
# Load the AMP configuration
self.__amps_dict[amp_name].load_config(self.config)
# Log AMPs list
logger.debug("AMPs list: {}".format(self.getList()))
logger.debug(f"AMPs list: {self.getList()}")
return True
@ -91,7 +90,7 @@ class AmpsList(object):
processlist = glances_processes.get_list()
# Iter upon the AMPs dict
for k, v in iteritems(self.get()):
for k, v in self.get().items():
if not v.enable():
# Do not update if the enable tag is set
continue
@ -106,9 +105,9 @@ class AmpsList(object):
amps_list = self._build_amps_list(v, processlist)
if len(amps_list) > 0:
if amps_list:
# At least one process is matching the regex
logger.debug("AMPS: {} processes {} detected ({})".format(len(amps_list), k, amps_list))
logger.debug(f"AMPS: {len(amps_list)} processes {k} detected ({amps_list})")
# Call the AMP update method
thread = threading.Thread(target=v.update_wrapper, args=[amps_list])
thread.start()
@ -126,21 +125,17 @@ class AmpsList(object):
Search application monitored processes by a regular expression
"""
ret = []
try:
# Search in both cmdline and name (for kernel thread, see #1261)
for p in processlist:
if (re.search(amp_value.regex(), p['name']) is not None) or (
p['cmdline'] is not None
and p['cmdline'] != []
and re.search(amp_value.regex(), ' '.join(p['cmdline'])) is not None
):
ret.append(
{'pid': p['pid'], 'cpu_percent': p['cpu_percent'], 'memory_percent': p['memory_percent']}
)
ret = [
{'pid': p['pid'], 'cpu_percent': p['cpu_percent'], 'memory_percent': p['memory_percent']}
for p in processlist
if re.search(amp_value.regex(), p['name'])
or ((cmdline := p.get('cmdline')) and re.search(amp_value.regex(), ' '.join(cmdline)))
]
except (TypeError, KeyError) as e:
logger.debug("Can not build AMPS list ({})".format(e))
logger.debug(f"Can not build AMPS list ({e})")
return ret

117
glances/api.py Normal file
View File

@ -0,0 +1,117 @@
#
# Glances - An eye on your system
#
# SPDX-FileCopyrightText: 2025 Nicolas Hennion <nicolas@nicolargo.com>
#
# SPDX-License-Identifier: LGPL-3.0-only
#
from glances import __version__ as glances_version
from glances.globals import auto_unit, weak_lru_cache
from glances.main import GlancesMain
from glances.outputs.glances_bars import Bar
from glances.processes import sort_stats
from glances.stats import GlancesStats
plugin_dependencies_tree = {
'processlist': ['processcount'],
}
class GlancesAPI:
ttl = 2.0 # Default cache TTL in seconds
def __init__(self, config=None, args=None):
self.__version__ = glances_version.split('.')[0] # Get the major version
core = GlancesMain()
self.args = args if args is not None else core.get_args()
self.config = config if config is not None else core.get_config()
self._stats = GlancesStats(config=self.config, args=self.args)
# Set the cache TTL for the API
self.ttl = self.args.time if self.args.time is not None else self.ttl
# Init the stats of all plugins in order to ensure that rate are computed
self._stats.update()
@weak_lru_cache(maxsize=1, ttl=ttl)
def __getattr__(self, item):
"""Fallback to the stats object for any missing attributes."""
if item in self._stats.getPluginsList():
if item in plugin_dependencies_tree:
# Ensure dependencies are updated before accessing the plugin
for dependency in plugin_dependencies_tree[item]:
self._stats.get_plugin(dependency).update()
# Update the plugin stats
self._stats.get_plugin(item).update()
return self._stats.get_plugin(item)
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{item}'")
def plugins(self):
"""Return the list of available plugins."""
return self._stats.getPluginsList()
def auto_unit(self, number, low_precision=False, min_symbol='K', none_symbol='-'):
"""
Converts a numeric value into a human-readable string with appropriate units.
Args:
number (float or int): The numeric value to be converted.
low_precision (bool, optional): If True, use lower precision for the output. Defaults to False.
min_symbol (str, optional): The minimum unit symbol to use (e.g., 'K' for kilo). Defaults to 'K'.
none_symbol (str, optional): The symbol to display if the number is None. Defaults to '-'.
Returns:
str: A human-readable string representation of the number with units.
"""
return auto_unit(number, low_precision, min_symbol, none_symbol)
def bar(self, value, size=18, bar_char='', empty_char='', pre_char='', post_char=''):
"""
Generate a progress bar representation for a given value.
Args:
value (float): The percentage value to represent in the bar (typically between 0 and 100).
size (int, optional): The total length of the bar in characters. Defaults to 18.
bar_char (str, optional): The character used to represent the filled portion of the bar. Defaults to ''.
empty_char (str, optional): The character used to represent the empty portion of the bar. Defaults to ''.
pre_char (str, optional): A string to prepend to the bar. Defaults to ''.
post_char (str, optional): A string to append to the bar. Defaults to ''.
Returns:
str: A string representing the progress bar.
"""
b = Bar(
size, bar_char=bar_char, empty_char=empty_char, pre_char=pre_char, post_char=post_char, display_value=False
)
b.percent = value
return b.get()
def top_process(self, limit=3, sorted_by='cpu_percent', sorted_by_secondary='memory_percent'):
"""
Returns a list of the top processes sorted by specified criteria.
Args:
limit (int, optional): The maximum number of top processes to return. Defaults to 3.
sorted_by (str, optional): The primary key to sort processes by (e.g., 'cpu_percent').
Defaults to 'cpu_percent'.
sorted_by_secondary (str, optional): The secondary key to sort processes by if primary keys are equal
(e.g., 'memory_percent'). Defaults to 'memory_percent'.
Returns:
list: A list of dictionaries representing the top processes, excluding those with 'glances' in their
command line.
Note:
The 'glances' process is excluded from the returned list to avoid self-generated CPU load affecting
the results.
"""
# Exclude glances process from the top list
# because in fetch mode, Glances generate a CPU load
all_but_glances = [
p
for p in self._stats.get_plugin('processlist').get_raw()
if p['cmdline'] and 'glances' not in (p['cmdline'] or ())
]
return sort_stats(all_but_glances, sorted_by=sorted_by, sorted_by_secondary=sorted_by_secondary)[:limit]

Some files were not shown because too many files have changed in this diff Show More