mirror of
https://github.com/nicolargo/glances.git
synced 2026-04-18 04:52:01 -04:00
Cross-Origin Information Disclosure via Unauthenticated REST API (/api/4) due to Permissive CORS in Glances - Mitigate CVE-2026-34839
This commit is contained in:
@@ -22,25 +22,25 @@ use the following code:
|
||||
>>> gl = api.GlancesAPI()
|
||||
>>> gl.cpu
|
||||
{'cpucore': 16,
|
||||
'ctx_switches': 502139822,
|
||||
'ctx_switches': 525580610,
|
||||
'guest': 0.0,
|
||||
'idle': 92.6,
|
||||
'interrupts': 296818290,
|
||||
'iowait': 0.9,
|
||||
'idle': 92.2,
|
||||
'interrupts': 308665011,
|
||||
'iowait': 0.2,
|
||||
'irq': 0.0,
|
||||
'nice': 0.0,
|
||||
'soft_interrupts': 157791372,
|
||||
'soft_interrupts': 164580903,
|
||||
'steal': 0.0,
|
||||
'syscalls': 0,
|
||||
'system': 4.5,
|
||||
'total': 6.3,
|
||||
'user': 2.1}
|
||||
'system': 5.2,
|
||||
'total': 7.1,
|
||||
'user': 2.4}
|
||||
>>> gl.cpu.get("total")
|
||||
6.3
|
||||
7.1
|
||||
>>> gl.mem.get("used")
|
||||
9975667720
|
||||
10398616584
|
||||
>>> gl.auto_unit(gl.mem.get("used"))
|
||||
9.29G
|
||||
9.68G
|
||||
|
||||
If the stats return a list of items (like network interfaces or processes), you can
|
||||
access them by their name:
|
||||
@@ -51,19 +51,19 @@ access them by their name:
|
||||
['wlp0s20f3', 'veth22ca982']
|
||||
>>> gl.network["wlp0s20f3"]
|
||||
{'alias': None,
|
||||
'bytes_all': 0,
|
||||
'bytes_all_gauge': 9101519697,
|
||||
'bytes_all_rate_per_sec': 0.0,
|
||||
'bytes_recv': 0,
|
||||
'bytes_recv_gauge': 8568694263,
|
||||
'bytes_recv_rate_per_sec': 0.0,
|
||||
'bytes_sent': 0,
|
||||
'bytes_sent_gauge': 532825434,
|
||||
'bytes_sent_rate_per_sec': 0.0,
|
||||
'bytes_all': 647,
|
||||
'bytes_all_gauge': 9436490359,
|
||||
'bytes_all_rate_per_sec': 3496.0,
|
||||
'bytes_recv': 369,
|
||||
'bytes_recv_gauge': 8864844532,
|
||||
'bytes_recv_rate_per_sec': 1994.0,
|
||||
'bytes_sent': 278,
|
||||
'bytes_sent_gauge': 571645827,
|
||||
'bytes_sent_rate_per_sec': 1502.0,
|
||||
'interface_name': 'wlp0s20f3',
|
||||
'key': 'interface_name',
|
||||
'speed': 0,
|
||||
'time_since_update': 0.1952357292175293}
|
||||
'time_since_update': 0.18503737449645996}
|
||||
|
||||
Init Glances Python API
|
||||
-----------------------
|
||||
@@ -136,7 +136,7 @@ Ports stats:
|
||||
'port': 0,
|
||||
'refresh': 30,
|
||||
'rtt_warning': None,
|
||||
'status': 0.006765,
|
||||
'status': 0.009761,
|
||||
'timeout': 3}]
|
||||
|
||||
Ports fields description:
|
||||
@@ -177,14 +177,14 @@ Diskio stats:
|
||||
>>> gl.diskio.get("nvme0n1")
|
||||
{'disk_name': 'nvme0n1',
|
||||
'key': 'disk_name',
|
||||
'read_bytes': 26386735104,
|
||||
'read_count': 1799163,
|
||||
'read_bytes': 26857086976,
|
||||
'read_count': 1817591,
|
||||
'read_latency': 0,
|
||||
'read_time': 377822,
|
||||
'write_bytes': 181084836864,
|
||||
'write_count': 4235009,
|
||||
'read_time': 387641,
|
||||
'write_bytes': 183147435008,
|
||||
'write_count': 4403623,
|
||||
'write_latency': 0,
|
||||
'write_time': 9194472}
|
||||
'write_time': 9376536}
|
||||
|
||||
Diskio fields description:
|
||||
|
||||
@@ -250,7 +250,7 @@ Containers stats:
|
||||
'network_tx': None,
|
||||
'ports': '4222->4222/tcp,6222->6222/tcp,8222->8222/tcp',
|
||||
'status': 'running',
|
||||
'uptime': '2 weeks'}
|
||||
'uptime': '3 weeks'}
|
||||
|
||||
Containers fields description:
|
||||
|
||||
@@ -295,11 +295,11 @@ Processcount stats:
|
||||
>>> type(gl.processcount)
|
||||
<class 'glances.plugins.processcount.ProcesscountPlugin'>
|
||||
>>> gl.processcount
|
||||
{'pid_max': 0, 'running': 1, 'sleeping': 429, 'thread': 2157, 'total': 577}
|
||||
{'pid_max': 0, 'running': 1, 'sleeping': 430, 'thread': 2188, 'total': 580}
|
||||
>>> gl.processcount.keys()
|
||||
['total', 'running', 'sleeping', 'thread', 'pid_max']
|
||||
>>> gl.processcount.get("total")
|
||||
577
|
||||
580
|
||||
|
||||
Processcount fields description:
|
||||
|
||||
@@ -390,7 +390,7 @@ Percpu stats:
|
||||
'nice': 0.0,
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 9.0,
|
||||
'system': 5.0,
|
||||
'total': 71.0,
|
||||
'user': 0.0}
|
||||
|
||||
@@ -482,18 +482,18 @@ Network stats:
|
||||
>>> gl.network.get("wlp0s20f3")
|
||||
{'alias': None,
|
||||
'bytes_all': 0,
|
||||
'bytes_all_gauge': 9101519697,
|
||||
'bytes_all_gauge': 9436490359,
|
||||
'bytes_all_rate_per_sec': 0.0,
|
||||
'bytes_recv': 0,
|
||||
'bytes_recv_gauge': 8568694263,
|
||||
'bytes_recv_gauge': 8864844532,
|
||||
'bytes_recv_rate_per_sec': 0.0,
|
||||
'bytes_sent': 0,
|
||||
'bytes_sent_gauge': 532825434,
|
||||
'bytes_sent_gauge': 571645827,
|
||||
'bytes_sent_rate_per_sec': 0.0,
|
||||
'interface_name': 'wlp0s20f3',
|
||||
'key': 'interface_name',
|
||||
'speed': 0,
|
||||
'time_since_update': 0.0017604827880859375}
|
||||
'time_since_update': 0.0031113624572753906}
|
||||
|
||||
Network fields description:
|
||||
|
||||
@@ -534,23 +534,23 @@ Cpu stats:
|
||||
<class 'glances.plugins.cpu.CpuPlugin'>
|
||||
>>> gl.cpu
|
||||
{'cpucore': 16,
|
||||
'ctx_switches': 502139822,
|
||||
'ctx_switches': 525580610,
|
||||
'guest': 0.0,
|
||||
'idle': 92.6,
|
||||
'interrupts': 296818290,
|
||||
'iowait': 0.9,
|
||||
'idle': 92.2,
|
||||
'interrupts': 308665011,
|
||||
'iowait': 0.2,
|
||||
'irq': 0.0,
|
||||
'nice': 0.0,
|
||||
'soft_interrupts': 157791372,
|
||||
'soft_interrupts': 164580903,
|
||||
'steal': 0.0,
|
||||
'syscalls': 0,
|
||||
'system': 4.5,
|
||||
'total': 6.3,
|
||||
'user': 2.1}
|
||||
'system': 5.2,
|
||||
'total': 7.1,
|
||||
'user': 2.4}
|
||||
>>> gl.cpu.keys()
|
||||
['total', 'user', 'nice', 'system', 'idle', 'iowait', 'irq', 'steal', 'guest', 'ctx_switches', 'interrupts', 'soft_interrupts', 'syscalls', 'cpucore']
|
||||
>>> gl.cpu.get("total")
|
||||
6.3
|
||||
7.1
|
||||
|
||||
Cpu fields description:
|
||||
|
||||
@@ -625,7 +625,7 @@ Amps stats:
|
||||
'refresh': 3.0,
|
||||
'regex': True,
|
||||
'result': None,
|
||||
'timer': 0.23367595672607422}
|
||||
'timer': 0.2181529998779297}
|
||||
|
||||
Amps fields description:
|
||||
|
||||
@@ -656,37 +656,37 @@ Processlist stats:
|
||||
>>> gl.processlist
|
||||
Return a dict of dict with key=<pid>
|
||||
>>> gl.processlist.keys()
|
||||
[721368, 129, 9777, 542807, 542716, 436891, 8146, 9348, 8946, 713198, 543954, 542919, 712513, 5858, 523202, 501462, 9589, 544404, 9755, 8626, 356061, 6590, 544323, 709687, 180309, 542846, 3832, 685632, 720491, 721066, 720444, 542888, 691416, 542887, 8005, 8636, 543638, 544043, 30393, 542958, 6075, 9338, 660083, 690182, 543365, 544900, 7814, 721365, 17796, 6280, 8567, 6588, 542768, 8047, 543544, 5563, 5990, 6063, 7658, 543755, 8563, 8017, 543630, 543637, 6003, 543633, 6319, 6039, 6620, 688517, 6032, 3515, 3114, 6196, 6719, 6065, 3227, 542719, 6029, 1, 8041, 5982, 5561, 3147, 6023, 5823, 6487, 542718, 3105, 6572, 5538, 30308, 691345, 5679, 5501, 3153, 622031, 5557, 688514, 3152, 6057, 6223, 6237, 3261, 3550, 3506, 6026, 5564, 3228, 6020, 3838, 580204, 3343, 6046, 622032, 3614, 8727, 580185, 6549, 312376, 3891, 312367, 690567, 36986, 6064, 6028, 5628, 65842, 3100, 3128, 690374, 6099, 3344, 3138, 5813, 65862, 6199, 6378, 6489, 3110, 690957, 5857, 6359, 6234, 5575, 6060, 3139, 5963, 3134, 5820, 6204, 6050, 6385, 6021, 6185, 6325, 6053, 580230, 5632, 5663, 3246, 5991, 5797, 3099, 688366, 3121, 180319, 5798, 6322, 11946, 5558, 5871, 3098, 225420, 543381, 543010, 2941, 3104, 4153, 2955, 3131, 721361, 580241, 3839, 3852, 5545, 3864, 5639, 710817, 721364, 3846, 621754, 3850, 65805, 621747, 65774, 65781, 65789, 65811, 65798, 8378, 3690, 2952, 542733, 3222, 622047, 3691, 543362, 2, 3, 4, 5, 6, 7, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 92, 93, 94, 95, 96, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117, 118, 121, 122, 123, 124, 125, 126, 127, 132, 134, 135, 136, 137, 138, 140, 141, 142, 145, 146, 147, 148, 150, 151, 153, 163, 164, 165, 166, 167, 184, 186, 212, 214, 233, 234, 267, 268, 269, 270, 271, 272, 273, 274, 276, 359, 361, 362, 363, 364, 365, 488, 490, 495, 823, 824, 825, 827, 835, 886, 887, 987, 988, 1218, 1258, 1259, 1582, 1583, 1584, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1629, 1639, 1773, 1774, 1775, 1776, 1777, 1783, 1784, 1823, 1828, 2260, 2261, 2262, 2263, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2339, 2340, 2341, 2342, 2343, 2344, 2346, 2347, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2471, 2472, 2473, 2476, 2479, 3355, 3640, 3874, 3892, 3893, 3894, 3895, 3896, 3897, 3898, 3899, 4352, 580201, 596509, 621794, 650225, 652022, 655598, 657073, 665558, 671742, 676537, 684468, 684469, 684470, 688130, 688135, 688146, 688399, 688804, 690580, 691337, 699805, 701758, 701799, 701800, 701841, 701938, 701940, 705420, 705646, 706237, 706600, 707673, 707879, 707880, 708014, 708943, 710326, 710975, 711685, 711789, 712990, 714237, 714784, 715549, 715633, 715810, 716817, 716828, 717303, 717305, 717494, 717495, 717577, 717627, 718222, 718443, 718743, 718902, 720737, 721330, 721354, 721397]
|
||||
>>> gl.processlist.get("721368")
|
||||
[756143, 8146, 129, 5858, 8626, 752481, 732462, 728565, 9777, 1584, 543954, 9348, 8946, 436891, 713198, 735237, 542919, 542807, 523202, 9589, 501462, 9755, 544404, 180309, 6590, 542716, 3832, 542887, 356061, 685632, 542846, 723954, 544323, 753737, 754159, 755492, 542888, 543638, 8636, 8005, 544043, 690182, 30393, 6075, 542958, 9338, 660083, 543365, 756140, 7814, 6280, 8567, 17796, 6588, 542768, 543755, 8047, 543544, 5563, 5990, 6063, 7658, 8563, 8017, 543630, 543637, 543633, 6003, 6319, 6039, 6620, 723388, 6032, 3515, 544900, 3114, 6196, 6719, 6065, 3227, 542719, 1, 6029, 8041, 5982, 5561, 3147, 6023, 5823, 6487, 542718, 3105, 6572, 5538, 30308, 691345, 5679, 5501, 3153, 723327, 622031, 5557, 3152, 6057, 6223, 6237, 3261, 3550, 3506, 6026, 5564, 3228, 6020, 3838, 580204, 3343, 6046, 622032, 3614, 8727, 580185, 6549, 312376, 3891, 312367, 690567, 36986, 6064, 6028, 5628, 3100, 3128, 690374, 6099, 3344, 3138, 5813, 65862, 6199, 6378, 6489, 3110, 690957, 5857, 6359, 6234, 5575, 65842, 6060, 3139, 3134, 5963, 5820, 6204, 6050, 6385, 6021, 6185, 6325, 6053, 580230, 5632, 5663, 3246, 5991, 5797, 3099, 225420, 723102, 3121, 180319, 5798, 6322, 11946, 5558, 5871, 3098, 543381, 543010, 2941, 3104, 4153, 2955, 3131, 756136, 580241, 3839, 3852, 5545, 3864, 5639, 749657, 756139, 3846, 8378, 621754, 3850, 65805, 621747, 65774, 65781, 65789, 65811, 65798, 3690, 2952, 542733, 3222, 622047, 3691, 543362, 2, 3, 4, 5, 6, 7, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 92, 93, 94, 95, 96, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117, 118, 121, 122, 123, 124, 125, 126, 127, 132, 134, 135, 136, 137, 138, 140, 141, 142, 145, 146, 147, 148, 150, 151, 153, 163, 164, 165, 166, 167, 184, 186, 212, 214, 233, 234, 267, 268, 269, 270, 271, 272, 273, 274, 276, 359, 361, 362, 363, 364, 365, 488, 490, 495, 823, 824, 825, 827, 835, 886, 887, 987, 988, 1218, 1258, 1259, 1582, 1583, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1629, 1639, 1773, 1774, 1775, 1776, 1777, 1783, 1784, 1823, 1828, 2260, 2261, 2262, 2263, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2339, 2340, 2341, 2342, 2343, 2344, 2346, 2347, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2471, 2472, 2473, 2476, 2479, 3355, 3640, 3874, 3892, 3893, 3894, 3895, 3896, 3897, 3898, 3899, 4352, 580201, 596509, 650225, 665558, 684469, 688804, 690580, 691337, 701758, 710975, 718902, 721330, 721397, 722055, 722905, 722908, 722922, 722926, 722927, 723004, 723356, 728203, 728398, 728567, 731706, 734098, 734509, 736341, 738184, 738649, 740122, 741082, 742459, 743690, 744547, 744924, 744961, 748356, 748399, 748465, 748524, 749375, 749553, 750616, 750780, 751344, 751422, 752592, 752619, 752632, 753583, 753962, 753985, 753987, 754101, 754275, 754334, 754335, 754336, 754337, 754338, 754480, 754581]
|
||||
>>> gl.processlist.get("756143")
|
||||
{'cmdline': ['/home/nicolargo/dev/glances/.venv/bin/python3',
|
||||
'-m',
|
||||
'glances',
|
||||
'-C',
|
||||
'conf/glances.conf',
|
||||
'--api-doc'],
|
||||
'cpu_percent': 72.5,
|
||||
'cpu_percent': 76.3,
|
||||
'cpu_times': {'children_system': 0.01,
|
||||
'children_user': 0.0,
|
||||
'iowait': 0.0,
|
||||
'system': 0.4,
|
||||
'user': 0.38},
|
||||
'system': 0.42,
|
||||
'user': 0.36},
|
||||
'gids': {'effective': 1000, 'real': 1000, 'saved': 1000},
|
||||
'io_counters': [0, 12288, 0, 8192, 1],
|
||||
'io_counters': [28672, 8192, 28672, 8192, 1],
|
||||
'key': 'pid',
|
||||
'memory_info': {'data': 124686336,
|
||||
'memory_info': {'data': 124751872,
|
||||
'dirty': 0,
|
||||
'lib': 0,
|
||||
'rss': 95531008,
|
||||
'shared': 23732224,
|
||||
'rss': 95576064,
|
||||
'shared': 23691264,
|
||||
'text': 31211520,
|
||||
'vms': 585166848},
|
||||
'memory_percent': 0.5817532566010025,
|
||||
'vms': 585232384},
|
||||
'memory_percent': 0.5820276332173302,
|
||||
'name': 'python3',
|
||||
'nice': 0,
|
||||
'num_threads': 5,
|
||||
'pid': 721368,
|
||||
'pid': 756143,
|
||||
'status': 'R',
|
||||
'time_since_update': 0.45049142837524414,
|
||||
'time_since_update': 0.424365758895874,
|
||||
'username': 'nicolargo'}
|
||||
|
||||
Processlist fields description:
|
||||
@@ -772,14 +772,11 @@ Load stats:
|
||||
>>> type(gl.load)
|
||||
<class 'glances.plugins.load.LoadPlugin'>
|
||||
>>> gl.load
|
||||
{'cpucore': 16,
|
||||
'min1': 0.95263671875,
|
||||
'min15': 0.79736328125,
|
||||
'min5': 0.80029296875}
|
||||
{'cpucore': 16, 'min1': 0.5888671875, 'min15': 0.712890625, 'min5': 0.611328125}
|
||||
>>> gl.load.keys()
|
||||
['min1', 'min5', 'min15', 'cpucore']
|
||||
>>> gl.load.get("min1")
|
||||
0.95263671875
|
||||
0.5888671875
|
||||
|
||||
Load fields description:
|
||||
|
||||
@@ -821,7 +818,7 @@ Sensors stats:
|
||||
'label': 'Ambient',
|
||||
'type': 'temperature_core',
|
||||
'unit': 'C',
|
||||
'value': 36,
|
||||
'value': 40,
|
||||
'warning': 0}
|
||||
|
||||
Sensors fields description:
|
||||
@@ -859,7 +856,7 @@ Uptime stats:
|
||||
>>> type(gl.uptime)
|
||||
<class 'glances.plugins.uptime.UptimePlugin'>
|
||||
>>> gl.uptime
|
||||
'20 days, 23:24:34'
|
||||
'21 days, 23:20:33'
|
||||
|
||||
Uptime limits:
|
||||
|
||||
@@ -878,11 +875,11 @@ Now stats:
|
||||
>>> type(gl.now)
|
||||
<class 'glances.plugins.now.NowPlugin'>
|
||||
>>> gl.now
|
||||
{'custom': '2026-04-11 09:25:51 CEST', 'iso': '2026-04-11T09:25:51+02:00'}
|
||||
{'custom': '2026-04-12 09:21:52 CEST', 'iso': '2026-04-12T09:21:52+02:00'}
|
||||
>>> gl.now.keys()
|
||||
['iso', 'custom']
|
||||
>>> gl.now.get("iso")
|
||||
'2026-04-11T09:25:51+02:00'
|
||||
'2026-04-12T09:21:52+02:00'
|
||||
|
||||
Now fields description:
|
||||
|
||||
@@ -911,14 +908,14 @@ Fs stats:
|
||||
['/', '/zsfpool']
|
||||
>>> gl.fs.get("/")
|
||||
{'device_name': '/dev/mapper/ubuntu--vg-ubuntu--lv',
|
||||
'free': 547697012736,
|
||||
'free': 547681718272,
|
||||
'fs_type': 'ext4',
|
||||
'key': 'mnt_point',
|
||||
'mnt_point': '/',
|
||||
'options': 'rw,relatime',
|
||||
'percent': 42.5,
|
||||
'size': 1003736440832,
|
||||
'used': 404976922624}
|
||||
'used': 404992217088}
|
||||
|
||||
Fs fields description:
|
||||
|
||||
@@ -959,8 +956,8 @@ Wifi stats:
|
||||
['wlp0s20f3']
|
||||
>>> gl.wifi.get("wlp0s20f3")
|
||||
{'key': 'ssid',
|
||||
'quality_level': -62.0,
|
||||
'quality_link': 48.0,
|
||||
'quality_level': -64.0,
|
||||
'quality_link': 46.0,
|
||||
'ssid': 'wlp0s20f3'}
|
||||
|
||||
Wifi limits:
|
||||
@@ -1089,19 +1086,19 @@ Mem stats:
|
||||
>>> type(gl.mem)
|
||||
<class 'glances.plugins.mem.MemPlugin'>
|
||||
>>> gl.mem
|
||||
{'active': 7362359296,
|
||||
'available': 6445556728,
|
||||
'buffers': 216145920,
|
||||
'cached': 6360790008,
|
||||
'free': 1026465792,
|
||||
'inactive': 4496453632,
|
||||
'percent': 60.7,
|
||||
'percent_max': 60.7,
|
||||
'percent_mean': 60.7,
|
||||
'percent_min': 60.7,
|
||||
'shared': 1619664896,
|
||||
{'active': 9070829568,
|
||||
'available': 6022607864,
|
||||
'buffers': 216756224,
|
||||
'cached': 6011335672,
|
||||
'free': 625549312,
|
||||
'inactive': 3548004352,
|
||||
'percent': 63.3,
|
||||
'percent_max': 63.3,
|
||||
'percent_mean': 63.3,
|
||||
'percent_min': 63.3,
|
||||
'shared': 1273552896,
|
||||
'total': 16421224448,
|
||||
'used': 9975667720}
|
||||
'used': 10398616584}
|
||||
>>> gl.mem.keys()
|
||||
['total', 'available', 'percent', 'used', 'free', 'active', 'inactive', 'buffers', 'cached', 'shared', 'percent_min', 'percent_max', 'percent_mean']
|
||||
>>> gl.mem.get("total")
|
||||
@@ -1174,14 +1171,14 @@ Quicklook stats:
|
||||
>>> type(gl.quicklook)
|
||||
<class 'glances.plugins.quicklook.QuicklookPlugin'>
|
||||
>>> gl.quicklook
|
||||
{'cpu': 6.3,
|
||||
{'cpu': 7.1,
|
||||
'cpu_hz': 4475000000.0,
|
||||
'cpu_hz_current': 799453312.5,
|
||||
'cpu_hz_current': 1222060500.0,
|
||||
'cpu_log_core': 16,
|
||||
'cpu_name': '13th Gen Intel(R) Core(TM) i7-13620H',
|
||||
'cpu_phys_core': 10,
|
||||
'load': 5.1,
|
||||
'mem': 60.7,
|
||||
'load': 4.5,
|
||||
'mem': 63.3,
|
||||
'percpu': [{'cpu_number': 0,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
@@ -1194,14 +1191,14 @@ Quicklook stats:
|
||||
'nice': 0.0,
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 9.0,
|
||||
'system': 5.0,
|
||||
'total': 71.0,
|
||||
'user': 0.0},
|
||||
{'cpu_number': 1,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 39.0,
|
||||
'idle': 35.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
@@ -1210,13 +1207,13 @@ Quicklook stats:
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 0.0,
|
||||
'total': 61.0,
|
||||
'total': 65.0,
|
||||
'user': 0.0},
|
||||
{'cpu_number': 2,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 39.0,
|
||||
'idle': 34.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
@@ -1225,13 +1222,13 @@ Quicklook stats:
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 0.0,
|
||||
'total': 61.0,
|
||||
'user': 0.0},
|
||||
'total': 66.0,
|
||||
'user': 1.0},
|
||||
{'cpu_number': 3,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 40.0,
|
||||
'idle': 36.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
@@ -1240,13 +1237,43 @@ Quicklook stats:
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 0.0,
|
||||
'total': 60.0,
|
||||
'total': 64.0,
|
||||
'user': 0.0},
|
||||
{'cpu_number': 4,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 28.0,
|
||||
'idle': 18.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
'key': 'cpu_number',
|
||||
'nice': 0.0,
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 9.0,
|
||||
'total': 82.0,
|
||||
'user': 9.0},
|
||||
{'cpu_number': 5,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 36.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
'key': 'cpu_number',
|
||||
'nice': 0.0,
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 0.0,
|
||||
'total': 64.0,
|
||||
'user': 0.0},
|
||||
{'cpu_number': 6,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 26.0,
|
||||
'interrupt': None,
|
||||
'iowait': 1.0,
|
||||
'irq': 0.0,
|
||||
@@ -1254,44 +1281,14 @@ Quicklook stats:
|
||||
'nice': 0.0,
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 10.0,
|
||||
'total': 72.0,
|
||||
'user': 1.0},
|
||||
{'cpu_number': 5,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 29.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
'key': 'cpu_number',
|
||||
'nice': 0.0,
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 3.0,
|
||||
'total': 71.0,
|
||||
'user': 6.0},
|
||||
{'cpu_number': 6,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 38.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
'key': 'cpu_number',
|
||||
'nice': 0.0,
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 2.0,
|
||||
'total': 62.0,
|
||||
'user': 1.0},
|
||||
'system': 6.0,
|
||||
'total': 74.0,
|
||||
'user': 2.0},
|
||||
{'cpu_number': 7,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 39.0,
|
||||
'idle': 35.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
@@ -1300,13 +1297,13 @@ Quicklook stats:
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 0.0,
|
||||
'total': 61.0,
|
||||
'total': 65.0,
|
||||
'user': 0.0},
|
||||
{'cpu_number': 8,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 39.0,
|
||||
'idle': 35.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
@@ -1314,14 +1311,14 @@ Quicklook stats:
|
||||
'nice': 0.0,
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 1.0,
|
||||
'total': 61.0,
|
||||
'system': 0.0,
|
||||
'total': 65.0,
|
||||
'user': 0.0},
|
||||
{'cpu_number': 9,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 40.0,
|
||||
'idle': 36.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
@@ -1330,13 +1327,13 @@ Quicklook stats:
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 0.0,
|
||||
'total': 60.0,
|
||||
'total': 64.0,
|
||||
'user': 0.0},
|
||||
{'cpu_number': 10,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 39.0,
|
||||
'idle': 35.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
@@ -1345,13 +1342,13 @@ Quicklook stats:
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 0.0,
|
||||
'total': 61.0,
|
||||
'total': 65.0,
|
||||
'user': 1.0},
|
||||
{'cpu_number': 11,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 40.0,
|
||||
'idle': 35.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
@@ -1360,43 +1357,13 @@ Quicklook stats:
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 0.0,
|
||||
'total': 60.0,
|
||||
'total': 65.0,
|
||||
'user': 0.0},
|
||||
{'cpu_number': 12,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 40.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
'key': 'cpu_number',
|
||||
'nice': 0.0,
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 0.0,
|
||||
'total': 60.0,
|
||||
'user': 0.0},
|
||||
{'cpu_number': 13,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 39.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
'key': 'cpu_number',
|
||||
'nice': 0.0,
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 0.0,
|
||||
'total': 61.0,
|
||||
'user': 1.0},
|
||||
{'cpu_number': 14,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 39.0,
|
||||
'idle': 34.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
@@ -1405,13 +1372,43 @@ Quicklook stats:
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 1.0,
|
||||
'total': 61.0,
|
||||
'total': 66.0,
|
||||
'user': 2.0},
|
||||
{'cpu_number': 13,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 34.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
'key': 'cpu_number',
|
||||
'nice': 0.0,
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 0.0,
|
||||
'total': 66.0,
|
||||
'user': 0.0},
|
||||
{'cpu_number': 14,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 35.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
'key': 'cpu_number',
|
||||
'nice': 0.0,
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 0.0,
|
||||
'total': 65.0,
|
||||
'user': 0.0},
|
||||
{'cpu_number': 15,
|
||||
'dpc': None,
|
||||
'guest': 0.0,
|
||||
'guest_nice': 0.0,
|
||||
'idle': 39.0,
|
||||
'idle': 33.0,
|
||||
'interrupt': None,
|
||||
'iowait': 0.0,
|
||||
'irq': 0.0,
|
||||
@@ -1420,9 +1417,9 @@ Quicklook stats:
|
||||
'softirq': 0.0,
|
||||
'steal': 0.0,
|
||||
'system': 1.0,
|
||||
'total': 61.0,
|
||||
'user': 0.0}],
|
||||
'swap': 35.9}
|
||||
'total': 67.0,
|
||||
'user': 1.0}],
|
||||
'swap': 43.2}
|
||||
>>> gl.quicklook.keys()
|
||||
['cpu_name', 'cpu_hz_current', 'cpu_hz', 'cpu', 'percpu', 'mem', 'swap', 'cpu_log_core', 'cpu_phys_core', 'load']
|
||||
>>> gl.quicklook.get("cpu_name")
|
||||
@@ -1472,13 +1469,13 @@ Memswap stats:
|
||||
>>> type(gl.memswap)
|
||||
<class 'glances.plugins.memswap.MemswapPlugin'>
|
||||
>>> gl.memswap
|
||||
{'free': 2751483904,
|
||||
'percent': 35.9,
|
||||
'sin': 3763445760,
|
||||
'sout': 8712749056,
|
||||
'time_since_update': 0.44704747200012207,
|
||||
{'free': 2439843840,
|
||||
'percent': 43.2,
|
||||
'sin': 3786334208,
|
||||
'sout': 9036771328,
|
||||
'time_since_update': 0.4200730323791504,
|
||||
'total': 4294963200,
|
||||
'used': 1543479296}
|
||||
'used': 1855119360}
|
||||
>>> gl.memswap.keys()
|
||||
['total', 'used', 'free', 'percent', 'sin', 'sout', 'time_since_update']
|
||||
>>> gl.memswap.get("total")
|
||||
@@ -1513,10 +1510,10 @@ Use auto_unit() function to generate a human-readable string with the unit:
|
||||
.. code-block:: python
|
||||
|
||||
>>> gl.mem.get("used")
|
||||
9975667720
|
||||
10398616584
|
||||
|
||||
>>> gl.auto_unit(gl.mem.get("used"))
|
||||
9.29G
|
||||
9.68G
|
||||
|
||||
|
||||
Args:
|
||||
@@ -1572,7 +1569,7 @@ Use top_process() function to generate a list of top processes sorted by CPU or
|
||||
.. code-block:: python
|
||||
|
||||
>>> gl.top_process()
|
||||
[{'status': 'S', 'name': 'Isolated Web Co', 'nice': 0, 'memory_info': {'rss': 946630656, 'vms': 3838656512, 'shared': 129568768, 'text': 659456, 'lib': 0, 'data': 1015422976, 'dirty': 0}, 'num_threads': 35, 'cpu_times': {'user': 2295.2, 'system': 143.32, 'children_user': 0.0, 'children_system': 0.0, 'iowait': 0.0}, 'io_counters': [361497600, 0, 361497600, 0, 1, 27462656, 0, 27462656, 0, 1, 128542720, 0, 128542720, 0, 1, 911360, 0, 911360, 0, 1, 218574848, 0, 218574848, 0, 1, 263183360, 65536, 263183360, 65536, 1, 0, 0, 0, 0, 1], 'gids': {'real': 1000, 'effective': 1000, 'saved': 1000}, 'memory_percent': 5.764677652373807, 'cpu_percent': 4.5, 'pid': 9777, 'key': 'pid', 'time_since_update': 0.45049142837524414, 'cmdline': ['/snap/firefox/7967/usr/lib/firefox/firefox', '-contentproc', '-isForBrowser', '-prefsHandle', '0:46458', '-prefMapHandle', '1:282338', '-jsInitHandle', '2:227672', '-parentBuildID', '20260309231353', '-sandboxReporter', '3', '-chrootClient', '4', '-ipcHandle', '5', '-initialChannelId', '{ed7b16d7-31d6-47a1-938a-22845b23b315}', '-parentPid', '8146', '-crashReporter', '6', '-crashHelper', '7', '-greomni', '/snap/firefox/7967/usr/lib/firefox/omni.ja', '-appomni', '/snap/firefox/7967/usr/lib/firefox/browser/omni.ja', '-appDir', '/snap/firefox/7967/usr/lib/firefox/browser', '11', 'tab'], 'username': 'nicolargo'}, {'status': 'S', 'name': 'code', 'nice': 0, 'memory_info': {'rss': 411549696, 'vms': 1500291395584, 'shared': 110428160, 'text': 148103168, 'lib': 0, 'data': 1285394432, 'dirty': 0}, 'num_threads': 25, 'cpu_times': {'user': 248.66, 'system': 20.12, 'children_user': 0.0, 'children_system': 0.0, 'iowait': 0.0}, 'io_counters': [94860288, 143360, 94860288, 143360, 1, 90949632, 27131904, 90941440, 27123712, 1, 59535360, 49152, 59535360, 49152, 1, 587283456, 11059200, 587283456, 11059200, 1, 20062208, 53248, 20062208, 53248, 1, 5320704, 0, 5320704, 0, 1, 35805184, 0, 35805184, 0, 1, 43882496, 1668337664, 43882496, 1668337664, 1, 3762176, 0, 3762176, 0, 1, 708608, 4096, 708608, 4096, 1, 3553280, 0, 3553280, 0, 1, 5195776, 5410816, 5195776, 5410816, 1, 746496, 0, 746496, 0, 1, 595968, 0, 595968, 0, 1], 'gids': {'real': 1000, 'effective': 1000, 'saved': 1000}, 'memory_percent': 2.5062059001947574, 'cpu_percent': 4.5, 'pid': 542807, 'key': 'pid', 'time_since_update': 0.45049142837524414, 'cmdline': ['/snap/code/226/usr/share/code/code', '--type=zygote', '--no-sandbox'], 'username': 'nicolargo'}, {'status': 'S', 'name': 'code', 'nice': 0, 'memory_info': {'rss': 103149568, 'vms': 1513727791104, 'shared': 59764736, 'text': 148103168, 'lib': 0, 'data': 928301056, 'dirty': 0}, 'num_threads': 36, 'cpu_times': {'user': 32.01, 'system': 13.05, 'children_user': 0.2, 'children_system': 0.15, 'iowait': 0.0}, 'io_counters': [90949632, 27131904, 90941440, 27123712, 1], 'gids': {'real': 1000, 'effective': 1000, 'saved': 1000}, 'memory_percent': 0.6281478480891415, 'cpu_percent': 4.5, 'pid': 542716, 'key': 'pid', 'time_since_update': 0.45049142837524414, 'cmdline': ['/snap/code/226/usr/share/code/code', '--no-sandbox', '--force-user-env', '--ozone-platform=x11'], 'username': 'nicolargo'}]
|
||||
[{'io_counters': [2567382016, 14159581184, 2567365632, 14158110720, 1], 'cpu_times': {'user': 9981.68, 'system': 2657.3, 'children_user': 0.43, 'children_system': 2.09, 'iowait': 0.0}, 'cpu_percent': 24.3, 'num_threads': 128, 'nice': 0, 'gids': {'real': 1000, 'effective': 1000, 'saved': 1000}, 'name': 'firefox', 'memory_info': {'rss': 773103616, 'vms': 30421471232, 'shared': 206761984, 'text': 659456, 'lib': 0, 'data': 1177972736, 'dirty': 0}, 'status': 'S', 'memory_percent': 4.707953529580792, 'pid': 8146, 'key': 'pid', 'time_since_update': 0.424365758895874, 'cmdline': ['/snap/firefox/7967/usr/lib/firefox/firefox'], 'username': 'nicolargo'}, {'io_counters': [1325335552, 136383778816, 1325335552, 136383778816, 1], 'cpu_times': {'user': 4199.78, 'system': 2193.81, 'children_user': 1589.83, 'children_system': 256.03, 'iowait': 0.0}, 'cpu_percent': 7.3, 'num_threads': 39, 'nice': 0, 'gids': {'real': 1000, 'effective': 1000, 'saved': 1000}, 'name': 'gnome-shell', 'memory_info': {'rss': 332132352, 'vms': 6148321280, 'shared': 138575872, 'text': 8192, 'lib': 0, 'data': 539172864, 'dirty': 0}, 'status': 'S', 'memory_percent': 2.0225796989240448, 'pid': 5858, 'key': 'pid', 'time_since_update': 0.424365758895874, 'cmdline': ['/usr/bin/gnome-shell'], 'username': 'nicolargo'}, {'io_counters': [9739264, 0, 9739264, 0, 1], 'cpu_times': {'user': 162.26, 'system': 40.02, 'children_user': 0.0, 'children_system': 0.0, 'iowait': 0.0}, 'cpu_percent': 7.3, 'num_threads': 28, 'nice': 0, 'gids': {'real': 1000, 'effective': 1000, 'saved': 1000}, 'name': 'Privileged Cont', 'memory_info': {'rss': 185507840, 'vms': 2845196288, 'shared': 109768704, 'text': 659456, 'lib': 0, 'data': 149467136, 'dirty': 0}, 'status': 'S', 'memory_percent': 1.1296833594074263, 'pid': 8626, 'key': 'pid', 'time_since_update': 0.424365758895874, 'cmdline': ['/snap/firefox/7967/usr/lib/firefox/firefox', '-contentproc', '-isForBrowser', '-prefsHandle', '0:41936', '-prefMapHandle', '1:282338', '-jsInitHandle', '2:227672', '-parentBuildID', '20260309231353', '-sandboxReporter', '3', '-chrootClient', '4', '-ipcHandle', '5', '-initialChannelId', '{24f51226-5684-474c-8f64-d6f4c9722715}', '-parentPid', '8146', '-crashReporter', '6', '-crashHelper', '7', '-greomni', '/snap/firefox/7967/usr/lib/firefox/omni.ja', '-appomni', '/snap/firefox/7967/usr/lib/firefox/browser/omni.ja', '-appDir', '/snap/firefox/7967/usr/lib/firefox/browser', '3', 'tab'], 'username': 'nicolargo'}]
|
||||
|
||||
|
||||
Args:
|
||||
|
||||
Reference in New Issue
Block a user