2017 © Pedro Peláez
 

library php-zabbix-agent

Zabbix Agent implemented in PHP for long living php-servers

image

a1s/php-zabbix-agent

Zabbix Agent implemented in PHP for long living php-servers

  • Thursday, January 4, 2018
  • by wizardjedi
  • Repository
  • 1 Watchers
  • 4 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

php-zabbix-agent Build badge image codecov Quality Gate Status

Zabbix Agent implemented in PHP for long living php-servers, (*1)

1. Create composer.json file

{
   "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"
        }
   ]
}

2. Update composer deps

$ composer update

3. Add autoload.php to your app

include("vendor/autoload.php");

4. Simple script

<?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);
}

5. Main classes

  • ZabbixPrimitiveItem - holds primitive values like int, string, float. Return var_export()'ed string for object or array
  • ZabbixTimeDuration - holds duration from moment in past to current time.
    • Use acceptIfNewer($timeValue) to move moment near in past
  • ZabbixAvgRate - calculats rate of processing
    • Use acquire($count) method to inform item of processed objects count.

6. CI project page

Checkout project build status on: https://travis-ci.org/wizardjedi/php-zabbix-agent, (*2)

The Versions

04/01 2018

dev-master

9999999-dev

Zabbix Agent implemented in PHP for long living php-servers

  Sources   Download

The Development Requires

by A1-Systems Team