Merge from develop

This commit is contained in:
nicolargo 2022-05-29 13:04:58 +02:00
commit d149a2f3a4
16 changed files with 362 additions and 353 deletions

View File

@ -45,44 +45,41 @@ docs-server: docs
webui: venv-dev
cd glances/outputs/static/ && npm ci && npm run build
run: venv
run:
./venv/bin/python -m glances -C ./conf/glances.conf
run-debug: venv
run-debug:
./venv/bin/python -m glances -C ./conf/glances.conf -d
run-webserver: venv
run-webserver:
./venv/bin/python -m glances -C ./conf/glances.conf -w
run-restapiserver: venv
run-restapiserver:
./venv/bin/python -m glances -C ./conf/glances.conf -w --disable-webui
run-server: venv
run-server:
./venv/bin/python -m glances -C ./conf/glances.conf -s
run-client: venv
run-client:
./venv/bin/python -m glances -C ./conf/glances.conf -c localhost
run-browser: venv
run-browser:
./venv/bin/python -m glances -C ./conf/glances.conf --browser
run-export-influxdb: venv
./venv/bin/python -m glances -C ./conf/glances.conf --export influxdb
show-version: venv
show-version:
./venv/bin/python -m glances -C ./conf/glances.conf -V
show-issue: venv
show-issue:
./venv/bin/python -m glances -C ./conf/glances.conf --issue
profiling: venv venv-dev
profiling:
@echo "Please complete and run: sudo ./venv/bin/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s --pid <GLANCES PID>"
trace-malloc: venv
trace-malloc:
@echo "Malloc test is running, please wait ~30 secondes..."
./venv/bin/python -m glances -C ./conf/glances.conf --trace-malloc --stop-after 15 --quiet
memory-leak: venv
memory-leak:
./venv/bin/python -m glances -C ./conf/glances.conf --memory-leak
release-note:

View File

@ -59,7 +59,7 @@ Social networks
.. image:: https://raw.githubusercontent.com/nicolargo/glances/develop/docs/_static/twitter-icon.png
:target: https://twitter.com/nicolargo
.. image:: https://raw.githubusercontent.com/nicolargo/glances/develop/docs/_static/reddit.png
:target: https://www.reddit.com/r/glances/
@ -205,7 +205,7 @@ Available versions on the Docker Hub repository:
- *nicolargo/glances:latest-full* for a full Debian Glances image version with all dependencies
- *nicolargo/glances:alpine-latest-full* for a full Alpine Glances image version with all dependencies
You can also specify a version by replacing latest by 3.2.3 (for example).
You can also specify a version by replacing latest by 3.2.6.3 (for example).
Run last version of Glances container in *console mode*:
@ -219,15 +219,15 @@ create your own Dockerfile:
.. code-block:: console
FROM nicolargo/glances:latest
COPY glances.conf /glances/conf/glances.conf
CMD python -m glances -C /glances/conf/glances.conf $GLANCES_OPT
COPY glances.conf /etc/glances.conf
CMD python -m glances -C /etc/glances.conf $GLANCES_OPT
Alternatively, you can specify something along the same lines with
docker run options:
.. code-block:: console
docker run -v `pwd`/glances.conf:/glances/conf/glances.conf -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host -it nicolargo/glances:latest-full
docker run -v `pwd`/glances.conf:/etc/glances.conf -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host -it nicolargo/glances:latest-full
Where \`pwd\`/glances.conf is a local directory containing your glances.conf file.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 107 KiB

View File

@ -60,6 +60,25 @@ Get the plugins list::
"uptime",
"wifi"]
GET alert
---------
Get plugin stats::
# curl http://localhost:61208/api/3/alert
[[1653511582.0,
-1,
"WARNING",
"MEM",
81.37629268155027,
81.37629268155027,
81.37629268155027,
81.37629268155027,
1,
[],
"",
"memory_percent"]]
GET amps
--------
@ -74,7 +93,7 @@ Get plugin stats::
"refresh": 3.0,
"regex": True,
"result": None,
"timer": 0.752385139465332},
"timer": 1.2215237617492676},
{"count": 0,
"countmax": 20.0,
"countmin": None,
@ -83,7 +102,7 @@ Get plugin stats::
"refresh": 3.0,
"regex": True,
"result": None,
"timer": 0.7522008419036865}]
"timer": 1.2214140892028809}]
Get a specific field::
@ -101,7 +120,7 @@ Get a specific item when field matchs the given value::
"refresh": 3.0,
"regex": True,
"result": None,
"timer": 0.752385139465332}]}
"timer": 1.2215237617492676}]}
GET core
--------
@ -131,19 +150,19 @@ Get plugin stats::
"ctx_switches": 0,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 62.1,
"idle": 68.6,
"interrupts": 0,
"iowait": 0.0,
"iowait": 0.1,
"irq": 0.0,
"nice": 0.0,
"soft_interrupts": 0,
"softirq": 0.0,
"steal": 0.0,
"syscalls": 0,
"system": 7.0,
"system": 4.3,
"time_since_update": 1,
"total": 39.6,
"user": 30.8}
"total": 35.6,
"user": 27.0}
Fields descriptions:
@ -165,7 +184,7 @@ Fields descriptions:
Get a specific field::
# curl http://localhost:61208/api/3/cpu/total
{"total": 39.6}
{"total": 35.6}
GET diskio
----------
@ -220,7 +239,7 @@ Get plugin stats::
"io_r": None,
"io_w": None,
"key": "name",
"memory_usage": 33189888,
"memory_usage": 35647488,
"name": "telegraf",
"network_rx": None,
"network_tx": None},
@ -246,13 +265,13 @@ Get plugin stats::
# curl http://localhost:61208/api/3/fs
[{"device_name": "/dev/mapper/ubuntu--gnome--vg-root",
"free": 99621335040,
"free": 99862933504,
"fs_type": "ext4",
"key": "mnt_point",
"mnt_point": "/",
"percent": 56.9,
"percent": 56.8,
"size": 243396149248,
"used": 131387359232}]
"used": 131145760768}]
Get a specific field::
@ -263,13 +282,13 @@ Get a specific item when field matchs the given value::
# curl http://localhost:61208/api/3/fs/mnt_point//
{"/": [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root",
"free": 99621335040,
"free": 99862933504,
"fs_type": "ext4",
"key": "mnt_point",
"mnt_point": "/",
"percent": 56.9,
"percent": 56.8,
"size": 243396149248,
"used": 131387359232}]}
"used": 131145760768}]}
GET ip
------
@ -277,16 +296,16 @@ GET ip
Get plugin stats::
# curl http://localhost:61208/api/3/ip
{"address": "192.168.0.49",
{"address": "192.168.0.33",
"gateway": "192.168.0.254",
"mask": "255.255.255.0",
"mask_cidr": 24,
"public_address": "82.66.169.82"}
"public_address": "91.166.228.228"}
Get a specific field::
# curl http://localhost:61208/api/3/ip/address
{"address": "192.168.0.49"}
{"address": "192.168.0.33"}
GET load
--------
@ -294,10 +313,7 @@ GET load
Get plugin stats::
# curl http://localhost:61208/api/3/load
{"cpucore": 4,
"min1": 1.09228515625,
"min15": 0.95849609375,
"min5": 1.00048828125}
{"cpucore": 4, "min1": 1.7607421875, "min15": 0.787109375, "min5": 1.0986328125}
Fields descriptions:
@ -309,7 +325,7 @@ Fields descriptions:
Get a specific field::
# curl http://localhost:61208/api/3/load/min1
{"min1": 1.09228515625}
{"min1": 1.7607421875}
GET mem
-------
@ -317,16 +333,16 @@ GET mem
Get plugin stats::
# curl http://localhost:61208/api/3/mem
{"active": 3533307904,
"available": 3111428096,
"buffers": 323248128,
"cached": 3250700288,
"free": 3111428096,
"inactive": 2721816576,
"percent": 60.3,
"shared": 543281152,
{"active": 2994515968,
"available": 1459716096,
"buffers": 120791040,
"cached": 2113867776,
"free": 1459716096,
"inactive": 3645423616,
"percent": 81.4,
"shared": 646406144,
"total": 7837945856,
"used": 4726517760}
"used": 6378229760}
Fields descriptions:
@ -353,13 +369,13 @@ GET memswap
Get plugin stats::
# curl http://localhost:61208/api/3/memswap
{"free": 6209282048,
"percent": 23.2,
"sin": 732037120,
"sout": 2645266432,
{"free": 6304215040,
"percent": 22.0,
"sin": 1377947648,
"sout": 3402825728,
"time_since_update": 1,
"total": 8082419712,
"used": 1873137664}
"used": 1778204672}
Fields descriptions:
@ -383,29 +399,29 @@ Get plugin stats::
# curl http://localhost:61208/api/3/network
[{"alias": None,
"cumulative_cx": 162243466,
"cumulative_rx": 81121733,
"cumulative_tx": 81121733,
"cx": 2556,
"cumulative_cx": 473925792,
"cumulative_rx": 236962896,
"cumulative_tx": 236962896,
"cx": 4156,
"interface_name": "lo",
"is_up": True,
"key": "interface_name",
"rx": 1278,
"rx": 2078,
"speed": 0,
"time_since_update": 1,
"tx": 1278},
"tx": 2078},
{"alias": None,
"cumulative_cx": 4744271709,
"cumulative_rx": 4464070610,
"cumulative_tx": 280201099,
"cx": 26523,
"cumulative_cx": 5365392428,
"cumulative_rx": 5016373584,
"cumulative_tx": 349018844,
"cx": 34101,
"interface_name": "wlp2s0",
"is_up": True,
"key": "interface_name",
"rx": 20315,
"rx": 23539,
"speed": 0,
"time_since_update": 1,
"tx": 6208}]
"tx": 10562}]
Fields descriptions:
@ -437,17 +453,17 @@ Get a specific item when field matchs the given value::
# curl http://localhost:61208/api/3/network/interface_name/lo
{"lo": [{"alias": None,
"cumulative_cx": 162243466,
"cumulative_rx": 81121733,
"cumulative_tx": 81121733,
"cx": 2556,
"cumulative_cx": 473925792,
"cumulative_rx": 236962896,
"cumulative_tx": 236962896,
"cx": 4156,
"interface_name": "lo",
"is_up": True,
"key": "interface_name",
"rx": 1278,
"rx": 2078,
"speed": 0,
"time_since_update": 1,
"tx": 1278}]}
"tx": 2078}]}
GET now
-------
@ -455,7 +471,7 @@ GET now
Get plugin stats::
# curl http://localhost:61208/api/3/now
"2022-05-24 12:02:07 CEST"
"2022-05-25 22:46:22 CEST"
GET percpu
----------
@ -466,29 +482,29 @@ Get plugin stats::
[{"cpu_number": 0,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 57.0,
"idle": 56.9,
"iowait": 0.0,
"irq": 0.0,
"key": "cpu_number",
"nice": 0.0,
"softirq": 0.0,
"steal": 0.0,
"system": 7.0,
"total": 43.0,
"user": 26.0},
"system": 4.6,
"total": 43.1,
"user": 38.5},
{"cpu_number": 1,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 68.0,
"idle": 73.8,
"iowait": 0.0,
"irq": 0.0,
"key": "cpu_number",
"nice": 0.0,
"softirq": 0.0,
"steal": 0.0,
"system": 6.0,
"total": 32.0,
"user": 17.0}]
"system": 4.6,
"total": 26.2,
"user": 21.5}]
Get a specific field::
@ -507,7 +523,7 @@ Get plugin stats::
"port": 0,
"refresh": 30,
"rtt_warning": None,
"status": 0.004532,
"status": 0.011961,
"timeout": 3}]
Get a specific field::
@ -524,7 +540,7 @@ Get a specific item when field matchs the given value::
"port": 0,
"refresh": 30,
"rtt_warning": None,
"status": 0.004532,
"status": 0.011961,
"timeout": 3}]}
GET processcount
@ -533,12 +549,12 @@ GET processcount
Get plugin stats::
# curl http://localhost:61208/api/3/processcount
{"pid_max": 0, "running": 1, "sleeping": 255, "thread": 1394, "total": 320}
{"pid_max": 0, "running": 1, "sleeping": 269, "thread": 1530, "total": 335}
Get a specific field::
# curl http://localhost:61208/api/3/processcount/total
{"total": 320}
{"total": 335}
GET processlist
---------------
@ -548,15 +564,15 @@ Get plugin stats::
# curl http://localhost:61208/api/3/processlist
[{"cmdline": ["/snap/firefox/1300/usr/lib/firefox/firefox"],
"cpu_percent": 0.0,
"cpu_times": pcputimes(user=4191.85, system=1588.46, children_user=3119.18, children_system=692.52, iowait=0.0),
"cpu_times": pcputimes(user=7265.13, system=2644.4, children_user=4225.08, children_system=934.33, iowait=0.0),
"gids": pgids(real=1000, effective=1000, saved=1000),
"io_counters": [1992798208, 5691990016, 0, 0, 0],
"io_counters": [2597592064, 8660602880, 0, 0, 0],
"key": "pid",
"memory_info": pmem(rss=459440128, vms=13888520192, shared=139042816, text=643072, lib=0, data=1830445056, dirty=0),
"memory_percent": 5.861741538419732,
"memory_info": pmem(rss=521797632, vms=14051770368, shared=142577664, text=643072, lib=0, data=1934319616, dirty=0),
"memory_percent": 6.657326314656288,
"name": "firefox",
"nice": 0,
"num_threads": 153,
"num_threads": 165,
"pid": 10259,
"ppid": 2922,
"status": "S",
@ -581,12 +597,12 @@ Get plugin stats::
"true",
"tab"],
"cpu_percent": 0.0,
"cpu_times": pcputimes(user=1055.29, system=197.09, children_user=0.0, children_system=0.0, iowait=0.0),
"cpu_times": pcputimes(user=1572.98, system=303.12, children_user=0.0, children_system=0.0, iowait=0.0),
"gids": pgids(real=1000, effective=1000, saved=1000),
"io_counters": [122664960, 0, 0, 0, 0],
"io_counters": [157250560, 0, 0, 0, 0],
"key": "pid",
"memory_info": pmem(rss=361443328, vms=3296440320, shared=56553472, text=643072, lib=0, data=714555392, dirty=0),
"memory_percent": 4.611454769406358,
"memory_info": pmem(rss=498479104, vms=3363688448, shared=77520896, text=643072, lib=0, data=767954944, dirty=0),
"memory_percent": 6.359818161009762,
"name": "WebExtensions",
"nice": 0,
"num_threads": 20,
@ -601,169 +617,183 @@ Get a specific field::
# curl http://localhost:61208/api/3/processlist/pid
{"pid": [10259,
10790,
271153,
271200,
10854,
20979,
10850,
21025,
21227,
10854,
2922,
21227,
271409,
21025,
240874,
62372,
186149,
308697,
10857,
271083,
271184,
10814,
20905,
21039,
216634,
308943,
309130,
306581,
271118,
12436,
216880,
216694,
217080,
185769,
52875,
176018,
217078,
2820,
337,
20947,
2033,
186877,
138834,
309195,
306584,
309267,
271247,
271208,
3251,
21107,
211759,
309448,
337,
2820,
271397,
52875,
243846,
2033,
234429,
271140,
3279,
138954,
11390,
265539,
138989,
3161,
1166,
138834,
271089,
266251,
2505,
3019,
271088,
1302,
186877,
2109,
3161,
186878,
10597,
3279,
20965,
1302,
21063,
183662,
2790,
2109,
21229,
3066,
3347,
8716,
2999,
1133,
3056,
3065,
304566,
3706,
2867,
3227,
183682,
1601,
8716,
20965,
3347,
3066,
1133,
2999,
232395,
3056,
21229,
3065,
3206,
8715,
1601,
1,
3259,
2081,
1150,
3085,
2964,
3381,
1147,
2990,
2073,
2964,
3259,
3227,
3085,
232398,
2867,
1150,
3064,
2073,
3381,
218290,
1313,
2900,
2081,
1990,
183686,
1176,
2505,
20916,
20917,
989,
3058,
20932,
144959,
3178,
1147,
1176,
3077,
2769,
3062,
2781,
2769,
2933,
3058,
989,
3178,
20917,
20916,
3004,
8959,
3068,
1271,
2933,
271268,
2831,
3068,
8959,
1271,
8941,
1310,
1173,
216822,
1596,
2971,
3084,
1132,
3268,
10906,
2794,
1115,
1151,
3034,
3260,
3136,
2800,
2944,
3129,
2798,
2923,
3079,
3232,
3059,
1139,
3075,
241702,
1173,
2794,
12458,
1310,
1132,
2800,
1115,
2971,
2798,
1596,
3268,
1151,
2960,
3084,
3136,
3260,
3129,
3059,
2923,
2944,
3232,
3079,
1139,
1171,
138811,
3075,
1167,
3074,
3046,
2888,
24865,
2977,
3046,
138968,
2888,
2949,
1161,
2960,
3226,
1161,
24865,
138923,
3054,
381,
2828,
2788,
271091,
2079,
2828,
990,
138811,
2788,
1127,
2868,
234438,
1156,
2789,
138923,
138968,
2805,
2789,
2080,
2988,
2931,
381,
1123,
1142,
211922,
2931,
2508,
21141,
1178,
1429,
135946,
21209,
1178,
988,
1130,
21209,
8757,
217061,
266415,
309432,
997,
1183,
271104,
996,
1996,
3274,
@ -773,24 +803,23 @@ Get a specific field::
1116,
138788,
138767,
2782,
138752,
306441,
138731,
217077,
138901,
309447,
1914,
138774,
138745,
2782,
138724,
3053,
2012,
20932,
2020,
1186,
1997,
2001,
1186,
138894,
20919,
2001,
2,
3,
4,
@ -900,46 +929,48 @@ Get a specific field::
2071,
2072,
2822,
183515,
210080,
210187,
210756,
210822,
213305,
213544,
214155,
214203,
214272,
214503,
214504,
214505,
214578,
215944,
215963,
216344,
216693,
217060]}
20919,
20947,
282038,
303032,
303046,
304473,
304481,
304546,
305737,
305836,
305906,
305964,
306989,
307047,
307166,
307650,
308467,
308919,
308920,
308925,
309347]}
Get a specific item when field matchs the given value::
# curl http://localhost:61208/api/3/processlist/pid/10259
{"10259": [{"cmdline": ["/snap/firefox/1300/usr/lib/firefox/firefox"],
"cpu_percent": 0.0,
"cpu_times": [4191.85, 1588.46, 3119.18, 692.52, 0.0],
"cpu_times": [7265.13, 2644.4, 4225.08, 934.33, 0.0],
"gids": [1000, 1000, 1000],
"io_counters": [1992798208, 5691990016, 0, 0, 0],
"io_counters": [2597592064, 8660602880, 0, 0, 0],
"key": "pid",
"memory_info": [459440128,
13888520192,
139042816,
"memory_info": [521797632,
14051770368,
142577664,
643072,
0,
1830445056,
1934319616,
0],
"memory_percent": 5.861741538419732,
"memory_percent": 6.657326314656288,
"name": "firefox",
"nice": 0,
"num_threads": 153,
"num_threads": 165,
"pid": 10259,
"ppid": 2922,
"status": "S",
@ -960,69 +991,69 @@ GET quicklook
Get plugin stats::
# curl http://localhost:61208/api/3/quicklook
{"cpu": 39.6,
{"cpu": 35.6,
"cpu_hz": 3000000000.0,
"cpu_hz_current": 1792000.0,
"cpu_hz_current": 2860000.0,
"cpu_name": "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz",
"mem": 60.3,
"mem": 81.4,
"percpu": [{"cpu_number": 0,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 57.0,
"idle": 56.9,
"iowait": 0.0,
"irq": 0.0,
"key": "cpu_number",
"nice": 0.0,
"softirq": 0.0,
"steal": 0.0,
"system": 7.0,
"total": 43.0,
"user": 26.0},
"system": 4.6,
"total": 43.1,
"user": 38.5},
{"cpu_number": 1,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 68.0,
"idle": 73.8,
"iowait": 0.0,
"irq": 0.0,
"key": "cpu_number",
"nice": 0.0,
"softirq": 0.0,
"steal": 0.0,
"system": 6.0,
"total": 32.0,
"user": 17.0},
"system": 4.6,
"total": 26.2,
"user": 21.5},
{"cpu_number": 2,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 60.0,
"iowait": 0.0,
"idle": 56.1,
"iowait": 0.8,
"irq": 0.0,
"key": "cpu_number",
"nice": 0.0,
"softirq": 0.0,
"steal": 0.0,
"system": 7.0,
"total": 40.0,
"user": 21.0},
"system": 4.5,
"total": 43.9,
"user": 38.6},
{"cpu_number": 3,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 31.0,
"idle": 69.9,
"iowait": 0.0,
"irq": 0.0,
"key": "cpu_number",
"nice": 0.0,
"softirq": 0.0,
"steal": 0.0,
"system": 5.0,
"total": 69.0,
"user": 54.0}],
"swap": 23.2}
"system": 3.0,
"total": 30.1,
"user": 27.1}],
"swap": 22.0}
Get a specific field::
# curl http://localhost:61208/api/3/quicklook/cpu
{"cpu": 39.6}
{"cpu": 35.6}
GET sensors
-----------
@ -1093,7 +1124,7 @@ GET uptime
Get plugin stats::
# curl http://localhost:61208/api/3/uptime
{"seconds": 1370482}
{"seconds": 1495537}
GET all stats
-------------
@ -1109,33 +1140,33 @@ GET stats history
History of a plugin::
# curl http://localhost:61208/api/3/cpu/history
{"system": [["2022-05-24T12:02:07.760352", 7.0],
["2022-05-24T12:02:08.818817", 7.0],
["2022-05-24T12:02:09.906285", 1.1]],
"user": [["2022-05-24T12:02:07.760346", 30.8],
["2022-05-24T12:02:08.818813", 30.8],
["2022-05-24T12:02:09.906281", 5.8]]}
{"system": [["2022-05-25T22:46:23.083039", 4.3],
["2022-05-25T22:46:24.140665", 4.3],
["2022-05-25T22:46:25.239049", 5.5]],
"user": [["2022-05-25T22:46:23.083029", 27.0],
["2022-05-25T22:46:24.140661", 27.0],
["2022-05-25T22:46:25.239044", 10.7]]}
Limit history to last 2 values::
# curl http://localhost:61208/api/3/cpu/history/2
{"system": [["2022-05-24T12:02:08.818817", 7.0],
["2022-05-24T12:02:09.906285", 1.1]],
"user": [["2022-05-24T12:02:08.818813", 30.8],
["2022-05-24T12:02:09.906281", 5.8]]}
{"system": [["2022-05-25T22:46:24.140665", 4.3],
["2022-05-25T22:46:25.239049", 5.5]],
"user": [["2022-05-25T22:46:24.140661", 27.0],
["2022-05-25T22:46:25.239044", 10.7]]}
History for a specific field::
# curl http://localhost:61208/api/3/cpu/system/history
{"system": [["2022-05-24T12:02:07.760352", 7.0],
["2022-05-24T12:02:08.818817", 7.0],
["2022-05-24T12:02:09.906285", 1.1]]}
{"system": [["2022-05-25T22:46:23.083039", 4.3],
["2022-05-25T22:46:24.140665", 4.3],
["2022-05-25T22:46:25.239049", 5.5]]}
Limit history for a specific field to last 2 values::
# curl http://localhost:61208/api/3/cpu/system/history
{"system": [["2022-05-24T12:02:08.818817", 7.0],
["2022-05-24T12:02:09.906285", 1.1]]}
{"system": [["2022-05-25T22:46:24.140665", 4.3],
["2022-05-25T22:46:25.239049", 5.5]]}
GET limits (used for thresholds)
--------------------------------

View File

@ -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" "May 24, 2022" "3.2.6" "Glances"
.TH "GLANCES" "1" "May 25, 2022" "3.2.6.3" "Glances"
.SH NAME
glances \- An eye on your system
.SH SYNOPSIS

View File

@ -60,7 +60,7 @@ class Outdated(object):
# Read the configuration file
self.load_config(config)
if not PACKAGING_IMPORT:
self.args.disable_check_update = False
self.args.disable_check_update = True
logger.debug("Check Glances version up-to-date: {}".format(not self.args.disable_check_update))
# And update !

View File

@ -1058,8 +1058,7 @@ class _GlancesCurses(object):
if not display_additional and m['additional']:
continue
# Is it possible to display the stat with the current screen size
# !!! Crash if not try/except... Why ???
try:
if screen_x - x > 0:
self.term_window.addnstr(
y,
x,
@ -1068,21 +1067,10 @@ class _GlancesCurses(object):
screen_x - x,
self.colors_list[m['decoration']],
)
except Exception:
pass
else:
# New column
# Python 2: we need to decode to get real screen size because
# UTF-8 special tree chars occupy several bytes.
# Python 3: strings are strings and bytes are bytes, all is
# good.
try:
x += len(u(m['msg']))
except UnicodeDecodeError:
# Quick and dirty hack for issue #745
pass
if x > x_max:
x_max = x
# New column
x += len(u(m['msg']))
if x > x_max:
x_max = x
# Compute the next Glances column/line position
self.next_column = max(self.next_column, x_max + self.space_between_column)

View File

@ -314,9 +314,9 @@ class PluginModel(GlancesPluginModel):
ret.append(self.curse_add_line(msg, self.get_views(key='total', option='decoration')))
# Idle CPU
if 'idle' in self.stats and not idle_tag:
msg = ' {:8}'.format('idle:')
msg = ' {:8}'.format('idle')
ret.append(self.curse_add_line(msg, optional=self.get_views(key='idle', option='optional')))
msg = '{:5.1f}%'.format(self.stats['idle'])
msg = '{:4.1f}%'.format(self.stats['idle'])
ret.append(self.curse_add_line(msg, optional=self.get_views(key='idle', option='optional')))
# ctx_switches
if 'ctx_switches' in self.stats:
@ -347,11 +347,7 @@ class PluginModel(GlancesPluginModel):
msg = '{:5.1f}%'.format(self.stats['idle'])
ret.append(self.curse_add_line(msg))
# IRQ CPU
if 'irq' in self.stats:
msg = ' {:8}'.format('irq:')
ret.append(self.curse_add_line(msg, optional=self.get_views(key='irq', option='optional')))
msg = '{:5.1f}%'.format(self.stats['irq'])
ret.append(self.curse_add_line(msg, optional=self.get_views(key='irq', option='optional')))
ret.extend(self.curse_add_stat('irq', width=14, header=' '))
# interrupts
if 'interrupts' in self.stats:
msg = ' {:8}'.format('inter:')
@ -373,11 +369,7 @@ class PluginModel(GlancesPluginModel):
msg = '{:>6}'.format(self.stats['nb_log_core'])
ret.append(self.curse_add_line(msg))
# Nice CPU
if 'nice' in self.stats:
msg = ' {:8}'.format('nice:')
ret.append(self.curse_add_line(msg, optional=self.get_views(key='nice', option='optional')))
msg = '{:5.1f}%'.format(self.stats['nice'])
ret.append(self.curse_add_line(msg, optional=self.get_views(key='nice', option='optional')))
ret.extend(self.curse_add_stat('nice', width=14, header=' '))
# soft_interrupts
if 'soft_interrupts' in self.stats:
msg = ' {:8}'.format('sw_int:')
@ -401,18 +393,7 @@ class PluginModel(GlancesPluginModel):
)
)
# Steal CPU usage
if 'steal' in self.stats:
msg = ' {:8}'.format('steal:')
ret.append(self.curse_add_line(msg, optional=self.get_views(key='steal', option='optional')))
msg = '{:5.1f}%'.format(self.stats['steal'])
ret.append(
self.curse_add_line(
msg,
self.get_views(key='steal', option='decoration'),
optional=self.get_views(key='steal', option='optional'),
)
)
# syscalls
ret.extend(self.curse_add_stat('steal', width=14, header=' '))
# syscalls: number of system calls since boot. Always set to 0 on Linux. (do not display)
if 'syscalls' in self.stats and not LINUX:
msg = ' {:8}'.format('syscal:')

View File

@ -23,7 +23,6 @@ import os
import threading
import time
from copy import deepcopy
from dateutil import parser
from glances.compat import iterkeys, itervalues, nativestr, pretty_date
from glances.logger import logger
@ -37,10 +36,11 @@ from glances.timer import getTimeSinceLastUpdate
# https://github.com/docker/docker-py
try:
import docker
from dateutil import parser
except Exception as e:
import_error_tag = True
# Display debug message if import KeyError
logger.warning("Error loading Docker Python Lib. Docker plugin is disabled ({})".format(e))
logger.warning("Error loading Docker deps Lib. Docker plugin is disabled ({})".format(e))
else:
import_error_tag = False

View File

@ -2,7 +2,7 @@
#
# This file is part of Glances.
#
# Copyright (C) 2019 Nicolargo <nicolas@nicolargo.com>
# Copyright (C) 2022 Nicolargo <nicolas@nicolargo.com>
#
# Glances is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
@ -47,7 +47,10 @@ waiting in the run-queue plus the number currently executing \
over 15 minutes.',
'unit': 'float',
},
'cpucore': {'description': 'Total number of CPU core.', 'unit': 'number'},
'cpucore': {
'description': 'Total number of CPU core.',
'unit': 'number'
},
}
# SNMP OID
@ -167,7 +170,7 @@ class PluginModel(GlancesPluginModel):
# Build the string message
# Header
msg = '{:6}'.format('LOAD%' if (args.disable_irix and self.nb_log_core != 0) else 'LOAD')
msg = '{:5}'.format('LOAD')
ret.append(self.curse_add_line(msg, "TITLE"))
# Core number
if 'cpucore' in self.stats and self.stats['cpucore'] > 0:
@ -176,18 +179,16 @@ class PluginModel(GlancesPluginModel):
# Loop over 1min, 5min and 15min load
for load_time in ['1', '5', '15']:
ret.append(self.curse_new_line())
msg = '{:8}'.format('{} min:'.format(load_time))
msg = '{:7}'.format('{} min'.format(load_time))
ret.append(self.curse_add_line(msg))
if args.disable_irix and self.nb_log_core != 0:
# Enable Irix mode for load (see issue #1554)
load_stat = self.stats['min{}'.format(load_time)] / self.nb_log_core * 100
msg = '{:>5.1f}%'.format(load_stat)
else:
# Default mode for load
load_stat = self.stats['min{}'.format(load_time)]
msg = '{:>6.2f}'.format(load_stat)
if load_time == '1':
ret.append(self.curse_add_line(msg))
else:
# Alert is only for 5 and 15 min
ret.append(self.curse_add_line(msg, self.get_views(key='min{}'.format(load_time), option='decoration')))
msg = '{:>6.2f}'.format(load_stat)
ret.append(self.curse_add_line(msg, self.get_views(key='min{}'.format(load_time), option='decoration')))
return ret

View File

@ -2,7 +2,7 @@
#
# This file is part of Glances.
#
# Copyright (C) 2021 Nicolargo <nicolas@nicolargo.com>
# Copyright (C) 2022 Nicolargo <nicolas@nicolargo.com>
#
# Glances is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
@ -57,11 +57,17 @@ note that this doesn\'t reflect the actual memory available (use \'available\' i
'unit': 'bytes',
'min_symbol': 'K',
},
'inactive': {'description': '*(UNIX)*: memory that is marked as not used.', 'unit': 'bytes', 'min_symbol': 'K'},
'inactive': {
'description': '*(UNIX)*: memory that is marked as not used.',
'unit': 'bytes',
'min_symbol': 'K',
'short_name': 'inacti',
},
'buffers': {
'description': '*(Linux, BSD)*: cache for things like file system metadata.',
'unit': 'bytes',
'min_symbol': 'K',
'short_name': 'buffer',
},
'cached': {'description': '*(Linux, BSD)*: cache for various things.', 'unit': 'bytes', 'min_symbol': 'K'},
'wired': {
@ -258,7 +264,7 @@ class PluginModel(GlancesPluginModel):
msg = '{:>7.1%}'.format(self.stats['percent'] / 100)
ret.append(self.curse_add_line(msg, self.get_views(key='percent', option='decoration')))
# Active memory usage
ret.extend(self.curse_add_stat('active', width=18, header=' '))
ret.extend(self.curse_add_stat('active', width=16, header=' '))
# Second line
# total + inactive
@ -266,7 +272,7 @@ class PluginModel(GlancesPluginModel):
# Total memory usage
ret.extend(self.curse_add_stat('total', width=15))
# Inactive memory usage
ret.extend(self.curse_add_stat('inactive', width=18, header=' '))
ret.extend(self.curse_add_stat('inactive', width=16, header=' '))
# Third line
# used + buffers
@ -274,7 +280,7 @@ class PluginModel(GlancesPluginModel):
# Used memory usage
ret.extend(self.curse_add_stat('used', width=15))
# Buffers memory usage
ret.extend(self.curse_add_stat('buffers', width=18, header=' '))
ret.extend(self.curse_add_stat('buffers', width=16, header=' '))
# Fourth line
# free + cached
@ -282,6 +288,6 @@ class PluginModel(GlancesPluginModel):
# Free memory usage
ret.extend(self.curse_add_stat('free', width=15))
# Cached memory usage
ret.extend(self.curse_add_stat('cached', width=18, header=' '))
ret.extend(self.curse_add_stat('cached', width=16, header=' '))
return ret

View File

@ -172,9 +172,9 @@ class PluginModel(GlancesPluginModel):
# First line
# total%
msg = '{}'.format('SWAP')
msg = '{:4}'.format('SWAP')
ret.append(self.curse_add_line(msg, "TITLE"))
msg = ' {:3}'.format(self.trend_msg(self.get_trend('percent')))
msg = ' {:2}'.format(self.trend_msg(self.get_trend('percent')))
ret.append(self.curse_add_line(msg))
# Percent memory usage
msg = '{:>6.1%}'.format(self.stats['percent'] / 100)
@ -184,18 +184,18 @@ class PluginModel(GlancesPluginModel):
# total
ret.append(self.curse_new_line())
# Total memory usage
ret.extend(self.curse_add_stat('total', width=16))
ret.extend(self.curse_add_stat('total', width=15))
# Third line
# used
ret.append(self.curse_new_line())
# Used memory usage
ret.extend(self.curse_add_stat('used', width=16))
ret.extend(self.curse_add_stat('used', width=15))
# Fourth line
# free
ret.append(self.curse_new_line())
# Free memory usage
ret.extend(self.curse_add_stat('free', width=16))
ret.extend(self.curse_add_stat('free', width=15))
return ret

View File

@ -38,7 +38,9 @@ from glances.timer import Counter, Timer
from glances.outputs.glances_unicode import unicode_message
fields_unit_short = {'percent': '%'}
fields_unit_short = {
'percent': '%'
}
fields_unit_type = {
'percent': 'float',
@ -52,7 +54,7 @@ fields_unit_type = {
'second': 'int',
'seconds': 'int',
'byte': 'int',
'bytes': 'int',
'bytes': 'int'
}
@ -978,7 +980,7 @@ class GlancesPluginModel(object):
"""Go to a new line."""
return self.curse_add_line('\n')
def curse_add_stat(self, key, width=None, header='', separator='', trailer=''):
def curse_add_stat(self, key, width=None, header='', display_key=True, separator='', trailer=''):
"""Return a list of dict messages with the 'key: value' result
<=== width ===>
@ -986,8 +988,8 @@ class GlancesPluginModel(object):
| | | | |_ trailer
| | | |_ self.stats[key]
| | |_ separator
| |_ key
|_ trailer
| |_ 'short_name' description or key or nothing if display_key is True
|_ header
Instead of:
msg = ' {:8}'.format('idle:')
@ -1003,7 +1005,9 @@ class GlancesPluginModel(object):
return []
# Check if a shortname is defined
if key in self.fields_description and 'short_name' in self.fields_description[key]:
if not display_key:
key_name = ''
elif key in self.fields_description and 'short_name' in self.fields_description[key]:
key_name = self.fields_description[key]['short_name']
else:
key_name = key

View File

@ -36,7 +36,7 @@ class GlancesProcesses(object):
def __init__(self, cache_timeout=60):
"""Init the class to collect stats about processes."""
# Add internals caches because psutil do not cache all the stats
# See: https://code.google.com/p/psutil/issues/detail?id=462
# See: https://github.com/giampaolo/psutil/issues/462
self.username_cache = {}
self.cmdline_cache = {}
@ -45,7 +45,7 @@ class GlancesProcesses(object):
# First iteration, no cache
self.cache_timer = Timer(0)
# Init the io dict
# Init the io_old dict used to compute the IO bitrate
# key = pid
# value = [ read_bytes_old, write_bytes_old ]
self.io_old = {}
@ -260,8 +260,8 @@ class GlancesProcesses(object):
# Grab standard stats
#####################
sorted_attrs = ['cpu_percent', 'cpu_times', 'memory_percent', 'name', 'status', 'status', 'num_threads']
displayed_attr = ['memory_info', 'nice', 'pid', 'ppid']
sorted_attrs = ['cpu_percent', 'cpu_times', 'memory_percent', 'name', 'status', 'num_threads']
displayed_attr = ['memory_info', 'nice', 'pid']
cached_attrs = ['cmdline', 'username']
# Some stats are optional

View File

@ -28,6 +28,7 @@ python-dateutil
pyzmq
requests
scandir; python_version < "3.5"
six
sparklines
statsd
wifi

View File

@ -50,7 +50,7 @@ def get_install_extras_require():
'action': ['chevron'],
'browser': ['zeroconf>=0.19.1'],
'cloud': ['requests'],
'docker': ['docker>=2.0.0', 'python-dateutil'],
'docker': ['docker>=2.0.0', 'python-dateutil', 'six'],
'export': ['bernhard', 'cassandra-driver', 'couchdb', 'elasticsearch',
'graphitesender', 'influxdb>=1.0.0', 'influxdb-client',
'kafka-python', 'pika', 'paho-mqtt', 'potsdb', 'prometheus_client',