diff options
author | nicolargo <nicolas@nicolargo.com> | 2022-10-23 11:33:23 +0200 |
---|---|---|
committer | nicolargo <nicolas@nicolargo.com> | 2022-10-23 11:33:23 +0200 |
commit | 018fc8ce4c2ef7d24bc1b08f1baeed690d42c6ee (patch) | |
tree | bb38c7890889d7cead509ee6fa5fad875c789eae /docs/api.rst | |
parent | b7641a18eb5f7c3686220eb7bc372da733b502ca (diff) |
Update docs
Diffstat (limited to 'docs/api.rst')
-rw-r--r-- | docs/api.rst | 768 |
1 files changed, 375 insertions, 393 deletions
diff --git a/docs/api.rst b/docs/api.rst index 21613f3a..0b92372d 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -74,7 +74,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 1.3143589496612549}, + "timer": 0.8619787693023682}, {"count": 0, "countmax": 20.0, "countmin": None, @@ -83,7 +83,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 1.3141794204711914}] + "timer": 0.8618190288543701}] Get a specific field:: @@ -101,7 +101,7 @@ Get a specific item when field matchs the given value:: "refresh": 3.0, "regex": True, "result": None, - "timer": 1.3143589496612549}]} + "timer": 0.8619787693023682}]} GET core -------- @@ -131,19 +131,19 @@ Get plugin stats:: "ctx_switches": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 62.9, + "idle": 24.9, "interrupts": 0, - "iowait": 0.5, + "iowait": 0.2, "irq": 0.0, "nice": 0.0, "soft_interrupts": 0, "softirq": 0.2, "steal": 0.0, "syscalls": 0, - "system": 7.3, + "system": 4.9, "time_since_update": 1, - "total": 39.9, - "user": 29.1} + "total": 74.5, + "user": 69.9} Fields descriptions: @@ -166,7 +166,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/cpu/total - {"total": 39.9} + {"total": 74.5} GET diskio ---------- @@ -205,6 +205,39 @@ Get a specific item when field matchs the given value:: "write_bytes": 0, "write_count": 0}]} +GET docker +---------- + +Get plugin stats:: + + # curl http://localhost:61208/api/3/docker + [{"Command": ["/entrypoint.sh", "telegraf"], + "Id": "9230f84acadbb7bc8c087d0827389c9a87bb7c7022a1a299dcf4a5f3a441f1d3", + "Image": ["telegraf:latest"], + "Status": "running", + "Uptime": "23 hours", + "cpu_percent": 0.0, + "io_r": None, + "io_w": None, + "key": "name", + "memory_usage": 30109696, + "name": "telegraf", + "network_rx": None, + "network_tx": None}, + {"Command": ["/run.sh"], + "Id": "09d96704c3e6b6cb21657d990e3c8ae1e44bac779ded141efb8fed899563dd66", + "Image": ["grafana/grafana:latest"], + "Status": "running", + "Uptime": "23 hours", + "cpu_percent": 0.0, + "io_r": None, + "io_w": None, + "key": "name", + "memory_usage": None, + "name": "grafana", + "network_rx": None, + "network_tx": None}] + GET fs ------ @@ -212,13 +245,13 @@ Get plugin stats:: # curl http://localhost:61208/api/3/fs [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 75419246592, + "free": 74878619648, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 67.3, + "percent": 67.6, "size": 243334156288, - "used": 155527454720}, + "used": 156068081664}, {"device_name": "zsfpool", "free": 41811968, "fs_type": "zfs", @@ -237,13 +270,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": 75419246592, + "free": 74878619648, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 67.3, + "percent": 67.6, "size": 243334156288, - "used": 155527454720}]} + "used": 156068081664}]} GET ip ------ @@ -269,10 +302,7 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/3/load - {"cpucore": 4, - "min1": 2.3291015625, - "min15": 1.5380859375, - "min5": 1.7373046875} + {"cpucore": 4, "min1": 1.9013671875, "min15": 1.33642578125, "min5": 1.3125} Fields descriptions: @@ -284,7 +314,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/load/min1 - {"min1": 2.3291015625} + {"min1": 1.9013671875} GET mem ------- @@ -292,16 +322,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/3/mem - {"active": 2978480128, - "available": 3161673728, - "buffers": 244125696, - "cached": 3262550016, - "free": 3161673728, - "inactive": 3275505664, - "percent": 59.7, - "shared": 586371072, + {"active": 2402537472, + "available": 2379784192, + "buffers": 196329472, + "cached": 2714746880, + "free": 2379784192, + "inactive": 4052148224, + "percent": 69.6, + "shared": 498401280, "total": 7836188672, - "used": 4674514944} + "used": 5456404480} Fields descriptions: @@ -328,13 +358,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/3/memswap - {"free": 7162478592, - "percent": 11.4, - "sin": 109473792, - "sout": 1032638464, + {"free": 5717925888, + "percent": 29.3, + "sin": 949923840, + "sout": 3776933888, "time_since_update": 1, "total": 8082419712, - "used": 919941120} + "used": 2364493824} Fields descriptions: @@ -358,29 +388,29 @@ Get plugin stats:: # curl http://localhost:61208/api/3/network [{"alias": None, - "cumulative_cx": 113157324, - "cumulative_rx": 56578662, - "cumulative_tx": 56578662, - "cx": 7360, + "cumulative_cx": 214561084, + "cumulative_rx": 107280542, + "cumulative_tx": 107280542, + "cx": 3358, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 3680, + "rx": 1679, "speed": 0, "time_since_update": 1, - "tx": 3680}, + "tx": 1679}, {"alias": None, - "cumulative_cx": 2969111409, - "cumulative_rx": 2797340945, - "cumulative_tx": 171770464, - "cx": 29759, + "cumulative_cx": 3952434571, + "cumulative_rx": 3668401035, + "cumulative_tx": 284033536, + "cx": 32812, "interface_name": "wlp2s0", "is_up": True, "key": "interface_name", - "rx": 21778, + "rx": 22662, "speed": 0, "time_since_update": 1, - "tx": 7981}] + "tx": 10150}] Fields descriptions: @@ -403,23 +433,26 @@ Get a specific field:: "br_grafana", "br-119e6ee04e05", "docker0", - "mpqemubr0"]} + "mpqemubr0", + "veth48f76fe", + "vethacd7bac", + "veth1575688"]} 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": 113157324, - "cumulative_rx": 56578662, - "cumulative_tx": 56578662, - "cx": 7360, + "cumulative_cx": 214561084, + "cumulative_rx": 107280542, + "cumulative_tx": 107280542, + "cx": 3358, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 3680, + "rx": 1679, "speed": 0, "time_since_update": 1, - "tx": 3680}]} + "tx": 1679}]} GET now ------- @@ -427,7 +460,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/3/now - "2022-10-17 23:12:12 CEST" + "2022-10-23 11:33:05 CEST" GET percpu ---------- @@ -438,29 +471,29 @@ Get plugin stats:: [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 58.5, - "iowait": 0.7, + "idle": 45.2, + "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 10.9, - "total": 41.5, - "user": 29.9}, + "system": 5.8, + "total": 54.8, + "user": 49.0}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 72.1, - "iowait": 0.0, + "idle": 33.3, + "iowait": 1.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 8.8, - "total": 27.9, - "user": 19.0}] + "system": 4.8, + "total": 66.7, + "user": 61.0}] Get a specific field:: @@ -479,7 +512,7 @@ Get plugin stats:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.005792, + "status": 0.006008, "timeout": 3}] Get a specific field:: @@ -496,7 +529,7 @@ Get a specific item when field matchs the given value:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.005792, + "status": 0.006008, "timeout": 3}]} GET processcount @@ -505,12 +538,12 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/3/processcount - {"pid_max": 0, "running": 2, "sleeping": 275, "thread": 1380, "total": 408} + {"pid_max": 0, "running": 3, "sleeping": 316, "thread": 1616, "total": 389} Get a specific field:: # curl http://localhost:61208/api/3/processcount/total - {"total": 408} + {"total": 389} GET processlist --------------- @@ -518,51 +551,37 @@ GET processlist Get plugin stats:: # curl http://localhost:61208/api/3/processlist - [{"cmdline": ["/snap/firefox/1877/usr/lib/firefox/firefox", - "-contentproc", - "-childID", - "4", - "-isForBrowser", - "-prefsLen", - "35977", - "-prefMapSize", - "236080", - "-jsInitLen", - "246848", - "-parentBuildID", - "20220922230616", - "-appDir", - "/snap/firefox/1877/usr/lib/firefox/browser", - "{8b6f29ad-9cbd-4eac-aac5-a3a7552fe4c0}", - "4281", - "true", - "tab"], + [{"cmdline": ["/snap/firefox/1943/usr/lib/firefox/firefox"], "cpu_percent": 0.0, - "cpu_times": pcputimes(user=698.64, system=134.67, children_user=0.0, children_system=0.0, iowait=0.0), + "cpu_times": pcputimes(user=126.06, system=45.58, children_user=54.98, children_system=9.9, iowait=0.0), "gids": pgids(real=1000, effective=1000, saved=1000), - "io_counters": [15293440, 0, 0, 0, 0], + "io_counters": [342231040, 161927168, 0, 0, 0], "key": "pid", - "memory_info": pmem(rss=456249344, vms=3429462016, shared=94203904, text=634880, lib=0, data=830988288, dirty=0), - "memory_percent": 5.822337402751091, - "name": "WebExtensions", + "memory_info": pmem(rss=462270464, vms=11884843008, shared=177340416, text=634880, lib=0, data=672956416, dirty=0), + "memory_percent": 5.899174756368092, + "name": "firefox", "nice": 0, - "num_threads": 21, - "pid": 4719, + "num_threads": 99, + "pid": 252940, "status": "S", "time_since_update": 1, "username": "nicolargo"}, - {"cmdline": ["/snap/firefox/1877/usr/lib/firefox/firefox"], + {"cmdline": ["/usr/share/code/code", + "--ms-enable-electron-run-as-node", + "/home/nicolargo/.vscode/extensions/visualstudioexptteam.intellicode-api-usage-examples-0.2.5/dist/server/server.js", + "--node-ipc", + "--clientProcessId=145462"], "cpu_percent": 0.0, - "cpu_times": pcputimes(user=3579.74, system=1266.77, children_user=3450.07, children_system=675.16, iowait=0.0), + "cpu_times": pcputimes(user=60.67, system=5.31, children_user=0.0, children_system=0.0, iowait=0.0), "gids": pgids(real=1000, effective=1000, saved=1000), - "io_counters": [1342131200, 4212867072, 0, 0, 0], + "io_counters": [34549760, 0, 0, 0, 0], "key": "pid", - "memory_info": pmem(rss=449769472, vms=13370167296, shared=140492800, text=634880, lib=0, data=1428529152, dirty=0), - "memory_percent": 5.739645774572795, - "name": "firefox", + "memory_info": pmem(rss=371904512, vms=49825730560, shared=29093888, text=112652288, lib=0, data=611106816, dirty=0), + "memory_percent": 4.745987208410083, + "name": "code", "nice": 0, - "num_threads": 147, - "pid": 4281, + "num_threads": 12, + "pid": 149099, "status": "S", "time_since_update": 1, "username": "nicolargo"}] @@ -570,178 +589,221 @@ Get plugin stats:: Get a specific field:: # curl http://localhost:61208/api/3/processlist/pid - {"pid": [4719, - 4281, - 17308, - 17501, - 4494, - 107498, + {"pid": [252940, + 149099, + 253132, + 253182, + 171484, + 145411, 3549, - 4498, + 253186, + 145667, + 145462, + 255521, 5818, 17347, - 132804, - 4463, - 107499, - 19717, - 17233, - 107901, + 254148, + 253576, + 17308, + 51440, + 253147, + 256120, + 17501, + 145347, + 145461, 11646, + 255847, + 255737, + 255929, + 145381, + 145527, + 19717, + 171449, + 256140, + 253654, 17346, - 134243, - 109608, - 134024, - 17274, - 134358, - 9453, 2245, - 133063, + 58814, 4055, 3499, - 134578, - 5126, - 17754, + 107901, + 253071, + 145488, + 187565, + 256109, + 158286, + 158432, + 1405, + 255947, 3958, - 58814, - 17755, - 17566, - 17373, - 4440, + 171477, + 158438, + 145390, + 171447, + 171486, 3844, - 51440, - 5659, - 2429, + 225985, 3651, - 1405, - 17292, - 4062, + 17373, + 1567, + 17754, + 2429, + 145777, + 107498, + 17755, + 4977, 3364, - 1615, 3627, + 1369, + 17566, 3743, + 4062, + 145351, + 107499, + 226110, 3744, - 4977, + 109608, + 1, 3737, - 1567, - 1381, - 3806, + 1391, + 145352, + 3528, 3663, - 1369, - 1539, - 2371, + 3929, 1945, - 17237, + 3618, + 226149, + 1381, + 1587, + 2371, + 1415, 2412, - 1391, 3592, - 1, - 1587, - 3760, - 3618, + 3345, + 3806, 4087, - 1415, - 49142, - 17238, - 3929, - 3742, 2917, - 133194, - 3528, - 3739, - 49148, - 51420, 2187, - 3444, - 3345, - 3736, - 16698, + 1615, 3557, - 3891, - 3750, + 3736, + 3739, 3353, - 3745, + 3760, + 3742, + 3750, + 17292, + 1416, 3637, + 3891, + 3745, 1593, - 1416, - 1487, - 3817, 1352, - 1917, - 1412, + 1539, + 16698, + 180852, + 17237, + 3817, + 51420, + 1368, + 3444, + 11667, + 1487, 14997, - 4518, - 2405, - 1408, + 1412, + 1917, + 3697, + 3905, + 3378, 3599, 3755, - 3569, - 15018, - 3943, - 3905, - 3741, - 54676, - 1368, + 1408, + 3799, 1392, - 3697, - 3380, - 3373, - 3378, - 2406, - 3547, - 3588, - 129936, - 3804, - 1375, 3813, + 3741, + 3373, + 17238, + 3380, + 3943, + 3569, + 15018, + 145611, 3604, - 3753, - 3799, - 3734, - 3747, - 11667, - 3633, 1407, + 1375, 3583, - 3729, + 3734, + 3747, + 3588, + 3547, + 3753, 3748, - 54624, - 3385, - 3437, + 3804, + 17258, + 3729, + 3633, + 4518, + 2405, 3616, - 1397, 3361, - 2920, - 1399, - 17516, + 1397, + 3437, + 3385, + 1365, + 2406, 3362, + 54624, 3517, - 3556, - 1365, + 54676, + 1399, + 158411, + 158387, + 158264, 1360, + 3556, + 17516, 1743, 1367, - 1176, + 2920, 1377, + 1176, 1470, + 181215, 3953, + 256092, 58637, - 17258, - 134554, - 3221, + 145367, 58407, 54523, + 181225, + 181218, 1363, + 145354, + 3221, + 158229, + 158358, + 158222, + 158241, + 158369, 4187, - 3354, 1353, - 134577, - 3425, + 158207, + 158200, + 158180, + 181228, + 256139, + 158248, 2208, 3733, - 1485, - 2252, + 158187, + 3354, + 3425, 58639, 2226, + 2252, + 1485, + 181221, 2, 3, 4, @@ -875,9 +937,7 @@ Get a specific field:: 2266, 3584, 17240, - 48942, - 48943, - 48945, + 17274, 58642, 58643, 58644, @@ -887,140 +947,62 @@ Get a specific field:: 58648, 58649, 58650, - 119746, - 121888, - 125962, - 127836, - 127858, - 128360, - 128474, - 128785, - 129047, - 129124, - 129249, - 129890, - 129929, - 130063, - 130438, - 132594, - 132595, - 132823, - 132862, - 132933, - 132934, - 132935, - 132936, - 132937, - 132938, - 132939, - 132945, - 132946, - 132947, - 132948, - 132949, - 132950, - 132951, - 132952, - 132953, - 132954, - 132955, - 132956, - 132957, - 132958, - 132959, - 132960, - 132961, - 132962, - 132963, - 132964, - 132965, - 132966, - 132967, - 132968, - 132969, - 132970, - 132971, - 132972, - 132973, - 132974, - 132975, - 132976, - 132977, - 132978, - 132979, - 132980, - 132981, - 132982, - 132983, - 132984, - 132985, - 132986, - 132987, - 132988, - 132989, - 132990, - 132991, - 132992, - 132993, - 132994, - 132995, - 132996, - 132997, - 132998, - 132999, - 133000, - 133001, - 133002, - 133003, - 133004, - 133005, - 133006, - 133007, - 133009, - 133206]} + 154774, + 154775, + 154777, + 225705, + 225706, + 225707, + 225708, + 225709, + 225753, + 235957, + 236709, + 249540, + 250997, + 251975, + 252458, + 252699, + 252705, + 252917, + 254032, + 254291, + 254340, + 254659, + 254802, + 254981, + 255100, + 255247, + 255370, + 255510, + 255840, + 256124, + 256129]} Get a specific item when field matchs the given value:: - # curl http://localhost:61208/api/3/processlist/pid/4719 - {"4719": [{"cmdline": ["/snap/firefox/1877/usr/lib/firefox/firefox", - "-contentproc", - "-childID", - "4", - "-isForBrowser", - "-prefsLen", - "35977", - "-prefMapSize", - "236080", - "-jsInitLen", - "246848", - "-parentBuildID", - "20220922230616", - "-appDir", - "/snap/firefox/1877/usr/lib/firefox/browser", - "{8b6f29ad-9cbd-4eac-aac5-a3a7552fe4c0}", - "4281", - "true", - "tab"], - "cpu_percent": 0.0, - "cpu_times": [698.64, 134.67, 0.0, 0.0, 0.0], - "gids": [1000, 1000, 1000], - "io_counters": [15293440, 0, 0, 0, 0], - "key": "pid", - "memory_info": [456249344, - 3429462016, - 94203904, - 634880, - 0, - 830988288, - 0], - "memory_percent": 5.822337402751091, - "name": "WebExtensions", - "nice": 0, - "num_threads": 21, - "pid": 4719, - "status": "S", - "time_since_update": 1, - "username": "nicolargo"}]} + # curl http://localhost:61208/api/3/processlist/pid/252940 + {"252940": [{"cmdline": ["/snap/firefox/1943/usr/lib/firefox/firefox"], + "cpu_percent": 0.0, + "cpu_times": [126.06, 45.58, 54.98, 9.9, 0.0], + "gids": [1000, 1000, 1000], + "io_counters": [342231040, 161927168, 0, 0, 0], + "key": "pid", + "memory_info": [462270464, + 11884843008, + 177340416, + 634880, + 0, + 672956416, + 0], + "memory_percent": 5.899174756368092, + "name": "firefox", + "nice": 0, + "num_threads": 99, + "pid": 252940, + "status": "S", + "time_since_update": 1, + "username": "nicolargo"}]} GET psutilversion ----------------- @@ -1036,69 +1018,69 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/3/quicklook - {"cpu": 39.9, + {"cpu": 74.5, "cpu_hz": 1700000000.0, - "cpu_hz_current": 1299103000.0, + "cpu_hz_current": 1696048499.9999998, "cpu_name": "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz", - "mem": 59.7, + "mem": 69.6, "percpu": [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 58.5, - "iowait": 0.7, + "idle": 45.2, + "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 10.9, - "total": 41.5, - "user": 29.9}, + "system": 5.8, + "total": 54.8, + "user": 49.0}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 72.1, - "iowait": 0.0, + "idle": 33.3, + "iowait": 1.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 8.8, - "total": 27.9, - "user": 19.0}, + "system": 4.8, + "total": 66.7, + "user": 61.0}, {"cpu_number": 2, "guest": 0.0, "guest_nice": 0.0, - "idle": 59.7, - "iowait": 1.3, + "idle": 13.2, + "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, - "softirq": 0.0, + "softirq": 0.9, "steal": 0.0, - "system": 3.4, - "total": 40.3, - "user": 35.6}, + "system": 0.9, + "total": 86.8, + "user": 84.9}, {"cpu_number": 3, "guest": 0.0, "guest_nice": 0.0, - "idle": 49.3, + "idle": 9.6, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, - "softirq": 0.7, + "softirq": 0.0, "steal": 0.0, - "system": 7.3, - "total": 50.7, - "user": 42.7}], - "swap": 11.4} + "system": 1.9, + "total": 90.4, + "user": 88.5}], |