Zabbix Agent implemented in PHP for long living php-servers
{
"require" : {
"a1s/php-zabbix-agent" : "dev-master"
},
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [
{
"url": "https://github.com/wizardjedi/php-zabbix-agent.git",
"type": "git"
}
]
}
$ composer update
include("vendor/autoload.php");
<?php
include("vendor/autoload.php");
$agent = ZabbixAgent::create(10051);
$agent->start();
$agent->setItem("some.key", ZabbixTimeDuration::now());
while (true) {
echo "Usefull payload\n";
$agent->tick();
usleep(500000);
}
ZabbixPrimitiveItem
- holds primitive values like int, string, float. Returnvar_export()
'ed string for object or arrayZabbixTimeDuration
- holds duration from moment in past to current time.- Use
acceptIfNewer($timeValue)
to move moment near in past
- Use
ZabbixAvgRate
- calculats rate of processing- Use
acquire($count)
method to inform item of processed objects count.
- Use
Checkout project build status on: https://travis-ci.org/wizardjedi/php-zabbix-agent