Get support for Progi1984/PhpGlances

If you're new to LTH, please see our FAQ for more information on what it is we do.

Support Options

Unfortunately, there are currently no active helpers for this repository on the platform. Until they become available, we reccomend the following actions:

View Open Issues

Take a look to see if anyone else has experienced the same issue as you and if they managed to solve it.

Open an Issue

Make sure to read any relevant guidelines for opening issues on this repo before posting a new issue.

Sponsor directly

Check out the page and see if there are any options to sponsor this project or it's developers directly.

Progi1984/PhpGlances

PHPGlances

A PHP library for the Glances XML/RPC API

What is Glances?

  • Glances is a CLI system monitor written in Python

What does this library do?

  • If Glances is run as glances -s then information can be retrieved from it using an XML/RPC API

Read the specification of the Glances API:

Dependencies: Per default, any extensions are useful. But if extensions PHP-Curl, PHP-JSON, PHP-SimpleXML and PHP-XML-RPC are load, then PHPGlances will be more optimal.

Example usage:

  include_once '../PHPGlances/PHPGlances.php';

  $oGlances = new PHPGlances('http://127.0.0.1', 61209);
  $bAlive = $oGlances->pingServer();
  if(!$bAlive){
    echo 'Can\'t connect to the server';
  } else {
    $res = $oGlances->listMethods();
    echo 'listMethods : ';
    echo '<ul>';
    foreach($res as $item){
      echo '<li>'.$item.'</li>';
    }
    echo '</ul>';

    echo 'getCore : <br />';
    echo 'Core : '.$oGlances->getCore().'<br />';
    echo '<br />';
  }

Changelog

Version 0.1

  • Initial Release

Version 0.2

  • ADDED pingServer() which return a boolean to check if Glances server is available
  • ADDED Replacement for functions used in Curl / JSON / SimpleXML / XmlRPC (Issue #3)
  • ADDED getError() which return a string with the intercepted error when a function (like listMethods()) return false
  • ADDED setCacheStatus() which permits to disable and enable the cache & getCacheStatus() which permits to get the status (true or false) of the cache

Version 0.3 current

Our Mission

We want to make open source more sustainable. The entire platform was born from this and everything we do is in aid of this.

Interesting Articles

Thank you for checking out LiveTechHelper |
2025 © lth-dev incorporated

p-e622a1a2