Skip to content

The Glances RESTFULL JSON API

Nicolas Hennion edited this page Jul 7, 2014 · 32 revisions

Only for Glances v2.1 or higher !

Glances HTTP API is based on RESTFULL/JSON.

Serveur side

$ glances -w

Glances Web server is running on 0.0.0.0:61208

Client side


/api/2/pluginslist

Return the plugins available on the Glances server.

Request parameters:

  • None

Request response:

  • 200 - application/json: list
  • 404 - Returned if the property does not exist

Example: /api/v2/pluginslist

["load", "core", "uptime", "fs", "memswap", "monitor", "percpu", "mem", "sensors", "system", "alert", "psutilversion", "processlist", "diskio", "hddtemp", "processcount", "batpercent", "now", "cpu", "network", "help"]

/api/2/:plugin

Return the stats for the specific plugin

Request parameters:

  • plugin: plugin name

Request response:

  • 200 - application/json: dictionnary
  • 404 - Returned if the property does not exist

Example: /api/v2/mem

{"available": 5071183872, "used": 3255848960, "cached": 1827352576, "percent": 39.1, "free": 5071183872, "inactive": 1388982272, "active": 3679604736, "total": 8327032832, "buffers": 477982720}

/api/2/:plugin/:item

Return the item stat for the specific plugin

Request parameters:

  • plugin: plugin name
  • item: item to retreive

Request response:

  • 200 - application/json: dictionnary
  • 404 - Returned if the property does not exist

Example: /api/v2/mem/used

Return the memory used (RAM)

{"used": 3255848960}

Example: _/api/v2/processlist/pid

Return the pid list of processes

[1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 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, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 90, 92, 93, 113, 114, 165, 167, 168, 169, 170, 171, 172, 191, 192, 370, 376, 429, 430, 454, 468, 522, 562, 770, 773]