https://github.com/wizardjedi/php-zabbix-agent
Zabbix Agent implemented in PHP for long living php-servers
https://github.com/wizardjedi/php-zabbix-agent
php zabbix zabbix-agent
Last synced: 6 months ago
JSON representation
Zabbix Agent implemented in PHP for long living php-servers
- Host: GitHub
- URL: https://github.com/wizardjedi/php-zabbix-agent
- Owner: wizardjedi
- Created: 2016-11-10T19:40:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-15T17:49:59.000Z (about 5 years ago)
- Last Synced: 2024-07-13T09:13:14.462Z (10 months ago)
- Topics: php, zabbix, zabbix-agent
- Language: PHP
- Size: 26.4 KB
- Stars: 8
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## php-zabbix-agent  [](https://codecov.io/gh/wizardjedi/php-zabbix-agent) [](https://sonarcloud.io/dashboard?id=wizardjedi_php-zabbix-agent)
Zabbix Agent implemented in PHP for long living php-servers
## 1. Create `composer.json` file
```json
{
"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
```php
include("vendor/autoload.php");
```## 4. Simple script
```php
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