, (*1)
README
What is MuninClientWrapper?
MuninClientWrapper is a PHP wrapper for munin node. It is fully written on PHP.
It allows developers to connect to munin-node and get munin version, list of installed plugins,
plugins values, plugins configs., (*2)
Requirements
MuninClientWrapper is only supported on PHP 5.3 and up., (*3)
Installation
The best way to install MuninClientWrapper is via Composer:
php composer.phar require konstantin-kuklin/munin-client-wrapper:dev-master, (*4)
Documentation
How get munin version:
$muninClient = new \Munin\Client($host,$port = 4949);
$muninClient->getVersion();, (*5)
will return string with value like: 2.0.16, (*6)
$port not required, by default 4949, (*7)
How get plugins list:
$muninClient = new \Munin\Client($host,$port = 4949);
$muninClient->getPluginsList();, (*8)
will return array vector like: array([0] => 'cpu', [1] => 'df' .... [29] => 'uptime'), (*9)
How get plugin values:
$muninClient = new \Munin\Client($host);
$muninClient->getPluginValue('cpu');, (*10)
will return array map like: array([user] => 234234, [nice] => 3573 [system] => 8644 ....), (*11)
How to change timeout for reading:
$muninClient = new \Munin\Client($host);
$muninClient->setReadTimeOut($seconds, $microseconds = 0), (*12)
by default is 2 seconds for each read operation from munin socket., (*13)