2017 © Pedro Peláez
 

library phpglances

A PHP library for the Glances XML/RPC API

image

progi1984/phpglances

A PHP library for the Glances XML/RPC API

  • Friday, January 3, 2014
  • by Progi1984
  • Repository
  • 2 Watchers
  • 6 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PHPGlances

A PHP library for the Glances XML/RPC API
, (*1)

What is Glances? - Glances is a CLI system monitor written in Python, (*2)

What does this library do? - If Glances is run as glances -s then information can be retrieved from it using an XML/RPC API, (*3)

Read the specification of the Glances API: - https://github.com/nicolargo/glances/wiki/The-Glances-API-How-To, (*4)

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., (*5)

Example usage:, (*6)

  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 '

    '; foreach($res as $item){ echo '
  • '.$item.'
  • '; } echo '
'; echo 'getCore : <br />'; echo 'Core : '.$oGlances->getCore().'<br />'; echo '<br />'; }

Changelog

Version 0.1 - Initial Release, (*7)

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, (*8)

Version 0.3 current, (*9)

The Versions

03/01 2014

dev-master

9999999-dev

A PHP library for the Glances XML/RPC API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0

 

php monitoring glances