Skip to content

Make a Glances API in order to use Glances as a Python lib #3237

Open
@nicolargo

Description

@nicolargo

Implement a new experimental Glances lib (target release for a stable API will be Glances 5.0).

Example:

import glances

gl = glances.GlancesAPI()

gl.cpu
print(gl.cpu)
print(gl.cpu['total'])


gl.network.update()
print(gl.network)
print(gl.network[''wlp0s20f3']['bytes_recv'])

The Glances class:

  • can be local (retrieve stats directly)
  • can be use as a proxy to a restfull (or rpc) Glances server
  • Configuration file and args should be implemented

Documentation of the library is a key point.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions