diff --git a/docs/api.rst b/docs/api.rst index 5b484bb34..7bf319bbe 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -135,6 +135,17 @@ Fields descriptions: * **sort**: Sort key of the top processes (unit is *string*) * **global_msg**: Global alert message (unit is *string*) +POST clear events +----------------- + +Clear all alarms from the list:: + + # curl -H "Content-Type: application/json" -X POST http://localhost:61208/api/4/events/clear/all + +Clear warning alarms from the list:: + + # curl -H "Content-Type: application/json" -X POST http://localhost:61208/api/4/events/clear/warning + GET amps -------- @@ -149,7 +160,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.5055625438690186}, + "timer": 0.6987185478210449}, {"count": 0, "countmax": 20.0, "countmin": None, @@ -158,7 +169,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.5055019855499268}] + "timer": 0.6986277103424072}] Fields descriptions: @@ -186,7 +197,7 @@ Get a specific item when field matches the given value:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.5055625438690186}]} + "timer": 0.6987185478210449}]} GET cloud --------- @@ -273,19 +284,19 @@ Get plugin stats:: # curl http://localhost:61208/api/4/cpu {"cpucore": 16, - "ctx_switches": 42319932, + "ctx_switches": 137225815, "guest": 0.3, - "idle": 93.3, - "interrupts": 40148259, - "iowait": 0.3, + "idle": 92.2, + "interrupts": 109142272, + "iowait": 0.1, "irq": 0.0, "nice": 0.0, - "soft_interrupts": 12769522, + "soft_interrupts": 37379110, "steal": 0.0, "syscalls": 0, - "system": 2.7, - "total": 6.3, - "user": 3.7} + "system": 2.8, + "total": 7.8, + "user": 4.8} Fields descriptions: @@ -318,7 +329,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/cpu/total - {"total": 6.3} + {"total": 7.8} GET diskio ---------- @@ -328,10 +339,10 @@ Get plugin stats:: # curl http://localhost:61208/api/4/diskio [{"disk_name": "nvme0n1", "key": "disk_name", - "read_bytes": 6073849344, - "read_count": 275216, - "write_bytes": 7851971584, - "write_count": 335686}, + "read_bytes": 7395669504, + "read_count": 327840, + "write_bytes": 333108421632, + "write_count": 3182763}, {"disk_name": "nvme0n1p1", "key": "disk_name", "read_bytes": 13124608, @@ -371,10 +382,10 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/diskio/disk_name/value/nvme0n1 {"nvme0n1": [{"disk_name": "nvme0n1", "key": "disk_name", - "read_bytes": 6073849344, - "read_count": 275216, - "write_bytes": 7851971584, - "write_count": 335686}]} + "read_bytes": 7395669504, + "read_count": 327840, + "write_bytes": 333108421632, + "write_count": 3182763}]} GET folders ----------- @@ -401,13 +412,13 @@ Get plugin stats:: # curl http://localhost:61208/api/4/fs [{"device_name": "/dev/mapper/ubuntu--vg-ubuntu--lv", - "free": 847279271936, + "free": 847145574400, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", "percent": 11.1, "size": 1003736440832, - "used": 105394663424}, + "used": 105528360960}, {"device_name": "zsfpool", "free": 41811968, "fs_type": "zfs", @@ -436,13 +447,13 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/fs/mnt_point/value// {"/": [{"device_name": "/dev/mapper/ubuntu--vg-ubuntu--lv", - "free": 847279271936, + "free": 847145574400, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", "percent": 11.1, "size": 1003736440832, - "used": 105394663424}]} + "used": 105528360960}]} GET gpu ------- @@ -515,10 +526,7 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/4/load - {"cpucore": 16, - "min1": 0.80810546875, - "min15": 0.67919921875, - "min5": 0.5791015625} + {"cpucore": 16, "min1": 0.7890625, "min15": 1.13525390625, "min5": 1.03125} Fields descriptions: @@ -530,7 +538,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/load/min1 - {"min1": 0.80810546875} + {"min1": 0.7890625} GET mem ------- @@ -538,16 +546,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/4/mem - {"active": 8381927424, - "available": 8525021184, - "buffers": 557240320, - "cached": 8099041280, - "free": 8525021184, - "inactive": 4797796352, - "percent": 48.1, - "shared": 799027200, + {"active": 5602852864, + "available": 7537451008, + "buffers": 182882304, + "cached": 4173537280, + "free": 7537451008, + "inactive": 4478783488, + "percent": 54.1, + "shared": 919461888, "total": 16422453248, - "used": 7897432064} + "used": 8885002240} Fields descriptions: @@ -574,13 +582,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/4/memswap - {"free": 4293128192, - "percent": 0.0, - "sin": 4096, - "sout": 397312, + {"free": 3367497728, + "percent": 21.6, + "sin": 15257600, + "sout": 927838208, "time_since_update": 1, "total": 4294963200, - "used": 1835008} + "used": 927465472} Fields descriptions: @@ -605,26 +613,26 @@ Get plugin stats:: # curl http://localhost:61208/api/4/network [{"alias": None, "bytes_all": 0, - "bytes_all_gauge": 1628861083, + "bytes_all_gauge": 1899487842, "bytes_recv": 0, - "bytes_recv_gauge": 1563552767, + "bytes_recv_gauge": 1753812149, "bytes_sent": 0, - "bytes_sent_gauge": 65308316, + "bytes_sent_gauge": 145675693, "interface_name": "wlp0s20f3", "key": "interface_name", "speed": 0, - "time_since_update": 0.5118772983551025}, + "time_since_update": 0.7082333564758301}, {"alias": None, "bytes_all": 0, - "bytes_all_gauge": 3211961, + "bytes_all_gauge": 16487653, "bytes_recv": 0, - "bytes_recv_gauge": 666484, + "bytes_recv_gauge": 4257865, "bytes_sent": 0, - "bytes_sent_gauge": 2545477, + "bytes_sent_gauge": 12229788, "interface_name": "mpqemubr0", "key": "interface_name", "speed": 10485760000, - "time_since_update": 0.5118772983551025}] + "time_since_update": 0.7082333564758301}] Fields descriptions: @@ -653,15 +661,15 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/network/interface_name/value/wlp0s20f3 {"wlp0s20f3": [{"alias": None, "bytes_all": 0, - "bytes_all_gauge": 1628861083, + "bytes_all_gauge": 1899487842, "bytes_recv": 0, - "bytes_recv_gauge": 1563552767, + "bytes_recv_gauge": 1753812149, "bytes_sent": 0, - "bytes_sent_gauge": 65308316, + "bytes_sent_gauge": 145675693, "interface_name": "wlp0s20f3", "key": "interface_name", "speed": 0, - "time_since_update": 0.5118772983551025}]} + "time_since_update": 0.7082333564758301}]} GET now ------- @@ -669,7 +677,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/4/now - {"custom": "2024-12-21 15:18:08 CET", "iso": "2024-12-21T15:18:08+01:00"} + {"custom": "2024-12-22 20:02:01 CET", "iso": "2024-12-22T20:02:01+01:00"} Fields descriptions: @@ -679,7 +687,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/now/iso - {"iso": "2024-12-21T15:18:08+01:00"} + {"iso": "2024-12-22T20:02:01+01:00"} GET percpu ---------- @@ -691,7 +699,7 @@ Get plugin stats:: "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 29.0, + "idle": 43.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -700,13 +708,13 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 71.0, + "total": 57.0, "user": 0.0}, {"cpu_number": 1, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 22.0, + "idle": 35.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -714,8 +722,8 @@ Get plugin stats:: "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 6.0, - "total": 78.0, + "system": 11.0, + "total": 65.0, "user": 0.0}] Fields descriptions: @@ -752,7 +760,7 @@ Get plugin stats:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.003142, + "status": 0.003275, "timeout": 3}] Fields descriptions: @@ -780,7 +788,7 @@ Get a specific item when field matches the given value:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.003142, + "status": 0.003275, "timeout": 3}]} GET processcount @@ -789,7 +797,7 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/4/processcount - {"pid_max": 0, "running": 1, "sleeping": 405, "thread": 1809, "total": 536} + {"pid_max": 0, "running": 1, "sleeping": 417, "thread": 1995, "total": 555} Fields descriptions: @@ -802,7 +810,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/processcount/total - {"total": 536} + {"total": 555} GET processlist --------------- @@ -841,19 +849,19 @@ Get plugin stats:: "cpu_times": {"children_system": 0.0, "children_user": 0.0, "iowait": 0.0, - "system": 9.76, - "user": 40.9}, + "system": 23.66, + "user": 158.54}, "gids": {"effective": 0, "real": 0, "saved": 0}, "io_counters": [0, 0, 0, 0, 0], "key": "pid", - "memory_info": {"data": 1401651200, + "memory_info": {"data": 1394343936, "dirty": 0, "lib": 0, - "rss": 829403136, - "shared": 14680064, + "rss": 972099584, + "shared": 4194304, "text": 6172672, - "vms": 3427975168}, - "memory_percent": 5.050421660363128, + "vms": 3956453376}, + "memory_percent": 5.919332327028464, "name": "qemu-system-x86_64", "nice": 0, "num_threads": 5, @@ -867,24 +875,29 @@ Get plugin stats:: "--node-ipc", "--clientProcessId=11100"], "cpu_percent": 0.0, - "cpu_times": {"children_system": 0.12, - "children_user": 0.95, + "cpu_times": {"children_system": 0.15, + "children_user": 1.21, "iowait": 0.0, - "system": 20.81, - "user": 336.82}, + "system": 32.33, + "user": 499.15}, "gids": {"effective": 1000, "real": 1000, "saved": 1000}, - "io_counters": [53645312, - 471040, + "io_counters": [79358976, + 700416, 0, 0, 0, - 409493504, - 79966208, + 26096640, + 3162112, 0, 0, 0, - 20012032, - 3141632, + 465468416, + 109764608, + 0, + 0, + 0, + 14929920, + 0, 0, 0, 0, @@ -893,37 +906,52 @@ Get plugin stats:: 0, 0, 0, - 9629696, + 1587200, + 0, + 0, 0, 0, + 2487296, 0, 0, - 57979904, - 68329472, 0, 0, + 63183872, + 110010368, 0, - 40695808, + 0, + 0, + 7642112, + 0, + 0, + 0, + 0, + 44818432, 415547392, 0, 0, 0, - 30917632, + 34511872, 0, 0, 0, 0, - 2745344, + 4978688, 0, 0, 0, 0, - 616448, + 240640, 0, 0, 0, 0, - 5199872, + 5495808, + 5206016, + 0, + 0, + 0, + 2757632, 0, 0, 0, @@ -933,8 +961,18 @@ Get plugin stats:: 0, 0, 0, - 2153472, - 1007616, + 780288, + 0, + 0, + 0, + 0, + 5883904, + 0, + 0, + 0, + 0, + 2341888, + 2330624, 0, 0, 0, @@ -949,14 +987,14 @@ Get plugin stats:: 0, 0], "key": "pid", - "memory_info": {"data": 835862528, + "memory_info": {"data": 918499328, "dirty": 0, "lib": 0, - "rss": 632705024, - "shared": 69468160, + "rss": 680771584, + "shared": 66584576, "text": 132239360, "vms": 1219821342720}, - "memory_percent": 3.8526827535773536, + "memory_percent": 4.145370814697904, "name": "code", "nice": 0, "num_threads": 14, @@ -993,17 +1031,17 @@ Get plugin stats:: "cpu_times": {"children_system": 0.0, "children_user": 0.0, "iowait": 0.0, - "system": 9.76, - "user": 40.9}, + "system": 23.66, + "user": 158.54}, "io_counters": [0, 0, 0, 0, 0], - "memory_info": {"data": 1401651200, + "memory_info": {"data": 1394343936, "dirty": 0, "lib": 0, - "rss": 829403136, - "shared": 14680064, + "rss": 972099584, + "shared": 4194304, "text": 6172672, - "vms": 3427975168}, - "memory_percent": 5.050421660363128, + "vms": 3956453376}, + "memory_percent": 5.919332327028464, "name": "qemu-system-x86_64", "nice": 0, "nprocs": 1, @@ -1013,38 +1051,49 @@ Get plugin stats:: "time_since_update": 1, "username": "root"}, {"childrens": [11631, - 11100, 11003, - 11819, + 11100, 17962, + 11819, + 293018, + 293017, 10919, + 187970, 11098, 11099, + 187968, + 308704, + 293033, 11056, + 11849, 11382, 11630, - 11849, 10969, 10922, 10921], "cmdline": ["code"], "cpu_percent": 0, - "cpu_times": {"children_system": 83.31, - "children_user": 45.85000000000001, - "system": 264.95, - "user": 1788.3000000000004}, - "io_counters": [53645312, - 471040, + "cpu_times": {"children_system": 715.58, + "children_user": 535.4200000000001, + "system": 554.0999999999999, + "user": 3218.29}, + "io_counters": [79358976, + 700416, + 0, + 0, 0, + 26096640, + 3162112, 0, 0, - 409493504, - 79966208, 0, + 465468416, + 109764608, 0, 0, - 20012032, - 3141632, + 0, + 14929920, + 0, 0, 0, 0, @@ -1053,37 +1102,52 @@ Get plugin stats:: 0, 0, 0, - 9629696, + 1587200, + 0, + 0, + 0, + 0, + 2487296, 0, 0, 0, 0, - 57979904, - 68329472, + 63183872, + 110010368, 0, 0, 0, - 40695808, + 7642112, + 0, + 0, + 0, + 0, + 44818432, 415547392, 0, 0, 0, - 30917632, + 34511872, + 0, + 0, 0, 0, + 4978688, 0, 0, - 2745344, 0, 0, + 240640, 0, 0, - 616448, 0, 0, + 5495808, + 5206016, 0, 0, - 5199872, + 0, + 2757632, 0, 0, 0, @@ -1093,8 +1157,18 @@ Get plugin stats:: 0, 0, 0, - 2153472, - 1007616, + 780288, + 0, + 0, + 0, + 0, + 5883904, + 0, + 0, + 0, + 0, + 2341888, + 2330624, 0, 0, 0, @@ -1108,16 +1182,16 @@ Get plugin stats:: 0, 0, 0], - "memory_info": {"data": 5012049920, - "rss": 3340296192, - "shared": 1143767040, - "text": 1983590400, - "vms": 13531000860672}, - "memory_percent": 20.33981246015602, + "memory_info": {"data": 6544048128, + "rss": 3936104448, + "shared": 1411268608, + "text": 2777026560, + "vms": 20822883397632}, + "memory_percent": 23.967822520544278, "name": "code", "nice": 0, - "nprocs": 15, - "num_threads": 222, + "nprocs": 21, + "num_threads": 278, "pid": "_", "status": "S", "time_since_update": 1, @@ -1153,19 +1227,19 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/4/quicklook - {"cpu": 6.3, + {"cpu": 7.8, "cpu_hz": 4475000000.0, - "cpu_hz_current": 1142551500.0, + "cpu_hz_current": 955112812.4999999, "cpu_log_core": 16, "cpu_name": "13th Gen Intel(R) Core(TM) i7-13620H", "cpu_phys_core": 10, - "load": 4.2, - "mem": 48.1, + "load": 7.1, + "mem": 54.1, "percpu": [{"cpu_number": 0, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 29.0, + "idle": 43.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1174,13 +1248,13 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 71.0, + "total": 57.0, "user": 0.0}, {"cpu_number": 1, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 22.0, + "idle": 35.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1188,14 +1262,14 @@ Get plugin stats:: "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 6.0, - "total": 78.0, + "system": 11.0, + "total": 65.0, "user": 0.0}, {"cpu_number": 2, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 29.0, + "idle": 41.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1203,14 +1277,14 @@ Get plugin stats:: "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 0.0, - "total": 71.0, - "user": 0.0}, + "system": 2.0, + "total": 59.0, + "user": 1.0}, {"cpu_number": 3, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 29.0, + "idle": 44.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1219,13 +1293,13 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 71.0, + "total": 56.0, "user": 0.0}, {"cpu_number": 4, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 28.0, + "idle": 29.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1233,14 +1307,14 @@ Get plugin stats:: "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 0.0, - "total": 72.0, - "user": 1.0}, + "system": 3.0, + "total": 71.0, + "user": 12.0}, {"cpu_number": 5, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 29.0, + "idle": 43.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1249,28 +1323,28 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 71.0, + "total": 57.0, "user": 0.0}, {"cpu_number": 6, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 11.0, + "idle": 25.0, "interrupt": None, - "iowait": 2.0, + "iowait": 1.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 11.0, - "total": 89.0, - "user": 7.0}, + "system": 12.0, + "total": 75.0, + "user": 4.0}, {"cpu_number": 7, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 29.0, + "idle": 43.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1279,13 +1353,13 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 71.0, - "user": 0.0}, + "total": 57.0, + "user": 1.0}, {"cpu_number": 8, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 30.0, + "idle": 42.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1293,14 +1367,14 @@ Get plugin stats:: "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 0.0, - "total": 70.0, - "user": 0.0}, + "system": 1.0, + "total": 58.0, + "user": 2.0}, {"cpu_number": 9, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 29.0, + "idle": 44.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1309,13 +1383,13 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 71.0, + "total": 56.0, "user": 0.0}, {"cpu_number": 10, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 29.0, + "idle": 43.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1324,13 +1398,13 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 71.0, + "total": 57.0, "user": 1.0}, {"cpu_number": 11, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 30.0, + "idle": 44.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1339,13 +1413,13 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 70.0, + "total": 56.0, "user": 0.0}, {"cpu_number": 12, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 29.0, + "idle": 43.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1353,29 +1427,29 @@ Get plugin stats:: "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 0.0, - "total": 71.0, + "system": 1.0, + "total": 57.0, "user": 1.0}, {"cpu_number": 13, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 30.0, + "idle": 43.0, "interrupt": None, - "iowait": 1.0, + "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 70.0, - "user": 1.0}, + "total": 57.0, + "user": 0.0}, {"cpu_number": 14, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 29.0, + "idle": 43.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1383,14 +1457,14 @@ Get plugin stats:: "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 0.0, - "total": 71.0, - "user": 0.0}, + "system": 1.0, + "total": 57.0, + "user": 1.0}, {"cpu_number": 15, "dpc": None, "guest": 0.0, "guest_nice": 0.0, - "idle": 30.0, + "idle": 42.0, "interrupt": None, "iowait": 0.0, "irq": 0.0, @@ -1398,10 +1472,10 @@ Get plugin stats:: "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 0.0, - "total": 70.0, - "user": 0.0}], - "swap": 0.0} + "system": 1.0, + "total": 58.0, + "user": 2.0}], + "swap": 21.6} Fields descriptions: @@ -1439,7 +1513,7 @@ Get plugin stats:: "label": "Ambient", "type": "temperature_core", "unit": "C", - "value": 36, + "value": 35, "warning": 0}, {"critical": None, "key": "label", @@ -1507,7 +1581,7 @@ Get a specific item when field matches the given value:: "label": "Ambient", "type": "temperature_core", "unit": "C", - "value": 36, + "value": 35, "warning": 0}]} GET smart @@ -1551,7 +1625,7 @@ GET uptime Get plugin stats:: # curl http://localhost:61208/api/4/uptime - "2:10:00" + "1 day, 6:53:52" GET version ----------- @@ -1559,7 +1633,7 @@ GET version Get plugin stats:: # curl http://localhost:61208/api/4/version - "4.3.0_dev05" + "4.3.0_dev06" GET vms ------- @@ -1577,7 +1651,7 @@ Get plugin stats:: "load_1min": 0, "load_5min": 0, "memory_total": 1002471424, - "memory_usage": 286875648, + "memory_usage": 298512384, "name": "upstanding-sparrow", "release": "Ubuntu 24.04.1 LTS", "status": "running"}] @@ -1616,7 +1690,7 @@ Get a specific item when field matches the given value:: "load_1min": 0, "load_5min": 0, "memory_total": 1002471424, - "memory_usage": 286875648, + "memory_usage": 298512384, "name": "upstanding-sparrow", "release": "Ubuntu 24.04.1 LTS", "status": "running"}]} @@ -1628,8 +1702,8 @@ Get plugin stats:: # curl http://localhost:61208/api/4/wifi [{"key": "ssid", - "quality_level": -62.0, - "quality_link": 48.0, + "quality_level": -64.0, + "quality_link": 46.0, "ssid": "wlp0s20f3"}] Get a specific field:: @@ -1641,8 +1715,8 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/wifi/ssid/value/wlp0s20f3 {"wlp0s20f3": [{"key": "ssid", - "quality_level": -62.0, - "quality_link": 48.0, + "quality_level": -64.0, + "quality_link": 46.0, "ssid": "wlp0s20f3"}]} GET all stats @@ -1687,34 +1761,34 @@ GET stats history History of a plugin:: # curl http://localhost:61208/api/4/cpu/history - {"system": [["2024-12-21T15:18:09.922465", 2.7], - ["2024-12-21T15:18:11.204875", 0.7], - ["2024-12-21T15:18:12.217334", 0.7]], - "user": [["2024-12-21T15:18:09.922463", 3.7], - ["2024-12-21T15:18:11.204873", 0.7], - ["2024-12-21T15:18:12.217332", 0.7]]} + {"system": [["2024-12-22T20:02:02.055860", 2.8], + ["2024-12-22T20:02:03.428547", 1.8], + ["2024-12-22T20:02:04.446309", 1.8]], + "user": [["2024-12-22T20:02:02.055856", 4.8], + ["2024-12-22T20:02:03.428543", 2.9], + ["2024-12-22T20:02:04.446306", 2.9]]} Limit history to last 2 values:: # curl http://localhost:61208/api/4/cpu/history/2 - {"system": [["2024-12-21T15:18:11.204875", 0.7], - ["2024-12-21T15:18:12.217334", 0.7]], - "user": [["2024-12-21T15:18:11.204873", 0.7], - ["2024-12-21T15:18:12.217332", 0.7]]} + {"system": [["2024-12-22T20:02:03.428547", 1.8], + ["2024-12-22T20:02:04.446309", 1.8]], + "user": [["2024-12-22T20:02:03.428543", 2.9], + ["2024-12-22T20:02:04.446306", 2.9]]} History for a specific field:: # curl http://localhost:61208/api/4/cpu/system/history - {"system": [["2024-12-21T15:18:08.819272", 2.7], - ["2024-12-21T15:18:09.922465", 2.7], - ["2024-12-21T15:18:11.204875", 0.7], - ["2024-12-21T15:18:12.217334", 0.7]]} + {"system": [["2024-12-22T20:02:00.901270", 2.8], + ["2024-12-22T20:02:02.055860", 2.8], + ["2024-12-22T20:02:03.428547", 1.8], + ["2024-12-22T20:02:04.446309", 1.8]]} Limit history for a specific field to last 2 values:: # curl http://localhost:61208/api/4/cpu/system/history - {"system": [["2024-12-21T15:18:11.204875", 0.7], - ["2024-12-21T15:18:12.217334", 0.7]]} + {"system": [["2024-12-22T20:02:03.428547", 1.8], + ["2024-12-22T20:02:04.446309", 1.8]]} GET limits (used for thresholds) -------------------------------- diff --git a/docs/man/glances.1 b/docs/man/glances.1 index dacd8f19a..300d331ce 100644 --- a/docs/man/glances.1 +++ b/docs/man/glances.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "GLANCES" "1" "Dec 21, 2024" "4.3.0_dev05" "Glances" +.TH "GLANCES" "1" "Dec 22, 2024" "4.3.0_dev06" "Glances" .SH NAME glances \- An eye on your system .SH SYNOPSIS diff --git a/glances/outputs/glances_stdout_apidoc.py b/glances/outputs/glances_stdout_apidoc.py index 4800cf57e..b7e6d76df 100644 --- a/glances/outputs/glances_stdout_apidoc.py +++ b/glances/outputs/glances_stdout_apidoc.py @@ -316,6 +316,21 @@ def print_limits(stats): print('') +def print_plugin_post_events(): + sub_title = 'POST clear events' + print(sub_title) + print('-' * len(sub_title)) + print('') + print('Clear all alarms from the list::') + print('') + print(f' # curl -H "Content-Type: application/json" -X POST {API_URL}/events/clear/all') + print('') + print('Clear warning alarms from the list::') + print('') + print(f' # curl -H "Content-Type: application/json" -X POST {API_URL}/events/clear/warning') + print('') + + class GlancesStdoutApiDoc: """This class manages the fields description display.""" @@ -344,6 +359,8 @@ def update(self, stats, duration=1): stat = stats.get_plugin(plugin) print_plugin_stats(plugin, stat) print_plugin_description(plugin, stat) + if plugin == 'alert': + print_plugin_post_events() stat_export = stat.get_export() if stat_export is None or stat_export == [] or stat_export == {}: