An open API service indexing awesome lists of open source software.

https://github.com/zarplata/zabbix-sender-php

Zabbix sender protocol implementation
https://github.com/zarplata/zabbix-sender-php

alert alerting notifications php reporter zabbix

Last synced: 9 months ago
JSON representation

Zabbix sender protocol implementation

Awesome Lists containing this project

README

          

# Zabbix sender

Zabbix sender it's a PHP implementation of Zabbix sender protocol.
With this library you can send any metric to Zabbix server.
Additional information about Zabbix sender protocol and request/response
you can be found in official documentation:
- https://www.zabbix.com/documentation/6.4/manual/appendix/items/trapper
- https://www.zabbix.com/documentation/6.4/manual/appendix/protocols/header_datalen

### Installation
```sh
composer require zarplata/zabbix-sender
```

### Usage
```php
addMetric(new ZabbixMetric('my.super.text.item.key', 'OK'));
$packet->addMetric(new ZabbixMetric('my.super.int.item.key', 1));

// And finally send to Zabbix Server
$sender->send($packet);
```

### Advanced usage options

Sometimes it may be necessary to provide hostname and/or timestamp
of metric. By default construction:
```php
withHostname('my_non_local_hostname')
->withTimestamp(662637600); //Timestamp in past
```

### License

MIT.