diff options
author | nicolargo <nicolas@nicolargo.com> | 2023-03-11 11:01:29 +0100 |
---|---|---|
committer | nicolargo <nicolas@nicolargo.com> | 2023-03-11 11:01:29 +0100 |
commit | d28a696fc188499fc50fbe48a7851d5b5b98146b (patch) | |
tree | 27fdb8c5798416df9a9443b783327a75f4b201db /docs/api.rst | |
parent | a798d10ab18ff0c2b10b5a33f4502f4a3438430f (diff) |
Refactor the Cloud plugin, disable it by default in the default configuration file - Related to #2279
Diffstat (limited to 'docs/api.rst')
-rw-r--r-- | docs/api.rst | 956 |
1 files changed, 428 insertions, 528 deletions
diff --git a/docs/api.rst b/docs/api.rst index e67858a9..d6d6596e 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -60,25 +60,6 @@ Get the plugins list:: "uptime", "wifi"] -GET alert ---------- - -Get plugin stats:: - - # curl http://localhost:61208/api/3/alert - [[1675093869.0, - -1, - "WARNING", - "MEM", - 82.83225325565277, - 82.83225325565277, - 82.83225325565277, - 82.83225325565277, - 1, - [], - "", - "memory_percent"]] - GET amps -------- @@ -93,7 +74,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.6673910617828369}, + "timer": 0.8202648162841797}, {"count": 0, "countmax": 20.0, "countmin": None, @@ -102,7 +83,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.667231559753418}] + "timer": 0.820155143737793}] Get a specific field:: @@ -120,7 +101,7 @@ Get a specific item when field matchs the given value:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.6673910617828369}]} + "timer": 0.8202648162841797}]} GET core -------- @@ -150,7 +131,7 @@ Get plugin stats:: "ctx_switches": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 67.7, + "idle": 71.8, "interrupts": 0, "iowait": 0.2, "irq": 0.0, @@ -159,10 +140,10 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "syscalls": 0, - "system": 6.3, + "system": 3.9, "time_since_update": 1, - "total": 31.2, - "user": 25.7} + "total": 29.2, + "user": 24.1} Fields descriptions: @@ -185,7 +166,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/cpu/total - {"total": 31.2} + {"total": 29.2} GET diskio ---------- @@ -230,29 +211,58 @@ GET docker Get plugin stats:: # curl http://localhost:61208/api/3/docker - {"containers": [{"Command": ["docker-entrypoint.sh", "mongod"], + {"containers": [{"Command": ["/whoamI"], + "Id": "12b96990d8485d7cb37dbb54a3fb28207169654191701575f9d6bcf2cfc4c2e4", + "Image": ["emilevauge/whoami:latest"], + "Status": "running", + "Uptime": "1 weeks", + "cpu": {"total": 0.0}, + "cpu_percent": 0.0, + "io": {}, + "io_r": None, + "io_w": None, + "key": "name", + "memory": {}, + "memory_usage": None, + "name": "docker-compose_whoami_1", + "network": {}, + "network_rx": None, + "network_tx": None}, + {"Command": ["/bin/sh", + "-c", + "python3 -m glances -C /etc/glances.conf " + "$GLANCES_OPT"], + "Id": "ca7c2a050209ed12bdc8de20719423b4b6bc819e7f02e7ef0f44ff4e2f3ba0e3", + "Image": ["nicolargo/glances:dev"], + "Status": "running", + "Uptime": "1 weeks", + "cpu": {"total": 0.0}, + "cpu_percent": 0.0, + "io": {}, + "io_r": None, + "io_w": None, + "key": "name", + "memory": {}, + "memory_usage": None, + "name": "docker-compose_monitoring_1", + "network": {}, + "network_rx": None, + "network_tx": None}, + {"Command": ["docker-entrypoint.sh", "mongod"], "Id": "c3a1bb27858df965e1c524c6ef33c0fd26d765cae5bcd90fbe9e662b703a52aa", "Image": ["mongo:latest"], "Status": "running", - "Uptime": "6 hours", + "Uptime": "1 months", "cpu": {"total": 0.0}, "cpu_percent": 0.0, - "io": {"cumulative_ior": 0, - "cumulative_iow": 548864, - "time_since_update": 1}, + "io": {}, "io_r": None, "io_w": None, "key": "name", - "memory": {"cache": None, - "limit": 7836196864, - "max_usage": None, - "rss": None, - "usage": 121462784}, - "memory_usage": 121462784, + "memory": {}, + "memory_usage": None, "name": "docker-mongo_mongo_1", - "network": {"cumulative_rx": 1546897, - "cumulative_tx": 943210, - "time_since_update": 1}, + "network": {}, "network_rx": None, "network_tx": None}, {"Command": ["tini", @@ -262,7 +272,7 @@ Get plugin stats:: "Id": "5aa8f03d6027d00244cf5ce5f4ffe616fd8a31e95ff7091ca02b8d99c00b276c", "Image": ["mongo-express:latest"], "Status": "running", - "Uptime": "6 hours", + "Uptime": "1 months", "cpu": {"total": 0.0}, "cpu_percent": 0.0, "io": {}, @@ -279,7 +289,7 @@ Get plugin stats:: "Id": "3abd51c615968482d9ccff5afc629f267f6dda113ed68b75b432615fae3b49fb", "Image": ["portainer/portainer-ce:2.9.3"], "Status": "running", - "Uptime": "1 weeks", + "Uptime": "1 months", "cpu": {"total": 0.0}, "cpu_percent": 0.0, "io": {}, @@ -292,36 +302,36 @@ Get plugin stats:: "network": {}, "network_rx": None, "network_tx": None}], - "version": {"ApiVersion": "1.41", + "version": {"ApiVersion": "1.42", "Arch": "amd64", - "BuildTime": "2023-01-19T17:34:14.000000000+00:00", - "Components": [{"Details": {"ApiVersion": "1.41", + "BuildTime": "2023-02-01T17:49:08.000000000+00:00", + "Components": [{"Details": {"ApiVersion": "1.42", "Arch": "amd64", - "BuildTime": "2023-01-19T17:34:14.000000000+00:00", + "BuildTime": "2023-02-01T17:49:08.000000000+00:00", "Experimental": "false", - "GitCommit": "6051f14", - "GoVersion": "go1.18.10", + "GitCommit": "d7573ab", + "GoVersion": "go1.19.5", "KernelVersion": "5.15.0-58-generic", "MinAPIVersion": "1.12", "Os": "linux"}, "Name": "Engine", - "Version": "20.10.23"}, - {"Details": {"GitCommit": "5b842e528e99d4d4c1686467debf2bd4b88ecd86"}, + "Version": "23.0.0"}, + {"Details": {"GitCommit": "31aa4358a36870b21a992d3ad2bef29e1d693bec"}, "Name": "containerd", - "Version": "1.6.15"}, + "Version": "1.6.16"}, {"Details": {"GitCommit": "v1.1.4-0-g5fd4c4d"}, "Name": "runc", "Version": "1.1.4"}, {"Details": {"GitCommit": "de40ad0"}, "Name": "docker-init", "Version": "0.19.0"}], - "GitCommit": "6051f14", - "GoVersion": "go1.18.10", + "GitCommit": "d7573ab", + "GoVersion": "go1.19.5", "KernelVersion": "5.15.0-58-generic", "MinAPIVersion": "1.12", "Os": "linux", "Platform": {"Name": "Docker Engine - Community"}, - "Version": "20.10.23"}} + "Version": "23.0.0"}} GET fs ------ @@ -330,13 +340,13 @@ Get plugin stats:: # curl http://localhost:61208/api/3/fs [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 61967261696, + "free": 53523116032, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 73.2, + "percent": 76.8, "size": 243334156288, - "used": 168979439616}, + "used": 177423585280}, {"device_name": "zsfpool", "free": 41811968, "fs_type": "zfs", @@ -355,13 +365,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": 61967261696, + "free": 53523116032, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 73.2, + "percent": 76.8, "size": 243334156288, - "used": 168979439616}]} + "used": 177423585280}]} GET ip ------ @@ -369,17 +379,17 @@ GET ip Get plugin stats:: # curl http://localhost:61208/api/3/ip - {"address": "192.168.1.14", - "gateway": "192.168.1.1", + {"address": "192.168.0.32", + "gateway": "192.168.0.254", "mask": "255.255.255.0", "mask_cidr": 24, - "public_address": "109.210.93.150", + "public_address": "91.166.228.228", "public_info_human": ""} Get a specific field:: # curl http://localhost:61208/api/3/ip/gateway - {"gateway": "192.168.1.1"} + {"gateway": "192.168.0.254"} GET load -------- @@ -387,7 +397,7 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/3/load - {"cpucore": 4, "min1": 1.9677734375, "min15": 1.2421875, "min5": 1.4140625} + {"cpucore": 4, "min1": 0.63525390625, "min15": 1.3359375, "min5": 1.08349609375} Fields descriptions: @@ -399,7 +409,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/load/min1 - {"min1": 1.9677734375} + {"min1": 0.63525390625} GET mem ------- @@ -407,16 +417,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/3/mem - {"active": 2301452288, - "available": 1345298432, - "buffers": 91602944, - "cached": 1984524288, - "free": 1345298432, - "inactive": 4274671616, - "percent": 82.8, - "shared": 603455488, + {"active": 2453286912, + "available": 3052646400, + "buffers": 129122304, + "cached": 3469373440, + "free": 3052646400, + "inactive": 4119760896, + "percent": 61.0, + "shared": 455708672, "total": 7836196864, - "used": 6490898432} + "used": 4783550464} Fields descriptions: @@ -443,13 +453,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/3/memswap - {"free": 5992534016, - "percent": 25.9, - "sin": 2847645696, - "sout": 5540925440, + {"free": 5701988352, + "percent": 29.5, + "sin": 8590413824, + "sout": 14424719360, "time_since_update": 1, "total": 8082419712, - "used": 2089885696} + "used": 2380431360} Fields descriptions: @@ -473,29 +483,29 @@ Get plugin stats:: # curl http://localhost:61208/api/3/network [{"alias": None, - "cumulative_cx": 184715152, - "cumulative_rx": 92357576, - "cumulative_tx": 92357576, - "cx": 8458, + "cumulative_cx": 1100113578, + "cumulative_rx": 550056789, + "cumulative_tx": 550056789, + "cx": 7802, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 4229, + "rx": 3901, "speed": 0, "time_since_update": 1, - "tx": 4229}, + "tx": 3901}, {"alias": None, - "cumulative_cx": 13554125250, - "cumulative_rx": 13227076404, - "cumulative_tx": 327048846, - "cx": 25901, + "cumulative_cx": 35336641046, + "cumulative_rx": 34139736267, + "cumulative_tx": 1196904779, + "cx": 32563, "interface_name": "wlp2s0", "is_up": True, "key": "interface_name", - "rx": 20009, + "rx": 22311, "speed": 0, "time_since_update": 1, - "tx": 5892}] + "tx": 10252}] Fields descriptions: @@ -520,28 +530,29 @@ Get a specific field:: "br-119e6ee04e05", "docker0", "br-87386b77b676", - "vethf503072", "mpqemubr0", "tap-1e376645a40", "br-ef0a06c4e10f", - "veth9a140b2", - "veth9ed6876"]} + "veth9910148", + "veth5e7315e", + "veth24ae93e", + "vethb59ceaa"]} 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": 184715152, - "cumulative_rx": 92357576, - "cumulative_tx": 92357576, - "cx": 8458, + "cumulative_cx": 1100113578, + "cumulative_rx": 550056789, + "cumulative_tx": 550056789, + "cx": 7802, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 4229, + "rx": 3901, "speed": 0, "time_since_update": 1, - "tx": 4229}]} + "tx": 3901}]} GET now ------- @@ -549,7 +560,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/3/now - "2023-01-30 16:51:08 CET" + "2023-03-11 10:42:32 CET" GET percpu ---------- @@ -560,7 +571,7 @@ Get plugin stats:: [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 67.0, + "idle": 21.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", @@ -568,12 +579,12 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 3.0, - "total": 33.0, - "user": 11.0}, + "total": 79.0, + "user": 68.0}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 41.0, + "idle": 83.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", @@ -581,8 +592,8 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 0.0, - "total": 59.0, - "user": 41.0}] + "total": 17.0, + "user": 7.0}] Get a specific field:: @@ -596,30 +607,30 @@ Get plugin stats:: # curl http://localhost:61208/api/3/ports [{"description": "DefaultGateway", - "host": "192.168.1.1", + "host": "192.168.0.254", "indice": "port_0", "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.006011, + "status": 0.004165, "timeout": 3}] Get a specific field:: # curl http://localhost:61208/api/3/ports/host - {"host": ["192.168.1.1"]} + {"host": ["192.168.0.254"]} Get a specific item when field matchs the given value:: - # curl http://localhost:61208/api/3/ports/host/192.168.1.1 - {"192.168.1.1": [{"description": "DefaultGateway", - "host": "192.168.1.1", - "indice": "port_0", - "port": 0, - "refresh": 30, - "rtt_warning": None, - "status": 0.006011, - "timeout": 3}]} + # curl http://localhost:61208/api/3/ports/host/192.168.0.254 + {"192.168.0.254": [{"description": "DefaultGateway", + "host": "192.168.0.254", + "indice": "port_0", + "port": 0, + "refresh": 30, + "rtt_warning": None, + "status": 0.004165, + "timeout": 3}]} GET processcount ---------------- @@ -627,12 +638,12 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/3/processcount - {"pid_max": 0, "running": 1, "sleeping": 332, "thread": 1844, "total": 463} + {"pid_max": 0, "running": 1, "sleeping": 326, "thread": 1637, "total": 396} Get a specific field:: # curl http://localhost:61208/api/3/processcount/total - {"total": 463} + {"total": 396} GET processlist --------------- @@ -640,66 +651,51 @@ GET processlist Get plugin stats:: # curl http://localhost:61208/api/3/processlist - [{"cmdline": ["/snap/multipass/8140/usr/bin/qemu-system-x86_64", - "--enable-kvm", - "-cpu", - "host", - "-nic", - "tap,ifname=tap-1e376645a40,script=no,downscript=no,model=virtio-net-pci,mac=52:54:00:05:05:17", - "-device", - "virtio-scsi-pci,id=scsi0", - "-drive", - "file=/var/snap/multipass/common/data/multipassd/vault/instances/primary/ubuntu-22.04-server-cloudimg-amd64.img,if=none,format=qcow2,discard=unmap,id=hda", - "-device", - "scsi-hd,drive=hda,bus=scsi0.0", - "-smp", - "1", - "-m", - "1024M", - "-qmp", - "stdio", - "-chardev", - "null,id=char0", - "-serial", - "chardev:char0", - "-nographic", - "-cdrom", - "/var/snap/multipass/common/data/multipassd/vault/instances/primary/cloud-init-config.iso", - "-loadvm", - "suspend", - "-machine", - "pc-i440fx-focal"], + [{"cmdline": ["/snap/firefox/2391/usr/lib/firefox/firefox"], "cpu_percent": 0.0, - "cpu_times": [15.8, 8.88, 0.0, 0.0, 0.0], - "gids": [0, 0, 0], - "io_counters": [0, 0, 0, 0, 0], + "cpu_times": [77.73, 21.94, 28.88, 6.46, 0.0], + "gids": [1000, 1000, 1000], + "io_counters": [351327232, 423739392, 0, 0, 0], "key": "pid", - "memory_info": [508997632, 2645762048, 4816896, 5414912, 0, 1256706048, 0], - "memory_percent": 6.49546764628092, - "name": "qemu-system-x86_64", + "memory_info": [448016384, 3489435648, 179822592, 626688, 0, 589619200, 0], + "memory_percent": 5.71726810563191, + "name": "firefox", "nice": 0, - "num_threads": 6, - "pid": 165054, + "num_threads": 104, + "pid": 846720, "status": "S", "time_since_update": 1, - "username": "root"}, - {"cmdline": ["/usr/share/code/code", - "--ms-enable-electron-run-as-node", - "/home/nicolargo/.vscode/extensions/ms-python.vscode-pylance-2023.1.40/dist/server.bundle.js", - "--cancellationReceive=file:9e8ad4331c82252be52c9e10943b0d98e4704856e6", - "--node-ipc", - "--clientProcessId=152377"], + "username": "nicolargo"}, + {"cmdline": ["/snap/firefox/2391/usr/lib/firefox/firefox", + "-contentproc", + "-childID", + "1", + "-isForBrowser", + "-prefsLen", + "31514", + "-prefMapSize", + "238439", + "-jsInitLen", + "246560", + "-parentBuildID", + "20230228074855", + "-appDir", + "/snap/firefox/2391/usr/lib/firefox/browser", + "{0f8147f2-5422-4d6d-9491-68894fb5c106}", + "846720", + "true", + "tab"], "cpu_percent": 0.0, - "cpu_times": [292.89, 21.42, 1.52, 0.16, 0.0], + "cpu_times": [28.89, 5.0, 0.0, 0.0, 0.0], "gids": [1000, 1000, 1000], - "io_counters": [103936000, 573440, 0, 0, 0], + "io_counters": [4248576, 0, 0, 0, 0], "key": "pid", - "memory_info": [444641280, 49868906496, 31858688, 112656384, 0, 718778368, 0], - "memory_percent": 5.674197416385889, - "name": "code", + "memory_info": [405463040, 3183603712, 85282816, 626688, 0, 623808512, 0], + "memory_percent": 5.174232437456028, + "name": "WebExtensions", "nice": 0, - "num_threads": 13, - "pid": 152522, + "num_threads": 20, + "pid": 846991, "status": "S", "time_since_update": 1, "username": "nicolargo"}] @@ -707,229 +703,224 @@ Get plugin stats:: Get a specific field:: # curl http://localhost:61208/api/3/processlist/pid - {"pid": [165054, - 152522, - 5040, - 5246, - 5752, - 5369, + {"pid": [846720, + 846991, 4150, - 10653, - 173071, - 5365, - 173932, - 171502, - 166223, - 180530, - 152377, - 137271, - 176436, - 182287, - 173116, - 184024, - 177108, - 151269, - 178661, - 173149, - 10547, - 168824, - 422, - 5261, - 185474, - 10709, - 186130, - 185886, - 185571, + 847043, + 255919, + 847035, + 255685, + 847039, + 847858, + 255737, + 847051, + 849456, + 836010, + 847733, + 849713, + 285410, + 847007, + 258480, + 4473, + 255627, + 849995, + 850278, + 850213, + 850165, + 255751, + 847507, 6074, - 10612, - 171875, - 178970, - 168735, - 178475, - 42687, - 168734, - 187074, + 255664, + 850348, 4035, - 62850, + 846970, + 4544, + 847508, + 256270, + 422, + 258481, 2512, + 596789, + 255769, + 285072, 95798, - 10732, - 4473, - 4544, - 2721, + 829345, 4585, - 1816, - 152506, - 10632, - 4932, + 255672, 4413, + 285950, + 286011, 4248, - 1672, - 14455, + 789544, + 255906, 3955, - 14458, - 6020, - 5179, - 164782, + 255976, + 829380, + 4932, + 790774, + 2721, + 62850, + 829424, + 1635, + 1, + 789543, 4325, + 4223, + 14455, + 4331, + 4561, 4332, 4625, - 1635, - 4331, - 43005, - 6022, - 4445, - 160043, - 186352, - 4223, - 4352, - 4659, - 4330, - 156821, - 1, - 129101, - 129097, - 2239, - 4263, - 1681, 1660, - 4561, - 156833, - 178639, - 129087, - 178867, - 4214, - 4182, - 1682, + 1681, + 3351, 1876, + 5299, 3944, - 3968, - 4339, - 10557, - 4130, - 1442, + 14458, + 286108, 3934, + 4263, + 4445, 4327, + 4339, 4233, - 96102, - 1655, + 4214, 4137, - 1777, + 2239, + 129087, + 4182, + 129101, 4261, - 4334, + 255632, + 3968, + 830552, + 823483, + 4130, + 4377, + 129097, 1634, + 4352, + 1442, + 255633, + 1777, 17189, - 4485, - 4328, - 10558, - 1873, - 3351, - 17205, - 1617, + 1682, 59511, + 4452, + 706956, + 17205, + 1655, + 219792, + 4659, + 4524, + 4229, + 3971, + 1873, + 117714, + 4330, + 96102, 2179, + 4201, + 285853, + 790786, + 1643, + 1673, 4392, - 3971, - 4166, 3966, 4155, - 4348, + 706252, + 4329, + 1617, + 790709, + 4328, + 3700, 4573, - 4178, - 4050, - 4452, - 4192, - 117714, - 4524, 1675, - 4229, - 6095, + 4485, + 285970, 1661, - 4347, - 4377, - 1673, - 5299, - 152553, - 1643, - 4329, - 42986, - 4335, - 160053, + 4337, + 4050, + 1631, + 4178, + 1666, + 4334, + 4166, + 4348, 4324, - 4314, - 468, + 4335, + 285913, + 4045, + 4347, + 4443, 4173, + 4192, 4212, - 4337, - 4443, - 4201, + 468, 3976, - 129099, - 1676, - 4045, - 1666, 1885, - 1631, + 1676, + 1626, + 4314, 1670, - 3952, - 1443, - 4119, 9703, - 1626, - 129100, 1646, - 3953, - 3700, + 4119, + 1443, + 255649, + 850150, + 3952, + 129099, + 49191, 2020, + 1633, 4162, - 178850, 1441, - 3701, - 178609, - 1633, - 178617, - 178843, - 49191, - 165074, - 186999, - 49179, 14505, - 4579, - 1685, + 49179, + 3953, + 3354, + 129100, 1449, + 1685, + 4579, 1450, - 3354, - 10591, 2472, - 164891, + 3701, + 219931, 49182, - 160052, 1618, - 1803, + 843176, + 850347, 1804, - 10560, 49194, - 42952, - 184504, - 187073, - 42969, - 42937, - 42964, - 4018, + 1803, + 790829, 4323, 2480, 3707, - 4820, + 4018, + 255635, + 285777, + 285877, + 285883, + 285835, + 285843, + 285784, + 285905, 3945, - 2503, + 285898, + 4820, + 839994, 2475, - 181945, |