PHPackages                             fliix-cloud/php-zabbix-sender - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. fliix-cloud/php-zabbix-sender

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

fliix-cloud/php-zabbix-sender
=============================

PHP Implementation of Zabbix Sender (supports Zabbix 7.x) forked from webmasterskaya/php-zabbix-sender

1.0.5(1mo ago)1318Apache-2.0PHPPHP ^8.4CI failing

Since Mar 17Pushed 1mo agoCompare

[ Source](https://github.com/fliix-cloud/php-zabbix-sender)[ Packagist](https://packagist.org/packages/fliix-cloud/php-zabbix-sender)[ RSS](/packages/fliix-cloud-php-zabbix-sender/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (8)Versions (6)Used By (0)

fliix/php-zabbix-sender
=======================

[](#fliixphp-zabbix-sender)

[![PHP](https://camo.githubusercontent.com/cf871f594e557c5b9ae8715a2b7207b9b73686ee83156cd0308489979d0d84e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.org/)[![License](https://camo.githubusercontent.com/109222cb0d1f59ed2e77b56722653623fa45f93e2bb201a6eef8561d26a52185/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d417061636865253230322e302d677265656e2e737667)](LICENSE)[![Version](https://camo.githubusercontent.com/acd0315cc88f23ca031d14030a82baad91de1452da8f25f59b71751705f4e023/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e352d626c75652e737667)](https://github.com/fliix-cloud/php-zabbix-sender/releases)[![Zabbix](https://camo.githubusercontent.com/bc29fc6f90e4a8c9238ef3bd89e52bbe33a33786edc04fd782594917d79b67bc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5a61626269782d372e782d7265643f6c6f676f3d7a6162626978266c6f676f436f6c6f723d7768697465)](https://www.zabbix.com/)

PHP implementation of the Zabbix Sender protocol — compatible with **Zabbix 7.x**.

A fork of [`webmasterskaya/php-zabbix-sender`](https://github.com/webmasterskaya/php-zabbix-sender).

Highlights
----------

[](#highlights)

- Unencrypted **or** TLS PSK connections to Zabbix Server / Proxy
- PSK uses **TLS 1.2** explicitly — works with **OpenSSL 3.x** and Zabbix 7.x PSK cipher suites (RFC 4279)
- Simple single-value and **batch** sending
- Negotiable cipher list, with sane defaults
- Built on `symfony/options-resolver` + `symfony/validator` for robust option handling

> See the official Zabbix Sender docs: [https://www.zabbix.com/documentation/current/en/manpages/zabbix\_sender](https://www.zabbix.com/documentation/current/en/manpages/zabbix_sender)

Contents
--------

[](#contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Quick start – unencrypted connection](#quick-start--unencrypted-connection)
- [Batch mode](#batch-mode)
- [TLS PSK connection (Zabbix 7.x)](#tls-psk-connection-zabbix-7x)
- [All available options](#all-available-options)
- [Protocol compatibility](#protocol-compatibility)
- [Development](#development)
- [License](#license)

---

Requirements
------------

[](#requirements)

RequirementVersionPHP≥ 8.4ext-socketsanyopenssl binaryany (needed for PSK connections)---

Installation
------------

[](#installation)

```
composer require fliix-cloud/php-zabbix-sender
```

---

Quick start – unencrypted connection
------------------------------------

[](#quick-start--unencrypted-connection)

1. Create a **Trapper** item in Zabbix
    →
2. Instantiate the sender:

    ```
    $sender = new \Fliix\ZabbixSender\ZabbixSender([
        'server' => '127.0.0.1',
        'host'   => 'my-zabbix-host',
    ]);
    ```
3. Send a single value:

    ```
    $sender->send('my.trapper.key', 'some value');
    ```
4. Check the result:

    ```
    $info = $sender->getLastResponseInfo();
    echo $info->getTotal();     // total items submitted
    echo $info->getProcessed(); // items accepted by Zabbix
    echo $info->getFailed();    // items rejected by Zabbix
    echo $info->getSpent();     // processing time in seconds
    ```

---

Batch mode
----------

[](#batch-mode)

Collect multiple values and send them in a single request:

```
$sender = new \Fliix\ZabbixSender\ZabbixSender([
    'server' => '127.0.0.1',
    'host'   => 'my-zabbix-host',
]);

$sender->batch()
    ->send('cpu.load',    '0.42')
    ->send('memory.free', '1024')
    ->send('disk.used',   '512', 'other-host'); // override host per item

$success = $sender->execute();
```

---

TLS PSK connection (Zabbix 7.x)
-------------------------------

[](#tls-psk-connection-zabbix-7x)

### Background

[](#background)

Zabbix supports Pre-Shared Key (PSK) encryption between the sender and the Zabbix Server/Proxy. PSK uses **TLS 1.2** cipher suites defined in RFC 4279 (e.g. `PSK-AES256-CBC-SHA`). These cipher suites are **not available in TLS 1.3** and are disabled by default in **OpenSSL 3.x**, which is why the connection must explicitly use TLS 1.2.

### Step 1 – Generate a PSK key

[](#step-1--generate-a-psk-key)

A PSK key is a hex-encoded random string. Generate one with:

```
openssl rand -hex 32
# example output: a3f1b2c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2
```

Keep this value – you will need it both in Zabbix and in your PHP code.

### Step 2 – Configure PSK in Zabbix

[](#step-2--configure-psk-in-zabbix)

1. Open the Zabbix web UI and navigate to **Configuration → Hosts**
2. Select the host that will receive the data.
3. Go to the **Encryption** tab.
4. Set **Connections from host** to **PSK**.
5. Fill in:
    - **PSK identity** – a human-readable name, e.g. `hostname`
    - **PSK** – the hex key generated in Step 1.
6. Save the host.

### Step 3 – Use PSK in PHP

[](#step-3--use-psk-in-php)

```
$sender = new \Fliix\ZabbixSender\ZabbixSender([
    'server'           => '127.0.0.1',
    'port'             => 10051,
    'host'             => 'my-zabbix-host',
    'tls-connect'      => 'psk',
    'tls-psk-identity' => 'my-php-sender',
    'tls-psk'          => 'a3f1b2c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2',
]);

$sender->send('my.trapper.key', 'secure value');

$info = $sender->getLastResponseInfo();
echo "Processed: {$info->getProcessed()}, Failed: {$info->getFailed()}";
```

#### Optional: override the PSK cipher

[](#optional-override-the-psk-cipher)

By default, the library uses a TLS 1.2 PSK cipher list to improve compatibility with different OpenSSL/Zabbix builds:

`PSK-AES128-GCM-SHA256:PSK-AES256-GCM-SHA384:PSK-AES128-CBC-SHA256:PSK-AES256-CBC-SHA384:PSK-AES128-CBC-SHA:PSK-AES256-CBC-SHA`

If your Zabbix Server is configured to use a specific cipher, pass `tls-cipher` explicitly:

```
$sender = new \Fliix\ZabbixSender\ZabbixSender([
    'server'           => '127.0.0.1',
    'tls-connect'      => 'psk',
    'tls-psk-identity' => 'my-php-sender',
    'tls-psk'          => 'a3f1b2c4...',
    'tls-cipher'       => 'PSK-AES128-CBC-SHA',
]);
```

### PSK with batch mode

[](#psk-with-batch-mode)

PSK works transparently with batch mode. The same `tls-connect` options are used — just call `batch()` before sending:

```
$sender = new \Fliix\ZabbixSender\ZabbixSender([
    'server'           => '127.0.0.1',
    'port'             => 10051,
    'host'             => 'my-zabbix-host',
    'tls-connect'      => 'psk',
    'tls-psk-identity' => 'my-php-sender',
    'tls-psk'          => 'a3f1b2c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2',
]);

$sender->batch()
    ->send('cpu.load',    '0.42')
    ->send('memory.free', '1024')
    ->send('disk.used',   '512', 'other-host'); // override host per item

$success = $sender->execute();
```

### Troubleshooting PSK

[](#troubleshooting-psk)

SymptomLikely causeFix`SSL alert handshake failure`Cipher mismatch or TLS version mismatchEnsure `tls-cipher` matches what Zabbix accepts; Zabbix 7 requires TLS 1.2`no cipher can be selected`OpenSSL 3.x with PSKUse `-tls1_2` and a PSK-specific cipher (already handled by this library)`Processed 0 Failed 1`Item key or host name mismatchVerify the Zabbix host name and trapper item keyConnection refusedWrong server/port or firewallCheck `server`/`port` options and Zabbix Server firewall rules---

Protocol compatibility (zabbix\_sender)
---------------------------------------

[](#protocol-compatibility-zabbix_sender)

This library follows the Zabbix sender protocol frame format:

- Header magic/version: `ZBXD\1`
- Header length: 13 bytes total
- Data length: 8 bytes little-endian (`pack("VV", $length, 0x00)`)
- Payload: JSON with `request: "sender data"` and `data: [...]`

This matches the Zabbix protocol docs for `zabbix_sender` and `header_datalen`.

---

All available options
---------------------

[](#all-available-options)

All options are supported by both connection types unless noted.

OptionTypeDefaultDescription`server``string`**required**Zabbix Server or Proxy hostname / IP`port``int``10051`Zabbix Server port`timeout``int``30`Socket read/write timeout in seconds`host``string`**required**Zabbix host name the data belongs to`tls-connect``string``unencrypted``unencrypted` or `psk` (PSK only)`tls-psk-identity``string`–Required when `tls-connect=psk``tls-psk``string`–Required when `tls-connect=psk`; must be a hex-encoded key`tls-cipher``string`*see below*Override TLS 1.2 PSK cipher list`tls-cipher13``string`–Override TLS 1.3 ciphersuite (OpenSSL ≥ 1.1.1)The default — used when `tls-cipher` is not set and `tls-connect=psk` — is:

```
PSK-AES128-GCM-SHA256:PSK-AES256-GCM-SHA384:PSK-AES128-CBC-SHA256:PSK-AES256-CBC-SHA384:PSK-AES128-CBC-SHA:PSK-AES256-CBC-SHA

```

---

License
-------

[](#license)

This project is licensed under the **Apache License 2.0**.
See the [LICENSE](LICENSE) file for the full text.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance91

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Total

5

Last Release

43d ago

PHP version history (2 changes)1.0.0PHP &gt;=8.3

1.0.1PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/139812224?v=4)[fliix](/maintainers/fliix-cloud)[@fliix-cloud](https://github.com/fliix-cloud)

---

Top Contributors

[![kernusr](https://avatars.githubusercontent.com/u/16020878?v=4)](https://github.com/kernusr "kernusr (45 commits)")[![fliix-cloud](https://avatars.githubusercontent.com/u/139812224?v=4)](https://github.com/fliix-cloud "fliix-cloud (9 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (5 commits)")

---

Tags

monitoringphppsktlszabbixzabbix-sender

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/fliix-cloud-php-zabbix-sender/health.svg)

```
[![Health](https://phpackages.com/badges/fliix-cloud-php-zabbix-sender/health.svg)](https://phpackages.com/packages/fliix-cloud-php-zabbix-sender)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M775](/packages/sylius-sylius)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.9M534](/packages/pimcore-pimcore)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k18.3M417](/packages/easycorp-easyadmin-bundle)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M666](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
