mirror of
https://github.com/nicolargo/glances.git
synced 2024-08-16 16:00:27 +03:00
Compare commits
14 Commits
650633c1b5
...
65bee4b0a0
Author | SHA1 | Date | |
---|---|---|---|
|
65bee4b0a0 | ||
|
9b853d857b | ||
|
99e65079a0 | ||
|
0e1d462c69 | ||
|
f4c7ca01fe | ||
|
60591630df | ||
|
48103f167e | ||
|
154ae8e610 | ||
|
86c2cd1d4a | ||
|
452fd6497e | ||
|
ccfd8f0aa9 | ||
|
d91bfa2f8b | ||
|
582ca07716 | ||
|
f2c7ccb236 |
3
.github/workflows/test.yml
vendored
3
.github/workflows/test.yml
vendored
@ -99,7 +99,8 @@ jobs:
|
||||
runs-on: macos-14
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||
# Only test the latest stable version
|
||||
python-version: ["3.12"]
|
||||
|
||||
steps:
|
||||
|
||||
|
@ -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
|
||||
|
4
Makefile
4
Makefile
@ -93,7 +93,7 @@ lint: ## Lint the code.
|
||||
./venv-dev/bin/python -m ruff check . --fix
|
||||
|
||||
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
|
||||
./venv-dev/bin/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
|
||||
@ -185,7 +185,7 @@ flatpak: venv-dev-upgrade ## Generate FlatPack JSON file
|
||||
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:
|
||||
|
61
NEWS.rst
61
NEWS.rst
@ -2,13 +2,56 @@
|
||||
Glances ChangeLog
|
||||
==============================================================================
|
||||
|
||||
===============
|
||||
Version 4.2.0
|
||||
===============
|
||||
|
||||
Under development, see roadmap here: https://github.com/nicolargo/glances/milestone/73
|
||||
|
||||
Contributors are welcome !
|
||||
|
||||
===============
|
||||
Version 4.1.1
|
||||
===============
|
||||
|
||||
Bug corrected:
|
||||
|
||||
* Sensors data is not exported using InfluxDB2 exporter #2856
|
||||
|
||||
===============
|
||||
Version 4.1.0
|
||||
===============
|
||||
|
||||
Under development, see roadmap here: https://github.com/nicolargo/glances/milestone/68
|
||||
Enhancements:
|
||||
|
||||
Contributors are welcome !
|
||||
* 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
|
||||
@ -183,7 +226,7 @@ Many thinks to the contributors:
|
||||
* Christoph Zimmermann
|
||||
* RazCrimson
|
||||
* Robin Candau
|
||||
* Github GPG acces
|
||||
* Github GPG access
|
||||
* Continuous Integration
|
||||
* Georgiy Timchenko
|
||||
* turbocrime
|
||||
@ -357,7 +400,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:
|
||||
|
||||
@ -386,7 +429,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:
|
||||
|
||||
@ -434,9 +477,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:
|
||||
|
||||
@ -703,7 +746,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
|
||||
@ -1310,7 +1353,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)
|
||||
|
@ -2,7 +2,7 @@
|
||||
Glances - An eye on your system
|
||||
===============================
|
||||
|
||||
| |pypi| |test| |contibutors| |quality|
|
||||
| |pypi| |test| |contributors| |quality|
|
||||
| |starts| |docker| |pypistat|
|
||||
| |sponsors| |twitter|
|
||||
|
||||
@ -25,9 +25,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
|
||||
@ -141,7 +141,7 @@ 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.
|
||||
error message when you try to use ``pip``. In this case, go to the the PipX section below.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
|
@ -217,9 +217,9 @@ 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
|
||||
hide_no_up=True
|
||||
# Automatically hide interface with no IP address (default is False)
|
||||
#hide_no_ip=True
|
||||
hide_no_ip=True
|
||||
# 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
|
||||
@ -375,7 +375,7 @@ temperature_hdd_critical=60
|
||||
battery_careful=80
|
||||
battery_warning=90
|
||||
battery_critical=95
|
||||
# Fan speed threashold in RPM
|
||||
# Fan speed threshold in RPM
|
||||
#fan_speed_careful=100
|
||||
# Sensors alias
|
||||
#alias=core 0:CPU Core 0,core 1:CPU Core 1
|
||||
|
@ -27,7 +27,7 @@ services:
|
||||
environment:
|
||||
- TZ=${TZ}
|
||||
- "GLANCES_OPT=-C /glances/conf/glances.conf -w"
|
||||
# Uncomment for GPU compatibilty (Nvidia) inside the container
|
||||
# Uncomment for GPU compatibility (Nvidia) inside the container
|
||||
# deploy:
|
||||
# resources:
|
||||
# reservations:
|
||||
|
@ -15,7 +15,7 @@ services:
|
||||
environment:
|
||||
- TZ=${TZ}
|
||||
- "GLANCES_OPT=-C /glances/conf/glances.conf -w"
|
||||
# Uncomment for GPU compatibilty (Nvidia) inside the container
|
||||
# Uncomment for GPU compatibility (Nvidia) inside the container
|
||||
# deploy:
|
||||
# resources:
|
||||
# reservations:
|
||||
|
@ -60,7 +60,7 @@ max_processes_display=25
|
||||
#cors_headers=*
|
||||
|
||||
##############################################################################
|
||||
# plugins
|
||||
# Plugins
|
||||
##############################################################################
|
||||
|
||||
[quicklook]
|
||||
@ -375,7 +375,7 @@ temperature_hdd_critical=60
|
||||
battery_careful=80
|
||||
battery_warning=90
|
||||
battery_critical=95
|
||||
# Fan speed threashold in RPM
|
||||
# Fan speed threshold in RPM
|
||||
#fan_speed_careful=100
|
||||
# Sensors alias
|
||||
#alias=core 0:CPU Core 0,core 1:CPU Core 1
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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.
|
||||
|
||||
|
||||
|
@ -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:
|
||||
|
@ -49,7 +49,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.
|
||||
|
362
docs/api.rst
362
docs/api.rst
@ -141,7 +141,7 @@ Get plugin stats::
|
||||
"refresh": 3.0,
|
||||
"regex": True,
|
||||
"result": None,
|
||||
"timer": 0.3547241687774658},
|
||||
"timer": 0.2482151985168457},
|
||||
{"count": 0,
|
||||
"countmax": 20.0,
|
||||
"countmin": None,
|
||||
@ -150,7 +150,7 @@ Get plugin stats::
|
||||
"refresh": 3.0,
|
||||
"regex": True,
|
||||
"result": None,
|
||||
"timer": 0.35463643074035645}]
|
||||
"timer": 0.24815130233764648}]
|
||||
|
||||
Fields descriptions:
|
||||
|
||||
@ -178,7 +178,7 @@ Get a specific item when field matches the given value::
|
||||
"refresh": 3.0,
|
||||
"regex": True,
|
||||
"result": None,
|
||||
"timer": 0.3547241687774658}]}
|
||||
"timer": 0.2482151985168457}]}
|
||||
|
||||
GET cloud
|
||||
---------
|
||||
@ -265,19 +265,19 @@ Get plugin stats::
|
||||
|
||||
# curl http://localhost:61208/api/4/cpu
|
||||
{"cpucore": 16,
|
||||
"ctx_switches": 169444872,
|
||||
"ctx_switches": 493080568,
|
||||
"guest": 0.0,
|
||||
"idle": 1.0,
|
||||
"interrupts": 146166619,
|
||||
"iowait": 0.0,
|
||||
"idle": 86.5,
|
||||
"interrupts": 420997918,
|
||||
"iowait": 0.5,
|
||||
"irq": 0.0,
|
||||
"nice": 0.0,
|
||||
"soft_interrupts": 52532028,
|
||||
"soft_interrupts": 155707720,
|
||||
"steal": 0.0,
|
||||
"syscalls": 0,
|
||||
"system": 0.0,
|
||||
"total": 0.0,
|
||||
"user": 0.0}
|
||||
"system": 3.5,
|
||||
"total": 12.9,
|
||||
"user": 9.4}
|
||||
|
||||
Fields descriptions:
|
||||
|
||||
@ -310,7 +310,7 @@ Fields descriptions:
|
||||
Get a specific field::
|
||||
|
||||
# curl http://localhost:61208/api/4/cpu/total
|
||||
{"total": 0.0}
|
||||
{"total": 12.9}
|
||||
|
||||
GET diskio
|
||||
----------
|
||||
@ -320,14 +320,14 @@ Get plugin stats::
|
||||
# curl http://localhost:61208/api/4/diskio
|
||||
[{"disk_name": "nvme0n1",
|
||||
"key": "disk_name",
|
||||
"read_bytes": 4366260736,
|
||||
"read_count": 140249,
|
||||
"write_bytes": 8372364288,
|
||||
"write_count": 412923},
|
||||
"read_bytes": 10167291392,
|
||||
"read_count": 391026,
|
||||
"write_bytes": 31230641152,
|
||||
"write_count": 1527146},
|
||||
{"disk_name": "nvme0n1p1",
|
||||
"key": "disk_name",
|
||||
"read_bytes": 7476224,
|
||||
"read_count": 576,
|
||||
"read_bytes": 7558144,
|
||||
"read_count": 605,
|
||||
"write_bytes": 1024,
|
||||
"write_count": 2}]
|
||||
|
||||
@ -363,10 +363,10 @@ Get a specific item when field matches the given value::
|
||||
# curl http://localhost:61208/api/4/diskio/disk_name/nvme0n1
|
||||
{"nvme0n1": [{"disk_name": "nvme0n1",
|
||||
"key": "disk_name",
|
||||
"read_bytes": 4366260736,
|
||||
"read_count": 140249,
|
||||
"write_bytes": 8372364288,
|
||||
"write_count": 412923}]}
|
||||
"read_bytes": 10167291392,
|
||||
"read_count": 391026,
|
||||
"write_bytes": 31230641152,
|
||||
"write_count": 1527146}]}
|
||||
|
||||
GET folders
|
||||
-----------
|
||||
@ -393,13 +393,13 @@ Get plugin stats::
|
||||
|
||||
# curl http://localhost:61208/api/4/fs
|
||||
[{"device_name": "/dev/mapper/ubuntu--vg-ubuntu--lv",
|
||||
"free": 899103723520,
|
||||
"free": 897378041856,
|
||||
"fs_type": "ext4",
|
||||
"key": "mnt_point",
|
||||
"mnt_point": "/",
|
||||
"percent": 5.6,
|
||||
"percent": 5.8,
|
||||
"size": 1003736440832,
|
||||
"used": 53570211840}]
|
||||
"used": 55295893504}]
|
||||
|
||||
Fields descriptions:
|
||||
|
||||
@ -420,13 +420,13 @@ Get a specific item when field matches the given value::
|
||||
|
||||
# curl http://localhost:61208/api/4/fs/mnt_point//
|
||||
{"/": [{"device_name": "/dev/mapper/ubuntu--vg-ubuntu--lv",
|
||||
"free": 899103723520,
|
||||
"free": 897378041856,
|
||||
"fs_type": "ext4",
|
||||
"key": "mnt_point",
|
||||
"mnt_point": "/",
|
||||
"percent": 5.6,
|
||||
"percent": 5.8,
|
||||
"size": 1003736440832,
|
||||
"used": 53570211840}]}
|
||||
"used": 55295893504}]}
|
||||
|
||||
GET gpu
|
||||
-------
|
||||
@ -499,7 +499,10 @@ GET load
|
||||
Get plugin stats::
|
||||
|
||||
# curl http://localhost:61208/api/4/load
|
||||
{"cpucore": 16, "min1": 0.9208984375, "min15": 0.935546875, "min5": 0.978515625}
|
||||
{"cpucore": 16,
|
||||
"min1": 0.40185546875,
|
||||
"min15": 0.587890625,
|
||||
"min5": 0.638671875}
|
||||
|
||||
Fields descriptions:
|
||||
|
||||
@ -511,7 +514,7 @@ Fields descriptions:
|
||||
Get a specific field::
|
||||
|
||||
# curl http://localhost:61208/api/4/load/min1
|
||||
{"min1": 0.9208984375}
|
||||
{"min1": 0.40185546875}
|
||||
|
||||
GET mem
|
||||
-------
|
||||
@ -519,16 +522,16 @@ GET mem
|
||||
Get plugin stats::
|
||||
|
||||
# curl http://localhost:61208/api/4/mem
|
||||
{"active": 8524726272,
|
||||
"available": 8201060352,
|
||||
"buffers": 414851072,
|
||||
"cached": 6714773504,
|
||||
"free": 8201060352,
|
||||
"inactive": 3872276480,
|
||||
"percent": 50.1,
|
||||
"shared": 883290112,
|
||||
{"active": 5094199296,
|
||||
"available": 10908983296,
|
||||
"buffers": 180162560,
|
||||
"cached": 5800796160,
|
||||
"free": 10908983296,
|
||||
"inactive": 3735175168,
|
||||
"percent": 33.6,
|
||||
"shared": 622718976,
|
||||
"total": 16422486016,
|
||||
"used": 8221425664}
|
||||
"used": 5513502720}
|
||||
|
||||
Fields descriptions:
|
||||
|
||||
@ -555,13 +558,13 @@ GET memswap
|
||||
Get plugin stats::
|
||||
|
||||
# curl http://localhost:61208/api/4/memswap
|
||||
{"free": 4294963200,
|
||||
"percent": 0.0,
|
||||
"sin": 0,
|
||||
"sout": 0,
|
||||
{"free": 3836997632,
|
||||
"percent": 10.7,
|
||||
"sin": 186925056,
|
||||
"sout": 1518604288,
|
||||
"time_since_update": 1,
|
||||
"total": 4294963200,
|
||||
"used": 0}
|
||||
"used": 457965568}
|
||||
|
||||
Fields descriptions:
|
||||
|
||||
@ -586,15 +589,15 @@ Get plugin stats::
|
||||
# curl http://localhost:61208/api/4/network
|
||||
[{"alias": None,
|
||||
"bytes_all": 0,
|
||||
"bytes_all_gauge": 2165726764,
|
||||
"bytes_all_gauge": 6286191015,
|
||||
"bytes_recv": 0,
|
||||
"bytes_recv_gauge": 2033492615,
|
||||
"bytes_recv_gauge": 5977645732,
|
||||
"bytes_sent": 0,
|
||||
"bytes_sent_gauge": 132234149,
|
||||
"bytes_sent_gauge": 308545283,
|
||||
"interface_name": "wlp0s20f3",
|
||||
"key": "interface_name",
|
||||
"speed": 0,
|
||||
"time_since_update": 0.359783411026001}]
|
||||
"time_since_update": 0.2501566410064697}]
|
||||
|
||||
Fields descriptions:
|
||||
|
||||
@ -623,15 +626,15 @@ Get a specific item when field matches the given value::
|
||||
# curl http://localhost:61208/api/4/network/interface_name/wlp0s20f3
|
||||
{"wlp0s20f3": [{"alias": None,
|
||||
"bytes_all": 0,
|
||||
"bytes_all_gauge": 2165726764,
|
||||
"bytes_all_gauge": 6286191015,
|
||||
"bytes_recv": 0,
|
||||
"bytes_recv_gauge": 2033492615,
|
||||
"bytes_recv_gauge": 5977645732,
|
||||
"bytes_sent": 0,
|
||||
"bytes_sent_gauge": 132234149,
|
||||
"bytes_sent_gauge": 308545283,
|
||||
"interface_name": "wlp0s20f3",
|
||||
"key": "interface_name",
|
||||
"speed": 0,
|
||||
"time_since_update": 0.359783411026001}]}
|
||||
"time_since_update": 0.2501566410064697}]}
|
||||
|
||||
GET now
|
||||
-------
|
||||
@ -639,7 +642,7 @@ GET now
|
||||
Get plugin stats::
|
||||
|
||||
# curl http://localhost:61208/api/4/now
|
||||
{"custom": "2024-06-16 22:34:24 CEST", "iso": "2024-06-16T22:34:24+02:00"}
|
||||
{"custom": "2024-06-29 19:17:41 CEST", "iso": "2024-06-29T19:17:41+02:00"}
|
||||
|
||||
Fields descriptions:
|
||||
|
||||
@ -649,7 +652,7 @@ Fields descriptions:
|
||||
Get a specific field::
|
||||
|
||||
# curl http://localhost:61208/api/4/now/iso
|
||||
{"iso": "2024-06-16T22:34:24+02:00"}
|
||||
{"iso": "2024-06-29T19:17:41+02:00"}
|
||||
|
||||
GET percpu
|
||||
----------
|
||||
@ -660,7 +663,7 @@ Get plugin stats::
|
||||
[{"cpu_number": 0,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 0.0,
|
||||
"idle": 21.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
@ -668,12 +671,12 @@ Get plugin stats::
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 100.0,
|
||||
"user": 0.0},
|
||||
"total": 79.0,
|
||||
"user": 1.0},
|
||||
{"cpu_number": 1,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 1.0,
|
||||
"idle": 23.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
@ -681,7 +684,7 @@ Get plugin stats::
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 99.0,
|
||||
"total": 77.0,
|
||||
"user": 0.0}]
|
||||
|
||||
Fields descriptions:
|
||||
@ -716,7 +719,7 @@ Get plugin stats::
|
||||
"port": 0,
|
||||
"refresh": 30,
|
||||
"rtt_warning": None,
|
||||
"status": 0.005679,
|
||||
"status": 0.006275,
|
||||
"timeout": 3}]
|
||||
|
||||
Fields descriptions:
|
||||
@ -744,7 +747,7 @@ Get a specific item when field matches the given value::
|
||||
"port": 0,
|
||||
"refresh": 30,
|
||||
"rtt_warning": None,
|
||||
"status": 0.005679,
|
||||
"status": 0.006275,
|
||||
"timeout": 3}]}
|
||||
|
||||
GET processcount
|
||||
@ -753,7 +756,7 @@ GET processcount
|
||||
Get plugin stats::
|
||||
|
||||
# curl http://localhost:61208/api/4/processcount
|
||||
{"pid_max": 0, "running": 0, "sleeping": 282, "thread": 1687, "total": 477}
|
||||
{"pid_max": 0, "running": 2, "sleeping": 277, "thread": 1508, "total": 412}
|
||||
|
||||
Fields descriptions:
|
||||
|
||||
@ -766,7 +769,7 @@ Fields descriptions:
|
||||
Get a specific field::
|
||||
|
||||
# curl http://localhost:61208/api/4/processcount/total
|
||||
{"total": 477}
|
||||
{"total": 412}
|
||||
|
||||
GET processlist
|
||||
---------------
|
||||
@ -774,7 +777,78 @@ GET processlist
|
||||
Get plugin stats::
|
||||
|
||||
# curl http://localhost:61208/api/4/processlist
|
||||
[]
|
||||
[{"cmdline": ["/snap/firefox/4336/usr/lib/firefox/firefox"],
|
||||
"cpu_percent": 0.0,
|
||||
"cpu_times": {"children_system": 3.08,
|
||||
"children_user": 3.33,
|
||||
"iowait": 0.0,
|
||||
"system": 13.75,
|
||||
"user": 34.7},
|
||||
"gids": {"effective": 1000, "real": 1000, "saved": 1000},
|
||||
"io_counters": [393136128, 195969024, 0, 0, 0],
|
||||
"key": "pid",
|
||||
"memory_info": {"data": 681967616,
|
||||
"dirty": 0,
|
||||
"lib": 0,
|
||||
"rss": 443969536,
|
||||
"shared": 222199808,
|
||||
"text": 987136,
|
||||
"vms": 3721211904},
|
||||
"memory_percent": 2.7034246554842674,
|
||||
"name": "firefox",
|
||||
"nice": 0,
|
||||
"num_threads": 120,
|
||||
"pid": 793506,
|
||||
"status": "S",
|
||||
"time_since_update": 1,
|
||||
"username": "nicolargo"},
|
||||
{"cmdline": ["/snap/firefox/4336/usr/lib/firefox/firefox",
|
||||
"-contentproc",
|
||||
"-childID",
|
||||
"2",
|
||||
"-isForBrowser",
|
||||
"-prefsLen",
|
||||
"28218",
|
||||
"-prefMapSize",
|
||||
"244440",
|
||||
"-jsInitLen",
|
||||
"231800",
|
||||
"-parentBuildID",
|
||||
"20240527194810",
|
||||
"-greomni",
|
||||
"/snap/firefox/4336/usr/lib/firefox/omni.ja",
|
||||
"-appomni",
|
||||
"/snap/firefox/4336/usr/lib/firefox/browser/omni.ja",
|
||||
"-appDir",
|
||||
"/snap/firefox/4336/usr/lib/firefox/browser",
|
||||
"{bc853380-6b8f-46ad-afe0-9da5ba832e62}",
|
||||
"793506",
|
||||
"true",
|
||||
"tab"],
|
||||
"cpu_percent": 0.0,
|
||||
"cpu_times": {"children_system": 0.0,
|
||||
"children_user": 0.0,
|
||||
"iowait": 0.0,
|
||||
"system": 2.54,
|
||||
"user": 19.25},
|
||||
"gids": {"effective": 1000, "real": 1000, "saved": 1000},
|
||||
"io_counters": [1827840, 0, 0, 0, 0],
|
||||
"key": "pid",
|
||||
"memory_info": {"data": 412688384,
|
||||
"dirty": 0,
|
||||
"lib": 0,
|
||||
"rss": 440922112,
|
||||
"shared": 111878144,
|
||||
"text": 987136,
|
||||
"vms": 2946224128},
|
||||
"memory_percent": 2.684868244493684,
|
||||
"name": "Isolated Web Co",
|
||||
"nice": 0,
|
||||
"num_threads": 28,
|
||||
"pid": 793778,
|
||||
"status": "S",
|
||||
"time_since_update": 1,
|
||||
"username": "nicolargo"}]
|
||||
|
||||
Fields descriptions:
|
||||
|
||||
@ -798,7 +872,7 @@ GET psutilversion
|
||||
Get plugin stats::
|
||||
|
||||
# curl http://localhost:61208/api/4/psutilversion
|
||||
"5.9.8"
|
||||
"6.0.0"
|
||||
|
||||
GET quicklook
|
||||
-------------
|
||||
@ -806,18 +880,18 @@ GET quicklook
|
||||
Get plugin stats::
|
||||
|
||||
# curl http://localhost:61208/api/4/quicklook
|
||||
{"cpu": 0.0,
|
||||
{"cpu": 12.9,
|
||||
"cpu_hz": 4475000000.0,
|
||||
"cpu_hz_current": 1388073500.0,
|
||||
"cpu_hz_current": 1666410624.9999998,
|
||||
"cpu_log_core": 16,
|
||||
"cpu_name": "13th Gen Intel(R) Core(TM) i7-13620H",
|
||||
"cpu_phys_core": 10,
|
||||
"load": 5.8,
|
||||
"mem": 50.1,
|
||||
"load": 3.7,
|
||||
"mem": 33.6,
|
||||
"percpu": [{"cpu_number": 0,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 0.0,
|
||||
"idle": 21.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
@ -825,12 +899,12 @@ Get plugin stats::
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 100.0,
|
||||
"user": 0.0},
|
||||
"total": 79.0,
|
||||
"user": 1.0},
|
||||
{"cpu_number": 1,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 1.0,
|
||||
"idle": 23.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
@ -838,25 +912,25 @@ Get plugin stats::
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 99.0,
|
||||
"total": 77.0,
|
||||
"user": 0.0},
|
||||
{"cpu_number": 2,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 0.0,
|
||||
"idle": 18.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
"nice": 0.0,
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 100.0,
|
||||
"user": 0.0},
|
||||
"system": 1.0,
|
||||
"total": 82.0,
|
||||
"user": 5.0},
|
||||
{"cpu_number": 3,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 0.0,
|
||||
"idle": 22.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
@ -864,25 +938,25 @@ Get plugin stats::
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 100.0,
|
||||
"total": 78.0,
|
||||
"user": 0.0},
|
||||
{"cpu_number": 4,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 0.0,
|
||||
"idle": 8.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
"nice": 0.0,
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 100.0,
|
||||
"user": 0.0},
|
||||
"system": 1.0,
|
||||
"total": 92.0,
|
||||
"user": 14.0},
|
||||
{"cpu_number": 5,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 1.0,
|
||||
"idle": 23.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
@ -890,64 +964,64 @@ Get plugin stats::
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 99.0,
|
||||
"total": 77.0,
|
||||
"user": 0.0},
|
||||
{"cpu_number": 6,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 0.0,
|
||||
"iowait": 0.0,
|
||||
"idle": 3.0,
|
||||
"iowait": 1.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
"nice": 0.0,
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 100.0,
|
||||
"user": 0.0},
|
||||
"system": 4.0,
|
||||
"total": 97.0,
|
||||
"user": 15.0},
|
||||
{"cpu_number": 7,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 0.0,
|
||||
"idle": 23.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
"nice": 0.0,
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 100.0,
|
||||
"system": 1.0,
|
||||
"total": 77.0,
|
||||
"user": 0.0},
|
||||
{"cpu_number": 8,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 0.0,
|
||||
"idle": 19.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
"nice": 0.0,
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 100.0,
|
||||
"user": 0.0},
|
||||
"system": 1.0,
|
||||
"total": 81.0,
|
||||
"user": 3.0},
|
||||
{"cpu_number": 9,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 1.0,
|
||||
"iowait": 0.0,
|
||||
"idle": 22.0,
|
||||
"iowait": 1.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
"nice": 0.0,
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 99.0,
|
||||
"total": 78.0,
|
||||
"user": 0.0},
|
||||
{"cpu_number": 10,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 0.0,
|
||||
"idle": 22.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
@ -955,12 +1029,12 @@ Get plugin stats::
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 100.0,
|
||||
"total": 78.0,
|
||||
"user": 0.0},
|
||||
{"cpu_number": 11,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 1.0,
|
||||
"idle": 23.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
@ -968,25 +1042,25 @@ Get plugin stats::
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 99.0,
|
||||
"total": 77.0,
|
||||
"user": 0.0},
|
||||
{"cpu_number": 12,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 0.0,
|
||||
"idle": 21.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
"nice": 0.0,
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 100.0,
|
||||
"user": 0.0},
|
||||
"system": 1.0,
|
||||
"total": 79.0,
|
||||
"user": 1.0},
|
||||
{"cpu_number": 13,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 0.0,
|
||||
"idle": 23.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
@ -994,12 +1068,12 @@ Get plugin stats::
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 100.0,
|
||||
"total": 77.0,
|
||||
"user": 0.0},
|
||||
{"cpu_number": 14,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 0.0,
|
||||
"idle": 22.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
@ -1007,12 +1081,12 @@ Get plugin stats::
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 100.0,
|
||||
"total": 78.0,
|
||||
"user": 0.0},
|
||||
{"cpu_number": 15,
|
||||
"guest": 0.0,
|
||||
"guest_nice": 0.0,
|
||||
"idle": 0.0,
|
||||
"idle": 22.0,
|
||||
"iowait": 0.0,
|
||||
"irq": 0.0,
|
||||
"key": "cpu_number",
|
||||
@ -1020,9 +1094,9 @@ Get plugin stats::
|
||||
"softirq": 0.0,
|
||||
"steal": 0.0,
|
||||
"system": 0.0,
|
||||
"total": 100.0,
|
||||
"user": 1.0}],
|
||||
"swap": 0.0}
|
||||
"total": 78.0,
|
||||
"user": 0.0}],
|
||||
"swap": 10.7}
|
||||
|
||||
Fields descriptions:
|
||||
|
||||
@ -1060,14 +1134,14 @@ Get plugin stats::
|
||||
"label": "Ambient",
|
||||
"type": "temperature_core",
|
||||
"unit": "C",
|
||||
"value": 32,
|
||||
"value": 39,
|
||||
"warning": 0},
|
||||
{"critical": None,
|
||||
"key": "label",
|
||||
"label": "Ambient 3",
|
||||
"type": "temperature_core",
|
||||
"unit": "C",
|
||||
"value": 29,
|
||||
"value": 32,
|
||||
"warning": 0}]
|
||||
|
||||
Fields descriptions:
|
||||
@ -1128,7 +1202,7 @@ Get a specific item when field matches the given value::
|
||||
"label": "Ambient",
|
||||
"type": "temperature_core",
|
||||
"unit": "C",
|
||||
"value": 32,
|
||||
"value": 39,
|
||||
"warning": 0}]}
|
||||
|
||||
GET smart
|
||||
@ -1159,7 +1233,7 @@ Fields descriptions:
|
||||
* **platform**: Platform (32 or 64 bits) (unit is *None*)
|
||||
* **linux_distro**: Linux distribution (unit is *None*)
|
||||
* **os_version**: Operating system version (unit is *None*)
|
||||
* **hr_name**: Human readable operating sytem name (unit is *None*)
|
||||
* **hr_name**: Human readable operating system name (unit is *None*)
|
||||
|
||||
Get a specific field::
|
||||
|
||||
@ -1172,7 +1246,7 @@ GET uptime
|
||||
Get plugin stats::
|
||||
|
||||
# curl http://localhost:61208/api/4/uptime
|
||||
"7 days, 5:37:22"
|
||||
"20 days, 2:20:27"
|
||||
|
||||
GET version
|
||||
-----------
|
||||
@ -1180,7 +1254,7 @@ GET version
|
||||
Get plugin stats::
|
||||
|
||||
# curl http://localhost:61208/api/4/version
|
||||
"4.1.0_beta02"
|
||||
"4.2.0_beta01"
|
||||
|
||||
GET wifi
|
||||
--------
|
||||
@ -1189,8 +1263,8 @@ Get plugin stats::
|
||||
|
||||
# curl http://localhost:61208/api/4/wifi
|
||||
[{"key": "ssid",
|
||||
"quality_level": -52.0,
|
||||
"quality_link": 58.0,
|
||||
"quality_level": -59.0,
|
||||
"quality_link": 51.0,
|
||||
"ssid": "wlp0s20f3"}]
|
||||
|
||||
Get a specific field::
|
||||
@ -1202,8 +1276,8 @@ Get a specific item when field matches the given value::
|
||||
|
||||
# curl http://localhost:61208/api/4/wifi/ssid/wlp0s20f3
|
||||
{"wlp0s20f3": [{"key": "ssid",
|
||||
"quality_level": -52.0,
|
||||
"quality_link": 58.0,
|
||||
"quality_level": -59.0,
|
||||
"quality_link": 51.0,
|
||||
"ssid": "wlp0s20f3"}]}
|
||||
|
||||
GET all stats
|
||||
@ -1248,34 +1322,34 @@ GET stats history
|
||||
History of a plugin::
|
||||
|
||||
# curl http://localhost:61208/api/4/cpu/history
|
||||
{"system": [["2024-06-16T22:34:25.870202", 0.0],
|
||||
["2024-06-16T22:34:26.906607", 0.0],
|
||||
["2024-06-16T22:34:27.988332", 0.0]],
|
||||
"user": [["2024-06-16T22:34:25.870186", 0.0],
|
||||
["2024-06-16T22:34:26.906601", 1.0],
|
||||
["2024-06-16T22:34:27.988320", 1.0]]}
|
||||
{"system": [["2024-06-29T19:17:42.396270", 3.5],
|
||||
["2024-06-29T19:17:43.447397", 0.7],
|
||||
["2024-06-29T19:17:44.455830", 0.7]],
|
||||
"user": [["2024-06-29T19:17:42.396268", 9.4],
|
||||
["2024-06-29T19:17:43.447396", 4.0],
|
||||
["2024-06-29T19:17:44.455825", 4.0]]}
|
||||
|
||||
Limit history to last 2 values::
|
||||
|
||||
# curl http://localhost:61208/api/4/cpu/history/2
|
||||
{"system": [["2024-06-16T22:34:26.906607", 0.0],
|
||||
["2024-06-16T22:34:27.988332", 0.0]],
|
||||
"user": [["2024-06-16T22:34:26.906601", 1.0],
|
||||
["2024-06-16T22:34:27.988320", 1.0]]}
|
||||
{"system": [["2024-06-29T19:17:43.447397", 0.7],
|
||||
["2024-06-29T19:17:44.455830", 0.7]],
|
||||
"user": [["2024-06-29T19:17:43.447396", 4.0],
|
||||
["2024-06-29T19:17:44.455825", 4.0]]}
|
||||
|
||||
History for a specific field::
|
||||
|
||||
# curl http://localhost:61208/api/4/cpu/system/history
|
||||
{"system": [["2024-06-16T22:34:24.682172", 0.0],
|
||||
["2024-06-16T22:34:25.870202", 0.0],
|
||||
["2024-06-16T22:34:26.906607", 0.0],
|
||||
["2024-06-16T22:34:27.988332", 0.0]]}
|
||||
{"system": [["2024-06-29T19:17:41.318736", 3.5],
|
||||
["2024-06-29T19:17:42.396270", 3.5],
|
||||
["2024-06-29T19:17:43.447397", 0.7],
|
||||
["2024-06-29T19:17:44.455830", 0.7]]}
|
||||
|
||||
Limit history for a specific field to last 2 values::
|
||||
|
||||
# curl http://localhost:61208/api/4/cpu/system/history
|
||||
{"system": [["2024-06-16T22:34:26.906607", 0.0],
|
||||
["2024-06-16T22:34:27.988332", 0.0]]}
|
||||
{"system": [["2024-06-29T19:17:43.447397", 0.7],
|
||||
["2024-06-29T19:17:44.455830", 0.7]]}
|
||||
|
||||
GET limits (used for thresholds)
|
||||
--------------------------------
|
||||
@ -1360,6 +1434,8 @@ All limits/thresholds::
|
||||
"network": {"history_size": 1200.0,
|
||||
"network_disable": ["False"],
|
||||
"network_hide": ["docker.*", "lo"],
|
||||
"network_hide_no_ip": ["True"],
|
||||
"network_hide_no_up": ["True"],
|
||||
"network_rx_careful": 70.0,
|
||||
"network_rx_critical": 90.0,
|
||||
"network_rx_warning": 80.0,
|
||||
|
@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
||||
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
||||
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
||||
..
|
||||
.TH "GLANCES" "1" "Jun 16, 2024" "4.1.0_beta02" "Glances"
|
||||
.TH "GLANCES" "1" "Jun 29, 2024" "4.2.0_beta01" "Glances"
|
||||
.SH NAME
|
||||
glances \- An eye on your system
|
||||
.SH SYNOPSIS
|
||||
|
@ -19,7 +19,7 @@ import tracemalloc
|
||||
# Global name
|
||||
# Version should start and end with a numerical char
|
||||
# See https://packaging.python.org/specifications/core-metadata/#version
|
||||
__version__ = '4.1.0_beta02'
|
||||
__version__ = '4.2.0_beta01'
|
||||
__apiversion__ = '4'
|
||||
__author__ = 'Nicolas Hennion <nicolas@nicolargo.com>'
|
||||
__license__ = 'LGPLv3'
|
||||
@ -55,7 +55,7 @@ if psutil_version_info < psutil_min_version:
|
||||
|
||||
|
||||
def __signal_handler(signal, frame):
|
||||
logger.debug(f"Signal {signal} catched")
|
||||
logger.debug(f"Signal {signal} caught")
|
||||
end()
|
||||
|
||||
|
||||
|
@ -139,8 +139,7 @@ class Export(GlancesExport):
|
||||
if k in fields:
|
||||
tags[k] = str(fields[k])
|
||||
# Remove it from the field list (can not be a field and a tag)
|
||||
if k in fields:
|
||||
fields.pop(fields[k])
|
||||
fields.pop(k)
|
||||
# Add the measurement to the list
|
||||
ret.append({'measurement': name, 'tags': tags, 'fields': fields})
|
||||
return ret
|
||||
@ -157,7 +156,7 @@ class Export(GlancesExport):
|
||||
try:
|
||||
self.client.write_points(self._normalize(name, columns, points), time_precision="s")
|
||||
except Exception as e:
|
||||
# Log level set to debug instead of error (see: issue #1561)
|
||||
logger.debug(f"Cannot export {name} stats to InfluxDB ({e})")
|
||||
# Log level set to warning instead of error (see: issue #1561)
|
||||
logger.warning(f"Cannot export {name} stats to InfluxDB ({e})")
|
||||
else:
|
||||
logger.debug(f"Export {name} stats to InfluxDB")
|
||||
|
@ -147,8 +147,7 @@ class Export(GlancesExport):
|
||||
if k in fields:
|
||||
tags[k] = str(fields[k])
|
||||
# Remove it from the field list (can not be a field and a tag)
|
||||
if k in fields:
|
||||
fields.pop(fields[k])
|
||||
fields.pop(k)
|
||||
# Add the measurement to the list
|
||||
ret.append({'measurement': name, 'tags': tags, 'fields': fields})
|
||||
return ret
|
||||
@ -165,7 +164,7 @@ class Export(GlancesExport):
|
||||
try:
|
||||
self.client.write(self.bucket, self.org, self._normalize(name, columns, points), time_precision="s")
|
||||
except Exception as e:
|
||||
# Log level set to debug instead of error (see: issue #1561)
|
||||
logger.debug(f"Cannot export {name} stats to InfluxDB ({e})")
|
||||
# Log level set to warning instead of error (see: issue #1561)
|
||||
logger.warning(f"Cannot export {name} stats to InfluxDB ({e})")
|
||||
else:
|
||||
logger.debug(f"Export {name} stats to InfluxDB")
|
||||
|
@ -89,7 +89,7 @@ def printandflush(string):
|
||||
|
||||
def to_ascii(s):
|
||||
"""Convert the bytes string to a ASCII string
|
||||
Usefull to remove accent (diacritics)"""
|
||||
Useful to remove accent (diacritics)"""
|
||||
if isinstance(s, binary_type):
|
||||
return s.decode()
|
||||
return s.encode('ascii', 'ignore').decode()
|
||||
@ -153,7 +153,7 @@ def subsample(data, sampling):
|
||||
|
||||
Data should be a list of numerical itervalues
|
||||
|
||||
Return a subsampled list of sampling lenght
|
||||
Return a subsampled list of sampling length
|
||||
"""
|
||||
if len(data) <= sampling:
|
||||
return data
|
||||
@ -216,13 +216,13 @@ def key_exist_value_not_none(k, d):
|
||||
return k in d and d[k] is not None
|
||||
|
||||
|
||||
def key_exist_value_not_none_not_v(k, d, value='', lengh=None):
|
||||
def key_exist_value_not_none_not_v(k, d, value='', length=None):
|
||||
# Return True if:
|
||||
# - key k exists
|
||||
# - d[k] is not None
|
||||
# - d[k] != value
|
||||
# - if lengh is not None and len(d[k]) >= lengh
|
||||
return k in d and d[k] is not None and d[k] != value and (lengh is None or len(d[k]) >= lengh)
|
||||
# - if length is not None and len(d[k]) >= length
|
||||
return k in d and d[k] is not None and d[k] != value and (length is None or len(d[k]) >= length)
|
||||
|
||||
|
||||
def disable(class_name, var):
|
||||
@ -425,12 +425,12 @@ def weak_lru_cache(maxsize=128, typed=False):
|
||||
|
||||
|
||||
def namedtuple_to_dict(data):
|
||||
"""Convert a namedtuple to a dict, using the _asdict() method embeded in PsUtil stats."""
|
||||
"""Convert a namedtuple to a dict, using the _asdict() method embedded in PsUtil stats."""
|
||||
return {k: (v._asdict() if hasattr(v, '_asdict') else v) for k, v in data.items()}
|
||||
|
||||
|
||||
def list_of_namedtuple_to_list_of_dict(data):
|
||||
"""Convert a list of namedtuples to a dict, using the _asdict() method embeded in PsUtil stats."""
|
||||
"""Convert a list of namedtuples to a dict, using the _asdict() method embedded in PsUtil stats."""
|
||||
return [namedtuple_to_dict(d) for d in data]
|
||||
|
||||
|
||||
|
@ -1211,7 +1211,7 @@ def build_colors_list(args):
|
||||
curses.init_pair(5, curses.COLOR_MAGENTA, -1)
|
||||
else:
|
||||
curses.init_pair(2, -1, curses.COLOR_RED)
|
||||
curses.init_pair(3, -1, curses.COLOR_GREEN)
|
||||
curses.init_pair(3, 0, curses.COLOR_GREEN)
|
||||
curses.init_pair(5, -1, curses.COLOR_MAGENTA)
|
||||
curses.init_pair(4, curses.COLOR_BLUE, -1)
|
||||
curses.init_pair(6, curses.COLOR_RED, -1)
|
||||
|
@ -11,7 +11,7 @@ It should implement a Class named PluginModel (inherited from GlancesPluginModel
|
||||
This class should be based on the MVC model.
|
||||
- model: where the stats are updated (update method)
|
||||
- view: where the stats are prepare to be displayed (update_views)
|
||||
- controler: where the stats are displayed (msg_curse method)
|
||||
- controller: where the stats are displayed (msg_curse method)
|
||||
|
||||
A plugin should define the following global variables:
|
||||
|
||||
|
@ -8,12 +8,14 @@
|
||||
|
||||
"""Containers plugin."""
|
||||
|
||||
import os
|
||||
from copy import deepcopy
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from glances.globals import iteritems, itervalues
|
||||
from glances.logger import logger
|
||||
from glances.plugins.containers.engines.docker import DockerContainersExtension, import_docker_error_tag
|
||||
from glances.plugins.containers.engines.podman import PodmanContainersExtension, import_podman_error_tag
|
||||
from glances.plugins.containers.engines import ContainersExtension
|
||||
from glances.plugins.containers.engines.docker import DockerExtension, import_docker_error_tag
|
||||
from glances.plugins.containers.engines.podman import PodmanExtension, import_podman_error_tag
|
||||
from glances.plugins.plugin.model import GlancesPluginModel
|
||||
from glances.processes import glances_processes
|
||||
from glances.processes import sort_stats as sort_stats_processes
|
||||
@ -139,14 +141,15 @@ class PluginModel(GlancesPluginModel):
|
||||
# We want to display the stat in the curse interface
|
||||
self.display_curse = True
|
||||
|
||||
self.watchers: Dict[str, ContainersExtension] = {}
|
||||
|
||||
# Init the Docker API
|
||||
self.docker_extension = DockerContainersExtension() if not import_docker_error_tag else None
|
||||
if not import_docker_error_tag:
|
||||
self.watchers['docker'] = DockerExtension()
|
||||
|
||||
# Init the Podman API
|
||||
if import_podman_error_tag:
|
||||
self.podman_extension = None
|
||||
else:
|
||||
self.podman_extension = PodmanContainersExtension(podman_sock=self._podman_sock())
|
||||
if not import_podman_error_tag:
|
||||
self.watchers['podman'] = PodmanExtension(podman_sock=self._podman_sock())
|
||||
|
||||
# Sort key
|
||||
self.sort_key = None
|
||||
@ -155,7 +158,7 @@ class PluginModel(GlancesPluginModel):
|
||||
self.update()
|
||||
self.refresh_timer.set(0)
|
||||
|
||||
def _podman_sock(self):
|
||||
def _podman_sock(self) -> str:
|
||||
"""Return the podman sock.
|
||||
Could be desfined in the [docker] section thanks to the podman_sock option.
|
||||
Default value: unix:///run/user/1000/podman/podman.sock
|
||||
@ -165,20 +168,19 @@ class PluginModel(GlancesPluginModel):
|
||||
return "unix:///run/user/1000/podman/podman.sock"
|
||||
return conf_podman_sock[0]
|
||||
|
||||
def exit(self):
|
||||
def exit(self) -> None:
|
||||
"""Overwrite the exit method to close threads."""
|
||||
if self.docker_extension:
|
||||
self.docker_extension.stop()
|
||||
if self.podman_extension:
|
||||
self.podman_extension.stop()
|
||||
for watcher in itervalues(self.watchers):
|
||||
watcher.stop()
|
||||
|
||||
# Call the father class
|
||||
super().exit()
|
||||
|
||||
def get_key(self):
|
||||
def get_key(self) -> str:
|
||||
"""Return the key of the list."""
|
||||
return 'name'
|
||||
|
||||
def get_export(self):
|
||||
def get_export(self) -> List[Dict]:
|
||||
"""Overwrite the default export method.
|
||||
|
||||
- Only exports containers
|
||||
@ -197,7 +199,7 @@ class PluginModel(GlancesPluginModel):
|
||||
|
||||
return ret
|
||||
|
||||
def _all_tag(self):
|
||||
def _all_tag(self) -> bool:
|
||||
"""Return the all tag of the Glances/Docker configuration file.
|
||||
|
||||
# By default, Glances only display running containers
|
||||
@ -211,52 +213,35 @@ class PluginModel(GlancesPluginModel):
|
||||
|
||||
@GlancesPluginModel._check_decorator
|
||||
@GlancesPluginModel._log_result_decorator
|
||||
def update(self):
|
||||
def update(self) -> List[Dict]:
|
||||
"""Update Docker and podman stats using the input method."""
|
||||
# Connection should be ok
|
||||
if self.docker_extension is None and self.podman_extension is None:
|
||||
if not self.watchers:
|
||||
return self.get_init_value()
|
||||
|
||||
if self.input_method == 'local':
|
||||
# Update stats
|
||||
stats_docker = self.update_docker() if self.docker_extension else {}
|
||||
stats_podman = self.update_podman() if self.podman_extension else {}
|
||||
stats = stats_docker.get('containers', []) + stats_podman.get('containers', [])
|
||||
elif self.input_method == 'snmp':
|
||||
# Update stats using SNMP
|
||||
# Not available
|
||||
pass
|
||||
if self.input_method != 'local':
|
||||
return self.get_init_value()
|
||||
|
||||
# Update stats
|
||||
stats = []
|
||||
for engine, watcher in iteritems(self.watchers):
|
||||
version, containers = watcher.update(all_tag=self._all_tag())
|
||||
for container in containers:
|
||||
container["engine"] = 'docker'
|
||||
stats.extend(containers)
|
||||
|
||||
# Sort and update the stats
|
||||
# @TODO: Have a look because sort did not work for the moment (need memory stats ?)
|
||||
self.sort_key, self.stats = sort_docker_stats(stats)
|
||||
|
||||
return self.stats
|
||||
|
||||
def update_docker(self):
|
||||
"""Update Docker stats using the input method."""
|
||||
version, containers = self.docker_extension.update(all_tag=self._all_tag())
|
||||
for container in containers:
|
||||
container["engine"] = 'docker'
|
||||
return {"version": version, "containers": containers}
|
||||
|
||||
def update_podman(self):
|
||||
"""Update Podman stats."""
|
||||
version, containers = self.podman_extension.update(all_tag=self._all_tag())
|
||||
for container in containers:
|
||||
container["engine"] = 'podman'
|
||||
return {"version": version, "containers": containers}
|
||||
|
||||
def get_user_ticks(self):
|
||||
"""Return the user ticks by reading the environment variable."""
|
||||
return os.sysconf(os.sysconf_names['SC_CLK_TCK'])
|
||||
|
||||
def memory_usage_no_cache(self, mem):
|
||||
@staticmethod
|
||||
def memory_usage_no_cache(mem: Dict[str, float]) -> float:
|
||||
"""Return the 'real' memory usage by removing inactive_file to usage"""
|
||||
# Ref: https://github.com/docker/docker-py/issues/3210
|
||||
return mem['usage'] - (mem['inactive_file'] if 'inactive_file' in mem else 0)
|
||||
|
||||
def update_views(self):
|
||||
def update_views(self) -> bool:
|
||||
"""Update stats views."""
|
||||
# Call the father's method
|
||||
super().update_views()
|
||||
@ -305,7 +290,7 @@ class PluginModel(GlancesPluginModel):
|
||||
|
||||
return True
|
||||
|
||||
def msg_curse(self, args=None, max_width=None):
|
||||
def msg_curse(self, args=None, max_width: Optional[int] = None) -> List[str]:
|
||||
"""Return the dict to display in the curse interface."""
|
||||
# Init the return message
|
||||
ret = []
|
||||
@ -369,7 +354,9 @@ class PluginModel(GlancesPluginModel):
|
||||
if self.views['show_pod_name']:
|
||||
ret.append(self.curse_add_line(' {:{width}}'.format(container.get("pod_id", "-"), width=12)))
|
||||
# Name
|
||||
ret.append(self.curse_add_line(self._msg_name(container=container, max_width=name_max_width)))
|
||||
ret.append(
|
||||
self.curse_add_line(' {:{width}}'.format(container['name'][:name_max_width], width=name_max_width))
|
||||
)
|
||||
# Status
|
||||
status = self.container_alert(container['status'])
|
||||
msg = '{:>10}'.format(container['status'][0:10])
|
||||
@ -441,12 +428,8 @@ class PluginModel(GlancesPluginModel):
|
||||
|
||||
return ret
|
||||
|
||||
def _msg_name(self, container, max_width):
|
||||
"""Build the container name."""
|
||||
name = container['name'][:max_width]
|
||||
return ' {:{width}}'.format(name, width=max_width)
|
||||
|
||||
def container_alert(self, status):
|
||||
@staticmethod
|
||||
def container_alert(status: str) -> str:
|
||||
"""Analyse the container status."""
|
||||
if status == 'running':
|
||||
return 'OK'
|
||||
@ -457,7 +440,7 @@ class PluginModel(GlancesPluginModel):
|
||||
return 'CAREFUL'
|
||||
|
||||
|
||||
def sort_docker_stats(stats):
|
||||
def sort_docker_stats(stats: List[Dict[str, Any]]) -> Tuple[str, List[Dict[str, Any]]]:
|
||||
# Sort Docker stats using the same function than processes
|
||||
sort_by = glances_processes.sort_key
|
||||
sort_by_secondary = 'memory_usage'
|
||||
|
@ -0,0 +1,9 @@
|
||||
from typing import Any, Dict, Protocol, Tuple
|
||||
|
||||
|
||||
class ContainersExtension(Protocol):
|
||||
def stop(self) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
def update(self, all_tag) -> Tuple[Dict, list[Dict[str, Any]]]:
|
||||
raise NotImplementedError
|
@ -207,7 +207,7 @@ class DockerStatsFetcher:
|
||||
return stats
|
||||
|
||||
|
||||
class DockerContainersExtension:
|
||||
class DockerExtension:
|
||||
"""Glances' Containers Plugin's Docker Extension unit"""
|
||||
|
||||
CONTAINER_ACTIVE_STATUS = ['running', 'paused']
|
||||
|
@ -243,7 +243,7 @@ class PodmanPodStatsFetcher:
|
||||
return {"ior": ior, "iow": iow, "time_since_update": 1}
|
||||
|
||||
|
||||
class PodmanContainersExtension:
|
||||
class PodmanExtension:
|
||||
"""Glances' Containers Plugin's Docker Extension unit"""
|
||||
|
||||
CONTAINER_ACTIVE_STATUS = ['running', 'paused']
|
||||
|
@ -98,7 +98,7 @@ class GlancesPluginModel:
|
||||
logger.debug(f'Load section {self.plugin_name} in Glances configuration file')
|
||||
self.load_limits(config=config)
|
||||
|
||||
# Init the alias (dictionnary)
|
||||
# Init the alias (dictionary)
|
||||
self.alias = self.read_alias()
|
||||
|
||||
# Init the actions
|
||||
|
@ -543,7 +543,7 @@ class PluginModel(GlancesPluginModel):
|
||||
# Process list
|
||||
# Loop over processes (sorted by the sort key previously compute)
|
||||
# This is a Glances bottleneck (see flame graph),
|
||||
# TODO: get_process_curses_data should be optimzed
|
||||
# TODO: get_process_curses_data should be optimized
|
||||
for position, process in enumerate(processes_list_sorted):
|
||||
ret.extend(self.get_process_curses_data(process, position == args.cursor_position, args))
|
||||
|
||||
|
@ -48,7 +48,7 @@ fields_description = {
|
||||
'description': 'Operating system version',
|
||||
},
|
||||
'hr_name': {
|
||||
'description': 'Human readable operating sytem name',
|
||||
'description': 'Human readable operating system name',
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
"""Wifi plugin.
|
||||
|
||||
Stats are retreived from the /proc/net/wireless file (Linux only):
|
||||
Stats are retrieved from the /proc/net/wireless file (Linux only):
|
||||
|
||||
# cat /proc/net/wireless
|
||||
Inter-| sta-| Quality | Discarded packets | Missed | WE
|
||||
|
@ -293,7 +293,7 @@ class GlancesProcesses:
|
||||
# - connections (TCP and UDP)
|
||||
# - CPU min/max/mean
|
||||
|
||||
# Set the extended stats list (OS dependant)
|
||||
# Set the extended stats list (OS dependent)
|
||||
extended_stats = ['cpu_affinity', 'ionice', 'num_ctx_switches']
|
||||
if LINUX:
|
||||
# num_fds only available on Unix system (see issue #1351)
|
||||
@ -418,7 +418,7 @@ class GlancesProcesses:
|
||||
#####################
|
||||
sorted_attrs = ['cpu_percent', 'cpu_times', 'memory_percent', 'name', 'status', 'num_threads']
|
||||
displayed_attr = ['memory_info', 'nice', 'pid']
|
||||
# The following attributes are cached and only retreive every self.cache_timeout seconds
|
||||
# The following attributes are cached and only retrieve every self.cache_timeout seconds
|
||||
# Warning: 'name' can not be cached because it is used for filtering
|
||||
cached_attrs = ['cmdline', 'username']
|
||||
|
||||
@ -454,7 +454,7 @@ class GlancesProcesses:
|
||||
)
|
||||
# Only get the info key
|
||||
# PsUtil 6+ no longer check PID reused #2755 so use is_running in the loop
|
||||
# Note: not sure it is realy needed but CPU consumption look teh same with or without it
|
||||
# Note: not sure it is realy needed but CPU consumption look the same with or without it
|
||||
processlist = [p.info for p in processlist if p.is_running()]
|
||||
# Sort the processes list by the current sort_key
|
||||
processlist = sort_stats(processlist, sorted_by=self.sort_key, reverse=True)
|
||||
|
@ -136,7 +136,7 @@ class GlancesStats:
|
||||
"""Load additional plugins if defined"""
|
||||
|
||||
def get_addl_plugins(self, plugin_path):
|
||||
"""Get list of additonal plugins"""
|
||||
"""Get list of additional plugins"""
|
||||
_plugin_list = []
|
||||
for plugin in os.listdir(plugin_path):
|
||||
path = os.path.join(plugin_path, plugin)
|
||||
@ -167,7 +167,7 @@ class GlancesStats:
|
||||
sys.path.insert(0, path)
|
||||
for plugin in get_addl_plugins(self, path):
|
||||
if plugin in sys.modules:
|
||||
logger.warn(f"Pugin {plugin} already in sys.modules, skipping (workaround: rename plugin)")
|
||||
logger.warn(f"Plugin {plugin} already in sys.modules, skipping (workaround: rename plugin)")
|
||||
else:
|
||||
start_duration.reset()
|
||||
try:
|
||||
|
@ -36,3 +36,4 @@ sparklines
|
||||
statsd
|
||||
uvicorn
|
||||
zeroconf==0.131.0 # Waiting correction for ARMv7: https://github.com/python-zeroconf/python-zeroconf/issues/1372
|
||||
anyio>=4.4.0 # not directly required, pinned by Snyk to avoid a vulnerability
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: glances
|
||||
version: '4.0.8+build2'
|
||||
version: '4.1.1+build01' # Put the current stable version+buildXX
|
||||
|
||||
summary: Glances an Eye on your system. A top/htop alternative.
|
||||
description: |
|
||||
|
Loading…
Reference in New Issue
Block a user