api.rst 39.7 KB
Newer Older
A
Alessio Sergi 已提交
1 2
.. _api:

N
nicolargo 已提交
3 4
API (Restfull/JSON) documentation
=================================
A
Alessio Sergi 已提交
5

N
nicolargo 已提交
6
The Glances Restfull/API server could be ran using the following command line:
A
Alessio Sergi 已提交
7

N
nicolargo 已提交
8
.. code-block:: bash
A
Alessio Sergi 已提交
9

N
nicolargo 已提交
10 11 12 13
    # glances -w --disable-webui

Note: Change request URL api/3 by api/2 if you use Glances 2.x.

N
nicolargo 已提交
14
GET plugins list
N
nicolargo 已提交
15 16
----------------

N
nicolargo 已提交
17
Get the plugins list::
N
nicolargo 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

    # curl http://localhost:61208/api/3/pluginslist
    ['alert',
     'amps',
     'cloud',
     'connections',
     'core',
     'cpu',
     'diskio',
     'docker',
     'folders',
     'fs',
     'gpu',
     'help',
     'ip',
     'irq',
     'load',
     'mem',
     'memswap',
     'network',
     'now',
     'percpu',
     'ports',
     'processcount',
     'processlist',
     'psutilversion',
     'quicklook',
     'raid',
     'sensors',
     'smart',
     'system',
     'uptime',
     'wifi']

N
nicolargo 已提交
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
GET alert
---------

Get plugin stats::

    # curl http://localhost:61208/api/3/alert
    [[1629527675.0,
      -1,
      'WARNING',
      'MEM',
      87.45747587103037,
      87.45747587103037,
      87.45747587103037,
      87.45747587103037,
      1,
      [],
      '',
      'memory_percent']]

N
nicolargo 已提交
71 72 73
GET amps
--------

N
nicolargo 已提交
74
Get plugin stats::
N
nicolargo 已提交
75 76 77 78 79 80 81 82 83 84

    # curl http://localhost:61208/api/3/amps
    [{'count': 0,
      'countmax': None,
      'countmin': 1.0,
      'key': 'name',
      'name': 'Dropbox',
      'refresh': 3.0,
      'regex': True,
      'result': None,
N
nicolargo 已提交
85
      'timer': 0.2592196464538574},
N
nicolargo 已提交
86 87 88 89 90 91 92 93
     {'count': 0,
      'countmax': 20.0,
      'countmin': None,
      'key': 'name',
      'name': 'Python',
      'refresh': 3.0,
      'regex': True,
      'result': None,
N
nicolargo 已提交
94
      'timer': 0.25902843475341797}]
N
nicolargo 已提交
95

N
nicolargo 已提交
96
Get a specific field::
N
nicolargo 已提交
97

N
nicolargo 已提交
98 99 100
    # curl http://localhost:61208/api/3/amps/name
    {'name': ['Dropbox', 'Python', 'Conntrack', 'Nginx', 'Systemd', 'SystemV']}

N
nicolargo 已提交
101
Get a specific item when field matchs the given value::
N
nicolargo 已提交
102

N
nicolargo 已提交
103 104 105 106 107 108 109 110 111
    # curl http://localhost:61208/api/3/amps/name/Dropbox
    {'Dropbox': [{'count': 0,
                  'countmax': None,
                  'countmin': 1.0,
                  'key': 'name',
                  'name': 'Dropbox',
                  'refresh': 3.0,
                  'regex': True,
                  'result': None,
N
nicolargo 已提交
112
                  'timer': 0.2592196464538574}]}
N
nicolargo 已提交
113 114 115 116

GET core
--------

N
nicolargo 已提交
117
Get plugin stats::
N
nicolargo 已提交
118 119 120 121 122 123 124 125 126

    # curl http://localhost:61208/api/3/core
    {'log': 4, 'phys': 2}

Fields descriptions:

* **phys**: Number of physical cores (hyper thread CPUs are excluded) (unit is *number*)
* **log**: Number of logical CPUs. A logical CPU is the number of physical cores multiplied by the number of threads that can run on each core (unit is *number*)

N
nicolargo 已提交
127
Get a specific field::
N
nicolargo 已提交
128

N
nicolargo 已提交
129 130 131 132 133 134
    # curl http://localhost:61208/api/3/core/phys
    {'phys': 2}

GET cpu
-------

N
nicolargo 已提交
135
Get plugin stats::
N
nicolargo 已提交
136 137 138 139 140 141

    # curl http://localhost:61208/api/3/cpu
    {'cpucore': 4,
     'ctx_switches': 0,
     'guest': 0.0,
     'guest_nice': 0.0,
N
nicolargo 已提交
142
     'idle': 70.5,
N
nicolargo 已提交
143
     'interrupts': 0,
N
nicolargo 已提交
144
     'iowait': 1.0,
N
nicolargo 已提交
145 146 147
     'irq': 0.0,
     'nice': 0.0,
     'soft_interrupts': 0,
N
nicolargo 已提交
148
     'softirq': 5.7,
N
nicolargo 已提交
149 150
     'steal': 0.0,
     'syscalls': 0,
N
nicolargo 已提交
151
     'system': 2.7,
N
nicolargo 已提交
152
     'time_since_update': 1,
N
nicolargo 已提交
153 154
     'total': 28.3,
     'user': 20.1}
N
nicolargo 已提交
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171

Fields descriptions:

* **total**: Sum of all CPU percentages (except idle) (unit is *percent*)
* **system**: percent time spent in kernel space. System CPU time is the time spent running code in the Operating System kernel (unit is *percent*)
* **user**: CPU percent time spent in user space. User CPU time is the time spent on the processor running your program's code (or code in libraries) (unit is *percent*)
* **iowait**: *(Linux)*: percent time spent by the CPU waiting for I/O operations to complete (unit is *percent*)
* **idle**: percent of CPU used by any program. Every program or task that runs on a computer system occupies a certain amount of processing time on the CPU. If the CPU has completed all tasks it is idle (unit is *percent*)
* **irq**: *(Linux and BSD)*: percent time spent servicing/handling hardware/software interrupts. Time servicing interrupts (hardware + software) (unit is *percent*)
* **nice**: *(Unix)*: percent time occupied by user level processes with a positive nice value. The time the CPU has spent running users' processes that have been *niced* (unit is *percent*)
* **steal**: *(Linux)*: percentage of time a virtual CPU waits for a real CPU while the hypervisor is servicing another virtual processor (unit is *percent*)
* **ctx_switches**: number of context switches (voluntary + involuntary) per second. A context switch is a procedure that a computer's CPU (central processing unit) follows to change from one task (or process) to another while ensuring that the tasks do not conflict (unit is *percent*)
* **interrupts**: number of interrupts per second (unit is *percent*)
* **soft_interrupts**: number of software interrupts per second. Always set to 0 on Windows and SunOS (unit is *percent*)
* **cpucore**: Total number of CPU core (unit is *number*)
* **time_since_update**: Number of seconds since last update (unit is *seconds*)

N
nicolargo 已提交
172
Get a specific field::
N
nicolargo 已提交
173

N
nicolargo 已提交
174
    # curl http://localhost:61208/api/3/cpu/total
N
nicolargo 已提交
175
    {'total': 28.3}
N
nicolargo 已提交
176 177 178 179

GET diskio
----------

N
nicolargo 已提交
180
Get plugin stats::
N
nicolargo 已提交
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197

    # curl http://localhost:61208/api/3/diskio
    [{'disk_name': 'sda',
      'key': 'disk_name',
      'read_bytes': 0,
      'read_count': 0,
      'time_since_update': 1,
      'write_bytes': 0,
      'write_count': 0},
     {'disk_name': 'sda1',
      'key': 'disk_name',
      'read_bytes': 0,
      'read_count': 0,
      'time_since_update': 1,
      'write_bytes': 0,
      'write_count': 0}]

N
nicolargo 已提交
198
Get a specific field::
N
nicolargo 已提交
199

N
nicolargo 已提交
200
    # curl http://localhost:61208/api/3/diskio/disk_name
N
nicolargo 已提交
201
    {'disk_name': ['sda', 'sda1', 'sda2', 'sda5', 'dm-0', 'dm-1']}
N
nicolargo 已提交
202

N
nicolargo 已提交
203
Get a specific item when field matchs the given value::
N
nicolargo 已提交
204

N
nicolargo 已提交
205 206 207 208 209 210 211 212 213
    # curl http://localhost:61208/api/3/diskio/disk_name/sda
    {'sda': [{'disk_name': 'sda',
              'key': 'disk_name',
              'read_bytes': 0,
              'read_count': 0,
              'time_since_update': 1,
              'write_bytes': 0,
              'write_count': 0}]}

N
nicolargo 已提交
214 215 216 217 218 219 220
GET docker
----------

Get plugin stats::

    # curl http://localhost:61208/api/3/docker
    [{'Command': ['/run.sh'],
N
nicolargo 已提交
221
      'Id': '65edb2094923e8732c04ba287c7cc2ef0c6178b4d93cd2bc328d9cd60f292b29',
N
nicolargo 已提交
222 223 224 225 226 227 228 229 230 231 232 233 234
      'Image': ['grafana/grafana:latest'],
      'Names': ['grafana'],
      'Status': 'running',
      'cpu_percent': 0.0,
      'io_r': None,
      'io_w': None,
      'key': 'name',
      'memory_usage': None,
      'name': 'grafana',
      'network_rx': None,
      'network_tx': None},
     {'Command': ['/entrypoint.sh', 'telegraf'],
      'Id': '84db65dbbbfead7851695dbff97f7751b5b3b93f7a50c24d66d4caab45b5f159',
N
nicolargo 已提交
235
      'Image': [],
N
nicolargo 已提交
236 237 238 239 240 241 242 243 244 245 246
      'Names': ['telegraf'],
      'Status': 'running',
      'cpu_percent': 0.0,
      'io_r': None,
      'io_w': None,
      'key': 'name',
      'memory_usage': None,
      'name': 'telegraf',
      'network_rx': None,
      'network_tx': None}]

N
nicolargo 已提交
247 248 249
GET fs
------

N
nicolargo 已提交
250
Get plugin stats::
N
nicolargo 已提交
251 252 253

    # curl http://localhost:61208/api/3/fs
    [{'device_name': '/dev/mapper/ubuntu--gnome--vg-root',
N
nicolargo 已提交
254
      'free': 34209202176,
N
nicolargo 已提交
255 256 257
      'fs_type': 'ext4',
      'key': 'mnt_point',
      'mnt_point': '/',
N
nicolargo 已提交
258
      'percent': 85.2,
N
nicolargo 已提交
259
      'size': 243396149248,
N
nicolargo 已提交
260
      'used': 196799492096}]
N
nicolargo 已提交
261

N
nicolargo 已提交
262
Get a specific field::
N
nicolargo 已提交
263

N
nicolargo 已提交
264
    # curl http://localhost:61208/api/3/fs/mnt_point
N
nicolargo 已提交
265
    {'mnt_point': ['/']}
N
nicolargo 已提交
266

N
nicolargo 已提交
267
Get a specific item when field matchs the given value::
N
nicolargo 已提交
268

N
nicolargo 已提交
269 270
    # curl http://localhost:61208/api/3/fs/mnt_point//
    {'/': [{'device_name': '/dev/mapper/ubuntu--gnome--vg-root',
N
nicolargo 已提交
271
            'free': 34209202176,
N
nicolargo 已提交
272 273 274
            'fs_type': 'ext4',
            'key': 'mnt_point',
            'mnt_point': '/',
N
nicolargo 已提交
275
            'percent': 85.2,
N
nicolargo 已提交
276
            'size': 243396149248,
N
nicolargo 已提交
277
            'used': 196799492096}]}
N
nicolargo 已提交
278 279 280 281

GET ip
------

N
nicolargo 已提交
282
Get plugin stats::
N
nicolargo 已提交
283 284

    # curl http://localhost:61208/api/3/ip
285
    {'address': '192.168.0.49',
N
nicolargo 已提交
286
     'gateway': '192.168.0.254',
N
nicolargo 已提交
287
     'mask': '255.255.255.0',
288 289
     'mask_cidr': 24,
     'public_address': '88.165.169.242'}
N
nicolargo 已提交
290

N
nicolargo 已提交
291
Get a specific field::
N
nicolargo 已提交
292

N
nicolargo 已提交
293
    # curl http://localhost:61208/api/3/ip/address
294
    {'address': '192.168.0.49'}
N
nicolargo 已提交
295 296 297 298

GET load
--------

N
nicolargo 已提交
299
Get plugin stats::
N
nicolargo 已提交
300 301

    # curl http://localhost:61208/api/3/load
N
nicolargo 已提交
302
    {'cpucore': 4, 'min1': 0.87, 'min15': 1.18, 'min5': 0.91}
N
nicolargo 已提交
303 304 305 306 307 308 309 310

Fields descriptions:

* **min1**: Average sum of the number of processes waiting in the run-queue plus the number currently executing over 1 minute (unit is *number*)
* **min5**: Average sum of the number of processes waiting in the run-queue plus the number currently executing over 5 minutes (unit is *number*)
* **min15**: Average sum of the number of processes waiting in the run-queue plus the number currently executing over 15 minutes (unit is *number*)
* **cpucore**: Total number of CPU core (unit is *number*)

N
nicolargo 已提交
311
Get a specific field::
N
nicolargo 已提交
312

N
nicolargo 已提交
313
    # curl http://localhost:61208/api/3/load/min1
N
nicolargo 已提交
314
    {'min1': 0.87}
N
nicolargo 已提交
315 316 317 318

GET mem
-------

N
nicolargo 已提交
319
Get plugin stats::
N
nicolargo 已提交
320 321

    # curl http://localhost:61208/api/3/mem
N
nicolargo 已提交
322 323 324 325 326 327 328 329
    {'active': 5509173248,
     'available': 984465408,
     'buffers': 69275648,
     'cached': 1757458432,
     'free': 984465408,
     'inactive': 1291149312,
     'percent': 87.5,
     'shared': 954650624,
N
nicolargo 已提交
330
     'total': 7849021440,
N
nicolargo 已提交
331
     'used': 6864556032}
N
nicolargo 已提交
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346

Fields descriptions:

* **total**: Total physical memory available (unit is *bytes*)
* **available**: The actual amount of available memory that can be given instantly to processes that request more memory in bytes; this is calculated by summing different memory values depending on the platform (e.g. free + buffers + cached on Linux) and it is supposed to be used to monitor actual memory usage in a cross platform fashion (unit is *bytes*)
* **percent**: The percentage usage calculated as (total - available) / total * 100 (unit is *percent*)
* **used**: Memory used, calculated differently depending on the platform and designed for informational purposes only (unit is *bytes*)
* **free**: Memory not being used at all (zeroed) that is readily available; note that this doesn't reflect the actual memory available (use 'available' instead) (unit is *bytes*)
* **active**: *(UNIX)*: memory currently in use or very recently used, and so it is in RAM (unit is *bytes*)
* **inactive**: *(UNIX)*: memory that is marked as not used (unit is *bytes*)
* **buffers**: *(Linux, BSD)*: cache for things like file system metadata (unit is *bytes*)
* **cached**: *(Linux, BSD)*: cache for various things (unit is *bytes*)
* **wired**: *(BSD, macOS)*: memory that is marked to always stay in RAM. It is never moved to disk (unit is *bytes*)
* **shared**: *(BSD)*: memory that may be simultaneously accessed by multiple processes (unit is *bytes*)

N
nicolargo 已提交
347
Get a specific field::
N
nicolargo 已提交
348

N
nicolargo 已提交
349
    # curl http://localhost:61208/api/3/mem/total
N
nicolargo 已提交
350
    {'total': 7849021440}
N
nicolargo 已提交
351 352 353 354

GET memswap
-----------

N
nicolargo 已提交
355
Get plugin stats::
N
nicolargo 已提交
356 357

    # curl http://localhost:61208/api/3/memswap
N
nicolargo 已提交
358 359 360 361
    {'free': 7486050304,
     'percent': 7.4,
     'sin': 90058752,
     'sout': 668807168,
N
nicolargo 已提交
362 363
     'time_since_update': 1,
     'total': 8082419712,
N
nicolargo 已提交
364
     'used': 596369408}
N
nicolargo 已提交
365 366 367 368 369 370 371 372 373 374 375

Fields descriptions:

* **total**: Total swap memory (unit is *bytes*)
* **used**: Used swap memory (unit is *bytes*)
* **free**: Free swap memory (unit is *bytes*)
* **percent**: Used swap memory in percentage (unit is *percent*)
* **sin**: The number of bytes the system has swapped in from disk (cumulative) (unit is *bytes*)
* **sout**: The number of bytes the system has swapped out from disk (cumulative) (unit is *bytes*)
* **time_since_update**: Number of seconds since last update (unit is *seconds*)

N
nicolargo 已提交
376
Get a specific field::
N
nicolargo 已提交
377

N
nicolargo 已提交
378 379 380 381 382 383
    # curl http://localhost:61208/api/3/memswap/total
    {'total': 8082419712}

GET network
-----------

N
nicolargo 已提交
384
Get plugin stats::
N
nicolargo 已提交
385 386 387

    # curl http://localhost:61208/api/3/network
    [{'alias': None,
N
nicolargo 已提交
388 389 390
      'cumulative_cx': 116226779,
      'cumulative_rx': 26881826,
      'cumulative_tx': 89344953,
N
nicolargo 已提交
391 392 393 394 395 396 397 398 399
      'cx': 0,
      'interface_name': 'veth20bf375',
      'is_up': True,
      'key': 'interface_name',
      'rx': 0,
      'speed': 10485760000,
      'time_since_update': 1,
      'tx': 0},
     {'alias': None,
N
nicolargo 已提交
400 401 402 403
      'cumulative_cx': 0,
      'cumulative_rx': 0,
      'cumulative_tx': 0,
      'cx': 0,
N
nicolargo 已提交
404
      'interface_name': 'mpqemubr0',
N
nicolargo 已提交
405 406 407 408 409
      'is_up': False,
      'key': 'interface_name',
      'rx': 0,
      'speed': 0,
      'time_since_update': 1,
N
nicolargo 已提交
410
      'tx': 0}]
N
nicolargo 已提交
411 412 413 414 415 416 417 418 419 420 421 422 423

Fields descriptions:

* **interface_name**: Interface name (unit is *string*)
* **alias**: Interface alias name (optional) (unit is *string*)
* **rx**: The received/input rate (in bit per second) (unit is *bps*)
* **tx**: The sent/output rate (in bit per second) (unit is *bps*)
* **cumulative_rx**: The number of bytes received through the interface (cumulative) (unit is *bytes*)
* **cumulative_tx**: The number of bytes sent through the interface (cumulative) (unit is *bytes*)
* **speed**: Maximum interface speed (in bit per second). Can return 0 on some operating-system (unit is *bps*)
* **is_up**: Is the interface up ? (unit is *bool*)
* **time_since_update**: Number of seconds since last update (unit is *seconds*)

N
nicolargo 已提交
424
Get a specific field::
N
nicolargo 已提交
425

N
nicolargo 已提交
426
    # curl http://localhost:61208/api/3/network/interface_name
N
nicolargo 已提交
427
    {'interface_name': ['veth20bf375',
N
nicolargo 已提交
428
                        'mpqemubr0',
N
nicolargo 已提交
429 430 431
                        'veth35385e9',
                        'br-119e6ee04e05',
                        'lo',
N
nicolargo 已提交
432
                        'docker0',
N
nicolargo 已提交
433 434
                        'br-87386b77b676',
                        'tap-838a195875f',
N
nicolargo 已提交
435
                        'veth4279222',
N
nicolargo 已提交
436
                        'wlp2s0',
N
nicolargo 已提交
437
                        'veth041bfdd']}
N
nicolargo 已提交
438

N
nicolargo 已提交
439
Get a specific item when field matchs the given value::
N
nicolargo 已提交
440

N
nicolargo 已提交
441 442
    # curl http://localhost:61208/api/3/network/interface_name/veth20bf375
    {'veth20bf375': [{'alias': None,
N
nicolargo 已提交
443 444 445
                      'cumulative_cx': 116226779,
                      'cumulative_rx': 26881826,
                      'cumulative_tx': 89344953,
N
nicolargo 已提交
446 447 448 449 450 451 452 453
                      'cx': 0,
                      'interface_name': 'veth20bf375',
                      'is_up': True,
                      'key': 'interface_name',
                      'rx': 0,
                      'speed': 10485760000,
                      'time_since_update': 1,
                      'tx': 0}]}
N
nicolargo 已提交
454 455 456 457

GET now
-------

N
nicolargo 已提交
458
Get plugin stats::
N
nicolargo 已提交
459 460

    # curl http://localhost:61208/api/3/now
N
nicolargo 已提交
461
    '2021-08-21 08:34:35 CEST'
N
nicolargo 已提交
462 463 464 465

GET percpu
----------

N
nicolargo 已提交
466
Get plugin stats::
N
nicolargo 已提交
467 468 469 470 471

    # curl http://localhost:61208/api/3/percpu
    [{'cpu_number': 0,
      'guest': 0.0,
      'guest_nice': 0.0,
N
nicolargo 已提交
472 473
      'idle': 28.3,
      'iowait': 0.0,
N
nicolargo 已提交
474 475 476
      'irq': 0.0,
      'key': 'cpu_number',
      'nice': 0.0,
N
nicolargo 已提交
477
      'softirq': 0.9,
N
nicolargo 已提交
478
      'steal': 0.0,
N
nicolargo 已提交
479 480 481
      'system': 2.8,
      'total': 71.7,
      'user': 67.9},
N
nicolargo 已提交
482 483 484
     {'cpu_number': 1,
      'guest': 0.0,
      'guest_nice': 0.0,
N
nicolargo 已提交
485 486
      'idle': 93.7,
      'iowait': 0.0,
N
nicolargo 已提交
487 488 489
      'irq': 0.0,
      'key': 'cpu_number',
      'nice': 0.0,
N
nicolargo 已提交
490
      'softirq': 2.7,
N
nicolargo 已提交
491
      'steal': 0.0,
N
nicolargo 已提交
492 493 494
      'system': 1.8,
      'total': 6.3,
      'user': 1.8}]
N
nicolargo 已提交
495

N
nicolargo 已提交
496
Get a specific field::
N
nicolargo 已提交
497

N
nicolargo 已提交
498 499 500 501 502 503
    # curl http://localhost:61208/api/3/percpu/cpu_number
    {'cpu_number': [0, 1, 2, 3]}

GET ports
---------

N
nicolargo 已提交
504
Get plugin stats::
N
nicolargo 已提交
505 506 507

    # curl http://localhost:61208/api/3/ports
    [{'description': 'DefaultGateway',
N
nicolargo 已提交
508
      'host': '192.168.0.254',
N
nicolargo 已提交
509 510 511 512
      'indice': 'port_0',
      'port': 0,
      'refresh': 30,
      'rtt_warning': None,
N
nicolargo 已提交
513
      'status': 0.007762,
N
nicolargo 已提交
514 515
      'timeout': 3}]

N
nicolargo 已提交
516
Get a specific field::
N
nicolargo 已提交
517

N
nicolargo 已提交
518
    # curl http://localhost:61208/api/3/ports/host
N
nicolargo 已提交
519
    {'host': ['192.168.0.254']}
N
nicolargo 已提交
520

N
nicolargo 已提交
521
Get a specific item when field matchs the given value::
N
nicolargo 已提交
522

N
nicolargo 已提交
523 524 525 526 527 528 529
    # 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,
N
nicolargo 已提交
530
                        'status': 0.007762,
N
nicolargo 已提交
531
                        'timeout': 3}]}
N
nicolargo 已提交
532 533 534 535

GET processcount
----------------

N
nicolargo 已提交
536
Get plugin stats::
N
nicolargo 已提交
537 538

    # curl http://localhost:61208/api/3/processcount
N
nicolargo 已提交
539
    {'pid_max': 0, 'running': 1, 'sleeping': 281, 'thread': 1532, 'total': 339}
N
nicolargo 已提交
540

N
nicolargo 已提交
541
Get a specific field::
N
nicolargo 已提交
542

N
nicolargo 已提交
543
    # curl http://localhost:61208/api/3/processcount/total
N
nicolargo 已提交
544
    {'total': 339}
N
nicolargo 已提交
545 546 547 548

GET processlist
---------------

N
nicolargo 已提交
549
Get plugin stats::
N
nicolargo 已提交
550 551

    # curl http://localhost:61208/api/3/processlist
N
nicolargo 已提交
552
    [{'cmdline': ['/usr/lib/firefox/firefox', '-new-window'],
N
nicolargo 已提交
553
      'cpu_percent': 0.0,
N
nicolargo 已提交
554
      'cpu_times': pcputimes(user=5585.01, system=1722.47, children_user=3282.2, children_system=675.02, iowait=1.8),
N
nicolargo 已提交
555
      'gids': pgids(real=1000, effective=1000, saved=1000),
N
nicolargo 已提交
556
      'io_counters': [1098960896, 5357330432, 0, 0, 0],
N
nicolargo 已提交
557
      'key': 'pid',
N
nicolargo 已提交
558 559
      'memory_info': pmem(rss=1037713408, vms=5342564352, shared=156327936, text=622592, lib=0, data=1466003456, dirty=0),
      'memory_percent': 13.220927168215251,
N
nicolargo 已提交
560
      'name': 'firefox',
N
nicolargo 已提交
561
      'nice': 0,
N
nicolargo 已提交
562
      'num_threads': 132,
N
nicolargo 已提交
563 564
      'pid': 4142,
      'ppid': 3391,
N
nicolargo 已提交
565 566 567
      'status': 'S',
      'time_since_update': 1,
      'username': 'nicolargo'},
N
nicolargo 已提交
568 569 570
     {'cmdline': ['/usr/lib/firefox/firefox',
                  '-contentproc',
                  '-childID',
N
nicolargo 已提交
571
                  '5',
N
nicolargo 已提交
572 573
                  '-isForBrowser',
                  '-prefsLen',
N
nicolargo 已提交
574
                  '4953',
N
nicolargo 已提交
575 576 577 578 579 580 581 582 583
                  '-prefMapSize',
                  '250397',
                  '-parentBuildID',
                  '20210527174632',
                  '-appdir',
                  '/usr/lib/firefox/browser',
                  '4142',
                  'true',
                  'tab'],
N
nicolargo 已提交
584
      'cpu_percent': 0.0,
N
nicolargo 已提交
585
      'cpu_times': pcputimes(user=590.19, system=97.22, children_user=0.0, children_system=0.0, iowait=0.04),
N
nicolargo 已提交
586
      'gids': pgids(real=1000, effective=1000, saved=1000),
N
nicolargo 已提交
587
      'io_counters': [8634368, 0, 0, 0, 0],
N
nicolargo 已提交
588
      'key': 'pid',
N
nicolargo 已提交
589 590 591
      'memory_info': pmem(rss=731287552, vms=3396091904, shared=39550976, text=622592, lib=0, data=911761408, dirty=0),
      'memory_percent': 9.316926416753423,
      'name': 'WebExtensions',
N
nicolargo 已提交
592
      'nice': 0,
N
nicolargo 已提交
593 594
      'num_threads': 25,
      'pid': 4378,
N
nicolargo 已提交
595
      'ppid': 4142,
N
nicolargo 已提交
596 597 598 599
      'status': 'S',
      'time_since_update': 1,
      'username': 'nicolargo'}]

N
nicolargo 已提交
600
Get a specific field::
N
nicolargo 已提交
601

N
nicolargo 已提交
602
    # curl http://localhost:61208/api/3/processlist/pid
N
nicolargo 已提交
603 604
    {'pid': [4142,
             4378,
N
nicolargo 已提交
605
             4258,
N
nicolargo 已提交
606 607
             9692,
             4690,
N
nicolargo 已提交
608
             9388,
N
nicolargo 已提交
609 610 611
             3638,
             18293,
             31464,
N
nicolargo 已提交
612 613 614 615
             99335,
             11502,
             64775,
             9359,
N
nicolargo 已提交
616 617
             9426,
             38222,
N
nicolargo 已提交
618 619
             92962,
             92898,
N
nicolargo 已提交
620
             9330,
N
nicolargo 已提交
621
             9453,
N
nicolargo 已提交
622
             9441,
N
nicolargo 已提交
623
             27823,
N
nicolargo 已提交
624 625
             4280,
             7272,
N
nicolargo 已提交
626 627
             18645,
             102620,
N
nicolargo 已提交
628 629
             30528,
             9474,
N
nicolargo 已提交
630 631
             108015,
             2217,
N
nicolargo 已提交
632
             9542,
N
nicolargo 已提交
633
             68876,
N
nicolargo 已提交
634
             9378,
N
nicolargo 已提交
635 636
             3460,
             9711,
N
nicolargo 已提交
637 638
             2297,
             3485,
N
nicolargo 已提交
639
             3402,
N
nicolargo 已提交
640
             3735,
N
nicolargo 已提交
641
             1162,
N
nicolargo 已提交
642
             9231,
N
nicolargo 已提交
643 644 645 646 647 648 649
             105514,
             9233,
             5343,
             9333,
             9334,
             11685,
             351,
N
nicolargo 已提交
650
             4726,
N
nicolargo 已提交
651 652 653 654
             101319,
             3400,
             81429,
             1319,
N
nicolargo 已提交
655 656
             3704,
             1140,
N
nicolargo 已提交
657 658 659 660 661
             3905,
             3697,
             3768,
             3764,
             1,
N
nicolargo 已提交
662
             2251,
N
nicolargo 已提交
663 664 665 666 667
             2439,
             3789,
             3795,
             3159,
             1175,
N
nicolargo 已提交
668
             1308,
N
nicolargo 已提交
669 670 671 672 673 674 675 676
             3799,
             1150,
             3845,
             1154,
             101343,
             3668,
             7777,
             3793,
N
nicolargo 已提交
677 678
             3791,
             3623,
N
nicolargo 已提交
679 680 681 682
             101342,
             3829,
             3721,
             3391,
N
nicolargo 已提交
683 684
             2236,
             1022,
N
nicolargo 已提交
685
             3439,
N
nicolargo 已提交
686 687
             2449,
             3802,
N
nicolargo 已提交
688
             3673,
N
nicolargo 已提交
689
             1306,
N
nicolargo 已提交
690 691 692 693
             3211,
             1551,
             3819,
             3948,
N
nicolargo 已提交
694
             1174,
N
nicolargo 已提交
695 696 697 698
             3676,
             30686,
             3371,
             3414,
N
nicolargo 已提交
699 700 701
             30672,
             1176,
             53315,
N
nicolargo 已提交
702
             1138,
N
nicolargo 已提交
703
             36769,
N
nicolargo 已提交
704 705
             3510,
             3824,
N
nicolargo 已提交
706
             1118,
N
nicolargo 已提交
707 708 709
             1359,
             1145,
             3792,
N
nicolargo 已提交
710
             3679,
N
nicolargo 已提交
711 712 713 714 715 716 717 718
             3456,
             106400,
             107588,
             3447,
             3470,
             81481,
             36746,
             1172,
N
nicolargo 已提交
719
             3426,
N
nicolargo 已提交
720
             3718,
N
nicolargo 已提交
721
             3826,
N
nicolargo 已提交
722 723 724
             3862,
             3405,
             3672,
N
nicolargo 已提交
725
             3476,
N
nicolargo 已提交
726 727 728 729 730
             2446,
             3790,
             3949,
             3432,
             2468,
N
nicolargo 已提交
731 732
             1169,
             3601,
N
nicolargo 已提交
733 734 735 736
             3689,
             3853,
             1159,
             3788,
N
nicolargo 已提交
737 738
             53321,
             3812,
N
nicolargo 已提交
739 740
             38268,
             3843,
N
nicolargo 已提交
741 742
             3483,
             53324,
N
nicolargo 已提交
743
             11661,
N
nicolargo 已提交
744
             1157,
N
nicolargo 已提交
745 746 747
             3807,
             3821,
             3452,
N
nicolargo 已提交
748
             1132,
N
nicolargo 已提交
749
             383,
N
nicolargo 已提交
750
             1131,
N
nicolargo 已提交
751 752
             1146,
             1023,
N
nicolargo 已提交
753
             1021,
N
nicolargo 已提交
754 755 756 757
             2447,
             3214,
             11480,
             68853,
N
nicolargo 已提交
758
             3606,
N
nicolargo 已提交
759
             1177,
N
nicolargo 已提交
760
             1430,
N
nicolargo 已提交
761 762 763
             3092,
             3693,
             107999,
N
nicolargo 已提交
764
             1135,
N
nicolargo 已提交
765 766 767
             9294,
             3616,
             9536,
N
nicolargo 已提交
768 769
             1209,
             53327,
N
nicolargo 已提交
770 771 772 773
             1350,
             68839,
             11452,
             105810,
N
nicolargo 已提交
774
             3063,
N
nicolargo 已提交
775
             1119,
N
nicolargo 已提交
776 777
             11427,
             11465,
N
nicolargo 已提交
778
             108014,
N
nicolargo 已提交
779
             2097,
N
nicolargo 已提交
780
             3077,
N
nicolargo 已提交
781
             2275,
N
nicolargo 已提交
782 783 784 785
             11440,
             2271,
             4551,
             3395,
N
nicolargo 已提交
786
             1215,
N
nicolargo 已提交
787
             2269,
N
nicolargo 已提交
788 789
             997,
             373,
N
nicolargo 已提交
790
             1134,
N
nicolargo 已提交
791
             3580,
N
nicolargo 已提交
792 793 794 795 796 797 798 799 800 801 802 803 804
             2,
             3,
             4,
             9,
             10,
             11,
             12,
             13,
             14,
             15,
             16,
             17,
             18,
N
nicolargo 已提交
805
             20,
N
nicolargo 已提交
806 807 808 809
             21,
             22,
             23,
             24,
N
nicolargo 已提交
810
             26,
N
nicolargo 已提交
811 812 813 814
             27,
             28,
             29,
             30,
N
nicolargo 已提交
815
             32,
N
nicolargo 已提交
816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835
             33,
             34,
             35,
             36,
             37,
             38,
             39,
             40,
             41,
             42,
             91,
             92,
             93,
             94,
             95,
             96,
             97,
             98,
             99,
             103,
N
nicolargo 已提交
836 837
             104,
             106,
N
nicolargo 已提交
838 839
             107,
             108,
N
nicolargo 已提交
840 841 842
             113,
             122,
             138,
N
nicolargo 已提交
843 844 845 846 847 848 849 850 851
             181,
             191,
             192,
             193,
             194,
             195,
             196,
             197,
             198,
N
nicolargo 已提交
852 853
             204,
             205,
N
nicolargo 已提交
854
             206,
N
nicolargo 已提交
855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915
             209,
             210,
             240,
             282,
             283,
             291,
             292,
             294,
             363,
             368,
             392,
             401,
             404,
             405,
             406,
             407,
             430,
             434,
             441,
             493,
             499,
             535,
             779,
             780,
             781,
             782,
             783,
             784,
             785,
             786,
             787,
             788,
             789,
             790,
             908,
             909,
             910,
             911,
             912,
             913,
             915,
             916,
             930,
             936,
             941,
             945,
             947,
             951,
             954,
             957,
             1360,
             1495,
             1496,
             1497,
             1498,
             1499,
             1500,
             1502,
             1504,
             2329,
             2357,
N
nicolargo 已提交
916
             3115,
N
nicolargo 已提交
917 918 919 920
             3463,
             51408,
             51705,
             53671,
N
nicolargo 已提交
921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941
             54440,
             81351,
             84910,
             98874,
             98921,
             101187,
             101201,
             103005,
             103071,
             103136,
             103416,
             103834,
             104097,
             105012,
             105142,
             105193,
             105304,
             105912,
             107210,
             107765,
             107770]}
N
nicolargo 已提交
942 943

Get a specific item when field matchs the given value::
N
nicolargo 已提交
944

N
nicolargo 已提交
945 946 947
    # curl http://localhost:61208/api/3/processlist/pid/4142
    {'4142': [{'cmdline': ['/usr/lib/firefox/firefox', '-new-window'],
               'cpu_percent': 0.0,
N
nicolargo 已提交
948
               'cpu_times': [5585.01, 1722.47, 3282.2, 675.02, 1.8],
N
nicolargo 已提交
949
               'gids': [1000, 1000, 1000],
N
nicolargo 已提交
950
               'io_counters': [1098960896, 5357330432, 0, 0, 0],
N
nicolargo 已提交
951
               'key': 'pid',
N
nicolargo 已提交
952 953 954
               'memory_info': [1037713408,
                               5342564352,
                               156327936,
N
nicolargo 已提交
955 956
                               622592,
                               0,
N
nicolargo 已提交
957
                               1466003456,
N
nicolargo 已提交
958
                               0],
N
nicolargo 已提交
959
               'memory_percent': 13.220927168215251,
N
nicolargo 已提交
960 961
               'name': 'firefox',
               'nice': 0,
N
nicolargo 已提交
962
               'num_threads': 132,
N
nicolargo 已提交
963 964 965 966 967
               'pid': 4142,
               'ppid': 3391,
               'status': 'S',
               'time_since_update': 1,
               'username': 'nicolargo'}]}
N
nicolargo 已提交
968 969 970 971

GET psutilversion
-----------------

N
nicolargo 已提交
972
Get plugin stats::
N
nicolargo 已提交
973 974 975 976 977 978 979

    # curl http://localhost:61208/api/3/psutilversion
    (5, 8, 0)

GET quicklook
-------------

N
nicolargo 已提交
980
Get plugin stats::
N
nicolargo 已提交
981 982

    # curl http://localhost:61208/api/3/quicklook
N
nicolargo 已提交
983 984 985
    {'cpu': 28.3,
     'cpu_hz': 3000000000.0,
     'cpu_hz_current': 2128037500.0,
N
nicolargo 已提交
986
     'cpu_name': 'Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz',
N
nicolargo 已提交
987
     'mem': 87.5,
N
nicolargo 已提交
988 989 990
     'percpu': [{'cpu_number': 0,
                 'guest': 0.0,
                 'guest_nice': 0.0,
N
nicolargo 已提交
991 992
                 'idle': 28.3,
                 'iowait': 0.0,
N
nicolargo 已提交
993 994 995
                 'irq': 0.0,
                 'key': 'cpu_number',
                 'nice': 0.0,
N
nicolargo 已提交
996
                 'softirq': 0.9,
N
nicolargo 已提交
997
                 'steal': 0.0,
N
nicolargo 已提交
998 999 1000
                 'system': 2.8,
                 'total': 71.7,
                 'user': 67.9},
N
nicolargo 已提交
1001 1002 1003
                {'cpu_number': 1,
                 'guest': 0.0,
                 'guest_nice': 0.0,
N
nicolargo 已提交
1004 1005
                 'idle': 93.7,
                 'iowait': 0.0,
N
nicolargo 已提交
1006 1007 1008
                 'irq': 0.0,
                 'key': 'cpu_number',
                 'nice': 0.0,
N
nicolargo 已提交
1009
                 'softirq': 2.7,
N
nicolargo 已提交
1010
                 'steal': 0.0,
N
nicolargo 已提交
1011 1012 1013
                 'system': 1.8,
                 'total': 6.3,
                 'user': 1.8},
N
nicolargo 已提交
1014 1015 1016
                {'cpu_number': 2,
                 'guest': 0.0,
                 'guest_nice': 0.0,
N
nicolargo 已提交
1017 1018
                 'idle': 71.3,
                 'iowait': 2.3,
N
nicolargo 已提交
1019 1020 1021
                 'irq': 0.0,
                 'key': 'cpu_number',
                 'nice': 0.0,
N
nicolargo 已提交
1022
                 'softirq': 17.1,
N
nicolargo 已提交
1023
                 'steal': 0.0,
N
nicolargo 已提交
1024 1025
                 'system': 1.6,
                 'total': 28.7,
N
nicolargo 已提交
1026
                 'user': 7.8},
N
nicolargo 已提交
1027 1028 1029
                {'cpu_number': 3,
                 'guest': 0.0,
                 'guest_nice': 0.0,
N
nicolargo 已提交
1030
                 'idle': 88.8,
N
nicolargo 已提交
1031
                 'iowait': 0.0,
N
nicolargo 已提交
1032 1033 1034
                 'irq': 0.0,
                 'key': 'cpu_number',
                 'nice': 0.0,
N
nicolargo 已提交
1035
                 'softirq': 0.9,
N
nicolargo 已提交
1036
                 'steal': 0.0,
N
nicolargo 已提交
1037 1038 1039 1040
                 'system': 2.8,
                 'total': 11.2,
                 'user': 7.5}],
     'swap': 7.4}
N
nicolargo 已提交
1041

N
nicolargo 已提交
1042
Get a specific field::
N
nicolargo 已提交
1043

N
nicolargo 已提交
1044
    # curl http://localhost:61208/api/3/quicklook/cpu
N
nicolargo 已提交
1045
    {'cpu': 28.3}
N
nicolargo 已提交
1046 1047 1048 1049

GET sensors
-----------

N
nicolargo 已提交
1050
Get plugin stats::
N
nicolargo 已提交
1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067

    # curl http://localhost:61208/api/3/sensors
    [{'critical': 105,
      'key': 'label',
      'label': 'acpitz 1',
      'type': 'temperature_core',
      'unit': 'C',
      'value': 27,
      'warning': 105},
     {'critical': 105,
      'key': 'label',
      'label': 'acpitz 2',
      'type': 'temperature_core',
      'unit': 'C',
      'value': 29,
      'warning': 105}]

N
nicolargo 已提交
1068
Get a specific field::
N
nicolargo 已提交
1069

N
nicolargo 已提交
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080
    # curl http://localhost:61208/api/3/sensors/label
    {'label': ['acpitz 1',
               'acpitz 2',
               'CPU',
               'Ambient',
               'SODIMM',
               'Package id 0',
               'Core 0',
               'Core 1',
               'Battery']}

N
nicolargo 已提交
1081
Get a specific item when field matchs the given value::
N
nicolargo 已提交
1082

N
nicolargo 已提交
1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094
    # curl http://localhost:61208/api/3/sensors/label/acpitz 1
    {'acpitz 1': [{'critical': 105,
                   'key': 'label',
                   'label': 'acpitz 1',
                   'type': 'temperature_core',
                   'unit': 'C',
                   'value': 27,
                   'warning': 105}]}

GET system
----------

N
nicolargo 已提交
1095
Get plugin stats::
N
nicolargo 已提交
1096 1097 1098 1099 1100 1101

    # curl http://localhost:61208/api/3/system
    {'hostname': 'XPS13-9333',
     'hr_name': 'Ubuntu 20.04 64bit',
     'linux_distro': 'Ubuntu 20.04',
     'os_name': 'Linux',
N
nicolargo 已提交
1102
     'os_version': '5.4.0-74-generic',
N
nicolargo 已提交
1103 1104
     'platform': '64bit'}

N
nicolargo 已提交
1105
Get a specific field::
N
nicolargo 已提交
1106

N
nicolargo 已提交
1107 1108 1109 1110 1111 1112
    # curl http://localhost:61208/api/3/system/os_name
    {'os_name': 'Linux'}

GET uptime
----------

N
nicolargo 已提交
1113
Get plugin stats::
N
nicolargo 已提交
1114 1115

    # curl http://localhost:61208/api/3/uptime
N
nicolargo 已提交
1116
    {'seconds': 1178914}
N
nicolargo 已提交
1117 1118 1119 1120

GET all stats
-------------

N
nicolargo 已提交
1121
Get all Glances stats::
N
nicolargo 已提交
1122

N
nicolargo 已提交
1123 1124 1125 1126 1127 1128
    # curl http://localhost:61208/api/3/all
    Return a very big dictionnary (avoid using this request, performances will be poor)...

GET stats history
-----------------

N
nicolargo 已提交
1129
History of a plugin::
N
nicolargo 已提交
1130

N
nicolargo 已提交
1131
    # curl http://localhost:61208/api/3/cpu/history
N
nicolargo 已提交
1132 1133 1134 1135 1136 1137
    {'system': [['2021-08-21T08:34:35.429123', 2.7],
                ['2021-08-21T08:34:36.506330', 2.7],
                ['2021-08-21T08:34:37.594678', 1.5]],
     'user': [['2021-08-21T08:34:35.429113', 20.1],
              ['2021-08-21T08:34:36.506327', 20.1],
              ['2021-08-21T08:34:37.594673', 4.4]]}
N
nicolargo 已提交
1138 1139

Limit history to last 2 values::
N
nicolargo 已提交
1140

N
nicolargo 已提交
1141
    # curl http://localhost:61208/api/3/cpu/history/2
N
nicolargo 已提交
1142 1143 1144 1145
    {'system': [['2021-08-21T08:34:36.506330', 2.7],
                ['2021-08-21T08:34:37.594678', 1.5]],
     'user': [['2021-08-21T08:34:36.506327', 20.1],
              ['2021-08-21T08:34:37.594673', 4.4]]}
N
nicolargo 已提交
1146

N
nicolargo 已提交
1147
History for a specific field::
N
nicolargo 已提交
1148

N
nicolargo 已提交
1149
    # curl http://localhost:61208/api/3/cpu/system/history
N
nicolargo 已提交
1150 1151 1152
    {'system': [['2021-08-21T08:34:35.429123', 2.7],
                ['2021-08-21T08:34:36.506330', 2.7],
                ['2021-08-21T08:34:37.594678', 1.5]]}
N
nicolargo 已提交
1153

N
nicolargo 已提交
1154
Limit history for a specific field to last 2 values::
N
nicolargo 已提交
1155

N
nicolargo 已提交
1156
    # curl http://localhost:61208/api/3/cpu/system/history
N
nicolargo 已提交
1157 1158
    {'system': [['2021-08-21T08:34:36.506330', 2.7],
                ['2021-08-21T08:34:37.594678', 1.5]]}
N
nicolargo 已提交
1159 1160 1161 1162

GET limits (used for thresholds)
--------------------------------

N
nicolargo 已提交
1163
All limits/thresholds::
N
nicolargo 已提交
1164

N
nicolargo 已提交
1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220
    # curl http://localhost:61208/api/3/all/limits
    {'alert': {'history_size': 3600.0},
     'amps': {'amps_disable': ['False'], 'history_size': 3600.0},
     'cloud': {'history_size': 3600.0},
     'connections': {'connections_disable': ['True'],
                     'connections_nf_conntrack_percent_careful': 70.0,
                     'connections_nf_conntrack_percent_critical': 90.0,
                     'connections_nf_conntrack_percent_warning': 80.0,
                     'history_size': 3600.0},
     'core': {'history_size': 3600.0},
     'cpu': {'cpu_ctx_switches_careful': 160000.0,
             'cpu_ctx_switches_critical': 200000.0,
             'cpu_ctx_switches_warning': 180000.0,
             'cpu_disable': ['False'],
             'cpu_iowait_careful': 20.0,
             'cpu_iowait_critical': 25.0,
             'cpu_iowait_warning': 22.5,
             'cpu_steal_careful': 50.0,
             'cpu_steal_critical': 90.0,
             'cpu_steal_warning': 70.0,
             'cpu_system_careful': 50.0,
             'cpu_system_critical': 90.0,
             'cpu_system_log': ['False'],
             'cpu_system_warning': 70.0,
             'cpu_total_careful': 65.0,
             'cpu_total_critical': 85.0,
             'cpu_total_log': ['True'],
             'cpu_total_warning': 75.0,
             'cpu_user_careful': 50.0,
             'cpu_user_critical': 90.0,
             'cpu_user_log': ['False'],
             'cpu_user_warning': 70.0,
             'history_size': 3600.0},
     'diskio': {'diskio_disable': ['False'],
                'diskio_hide': ['loop.*', '/dev/loop*'],
                'history_size': 3600.0},
     'docker': {'docker_all': ['False'],
                'docker_disable': ['False'],
                'docker_max_name_size': 20.0,
                'history_size': 3600.0},
     'folders': {'folders_disable': ['False'], 'history_size': 3600.0},
     'fs': {'fs_careful': 50.0,
            'fs_critical': 90.0,
            'fs_disable': ['False'],
            'fs_hide': ['/boot.*', '/snap.*'],
            'fs_warning': 70.0,
            'history_size': 3600.0},
     'gpu': {'gpu_disable': ['False'],
             'gpu_mem_careful': 50.0,
             'gpu_mem_critical': 90.0,
             'gpu_mem_warning': 70.0,
             'gpu_proc_careful': 50.0,
             'gpu_proc_critical': 90.0,
             'gpu_proc_warning': 70.0,
             'history_size': 3600.0},
     'help': {'history_size': 3600.0},
1221
     'ip': {'history_size': 3600.0, 'ip_disable': ['False']},
N
nicolargo 已提交
1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348
     'irq': {'history_size': 3600.0, 'irq_disable': ['True']},
     'load': {'history_size': 3600.0,
              'load_careful': 0.7,
              'load_critical': 5.0,
              'load_disable': ['False'],
              'load_warning': 1.0},
     'mem': {'history_size': 3600.0,
             'mem_careful': 50.0,
             'mem_critical': 90.0,
             'mem_disable': ['False'],
             'mem_warning': 70.0},
     'memswap': {'history_size': 3600.0,
                 'memswap_careful': 50.0,
                 'memswap_critical': 90.0,
                 'memswap_disable': ['False'],
                 'memswap_warning': 70.0},
     'network': {'history_size': 3600.0,
                 'network_disable': ['False'],
                 'network_rx_careful': 70.0,
                 'network_rx_critical': 90.0,
                 'network_rx_warning': 80.0,
                 'network_tx_careful': 70.0,
                 'network_tx_critical': 90.0,
                 'network_tx_warning': 80.0},
     'now': {'history_size': 3600.0},
     'percpu': {'history_size': 3600.0,
                'percpu_disable': ['False'],
                'percpu_iowait_careful': 50.0,
                'percpu_iowait_critical': 90.0,
                'percpu_iowait_warning': 70.0,
                'percpu_system_careful': 50.0,
                'percpu_system_critical': 90.0,
                'percpu_system_warning': 70.0,
                'percpu_user_careful': 50.0,
                'percpu_user_critical': 90.0,
                'percpu_user_warning': 70.0},
     'ports': {'history_size': 3600.0,
               'ports_disable': ['False'],
               'ports_port_default_gateway': ['True'],
               'ports_refresh': 30.0,
               'ports_timeout': 3.0},
     'processcount': {'history_size': 3600.0, 'processcount_disable': ['False']},
     'processlist': {'history_size': 3600.0,
                     'processlist_cpu_careful': 50.0,
                     'processlist_cpu_critical': 90.0,
                     'processlist_cpu_warning': 70.0,
                     'processlist_disable': ['False'],
                     'processlist_mem_careful': 50.0,
                     'processlist_mem_critical': 90.0,
                     'processlist_mem_warning': 70.0,
                     'processlist_nice_warning': ['-20',
                                                  '-19',
                                                  '-18',
                                                  '-17',
                                                  '-16',
                                                  '-15',
                                                  '-14',
                                                  '-13',
                                                  '-12',
                                                  '-11',
                                                  '-10',
                                                  '-9',
                                                  '-8',
                                                  '-7',
                                                  '-6',
                                                  '-5',
                                                  '-4',
                                                  '-3',
                                                  '-2',
                                                  '-1',
                                                  '1',
                                                  '2',
                                                  '3',
                                                  '4',
                                                  '5',
                                                  '6',
                                                  '7',
                                                  '8',
                                                  '9',
                                                  '10',
                                                  '11',
                                                  '12',
                                                  '13',
                                                  '14',
                                                  '15',
                                                  '16',
                                                  '17',
                                                  '18',
                                                  '19']},
     'psutilversion': {'history_size': 3600.0},
     'quicklook': {'history_size': 3600.0,
                   'quicklook_cpu_careful': 50.0,
                   'quicklook_cpu_critical': 90.0,
                   'quicklook_cpu_warning': 70.0,
                   'quicklook_disable': ['False'],
                   'quicklook_mem_careful': 50.0,
                   'quicklook_mem_critical': 90.0,
                   'quicklook_mem_warning': 70.0,
                   'quicklook_percentage_char': ['|'],
                   'quicklook_swap_careful': 50.0,
                   'quicklook_swap_critical': 90.0,
                   'quicklook_swap_warning': 70.0},
     'raid': {'history_size': 3600.0, 'raid_disable': ['True']},
     'sensors': {'history_size': 3600.0,
                 'sensors_battery_careful': 80.0,
                 'sensors_battery_critical': 95.0,
                 'sensors_battery_warning': 90.0,
                 'sensors_disable': ['False'],
                 'sensors_refresh': 4.0,
                 'sensors_temperature_core_careful': 60.0,
                 'sensors_temperature_core_critical': 80.0,
                 'sensors_temperature_core_warning': 70.0,
                 'sensors_temperature_hdd_careful': 45.0,
                 'sensors_temperature_hdd_critical': 60.0,
                 'sensors_temperature_hdd_warning': 52.0},
     'smart': {'history_size': 3600.0, 'smart_disable': ['True']},
     'system': {'history_size': 3600.0,
                'system_disable': ['False'],
                'system_refresh': 60},
     'uptime': {'history_size': 3600.0},
     'wifi': {'history_size': 3600.0,
              'wifi_careful': -65.0,
              'wifi_critical': -85.0,
              'wifi_disable': ['True'],
              'wifi_hide': ['lo', 'docker.*'],
              'wifi_warning': -75.0}}

N
nicolargo 已提交
1349
Limits/thresholds for the cpu plugin::
N
nicolargo 已提交
1350

N
nicolargo 已提交
1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374
    # curl http://localhost:61208/api/3/cpu/limits
    {'cpu_ctx_switches_careful': 160000.0,
     'cpu_ctx_switches_critical': 200000.0,
     'cpu_ctx_switches_warning': 180000.0,
     'cpu_disable': ['False'],
     'cpu_iowait_careful': 20.0,
     'cpu_iowait_critical': 25.0,
     'cpu_iowait_warning': 22.5,
     'cpu_steal_careful': 50.0,
     'cpu_steal_critical': 90.0,
     'cpu_steal_warning': 70.0,
     'cpu_system_careful': 50.0,
     'cpu_system_critical': 90.0,
     'cpu_system_log': ['False'],
     'cpu_system_warning': 70.0,
     'cpu_total_careful': 65.0,
     'cpu_total_critical': 85.0,
     'cpu_total_log': ['True'],
     'cpu_total_warning': 75.0,
     'cpu_user_careful': 50.0,
     'cpu_user_critical': 90.0,
     'cpu_user_log': ['False'],
     'cpu_user_warning': 70.0,
     'history_size': 3600.0}
A
Alessio Sergi 已提交
1375