-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update For current zabbix 6.4 #2
Comments
My Current Override according the official docs <?php
declare(strict_types=1);
/**
* Multi Flexi -
*
* @author Vítězslav Dvořák <[email protected]>
* @copyright 2020 Vitex Software
*/
namespace AbraFlexi\MultiFlexi;
use \Zarplata\Zabbix\Request\Packet as ZabbixPacket;
/**
* Description of ZabbixSender
*
* @author vitex
*/
class ZabbixSender extends \Zarplata\Zabbix\ZabbixSender
{
/**
* Make payload for Zabbix server with special Zabbix header
* and datalen
*
* https://www.zabbix.com/documentation/current/en/manual/appendix/protocols/header_datalen
*/
private function makePayload(ZabbixPacket $packet): string
{
$encodedPacket = json_encode($packet);
return self::zbxCreateHeader(strlen($encodedPacket)) . $encodedPacket;
}
/**
* Zabbix Packet Header
*
* @param int $plain_data_size
* @param int $compressed_data_size
*
* @return string
*/
public static function zbxCreateHeader($plain_data_size, $compressed_data_size = null)
{
$flags = self::VERSION;
if (is_null($compressed_data_size)) {
$datalen = $plain_data_size;
$reserved = 0;
} else {
$flags |= 0x02;
$datalen = $compressed_data_size;
$reserved = $plain_data_size;
}
return self::HEADER . chr($flags) . pack("VV", $datalen, $reserved);
}
}
|
you probably meant /cc @idr0id |
Yes, indeed, sorry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is some small differences:
https://www.zabbix.com/documentation/current/en/manual/appendix/protocols/header_datalen
The text was updated successfully, but these errors were encountered: