Git Product home page Git Product logo

zabbix-sender's Introduction

PHP Zabbix Sender

Build Status MIT licensed Test Coverage

Synopsis

Modern php implementation of Zabbix Sender Client.
Support php versions PHP 5.4 and above.
Working with Zabbix 2.0.8, 2.1.7+ and supports version 4.0.

Code Example

Easy to use:

$sender = new \Disc\Zabbix\Sender('localhost', 10051);
$sender->addData('hostname', 'some.key.2', 0.567);
$sender->send();

See sample/sample.php

Installation

Use composer for installation composer require disc/php-zabbix-sender

Tests

Run vendor/bin/phpunit for tests

Contributors

Alexandr Hacicheant [[email protected]]

License

The MIT License (MIT)

zabbix-sender's People

Contributors

disc avatar tarlepp avatar zulgabis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

zabbix-sender's Issues

socketReceive does not work

$this->socketReceive returns the return value of php function socket_recv(), which according to documentation returns number of bytes received (and not data received). https://secure.php.net/manual/en/function.socket-recv.php

However function $this->parseResponse assigns it to $response and tries to parse it which fails.
Or does it work for you? I am trying it on old server with PHP 5.3, but don't see anything in PHP manual what could make socket_recv() return the data instead of number of bytes in higher PHP versions...

Fix is to return $response from socketReceive (or something better which would return true/false and assign the data to some variable for further processing - like $this->raw_response).

Not working with Zabbix 4.0.4

Not working with version Zabbix 4.0.4
15964:20190210:005912.664 Message size 1701978747 from 1.1.1.1 exceeds the maximum size 134217728 bytes. Message ignored.
15964:20190210:005912.664 Message size 1701978747 from 1.1.1.1 exceeds the maximum size 134217728 bytes. Message ignored.
15965:20190210:005912.665 Message size 1701978747 from 1.1.1.1 exceeds the maximum size 134217728 bytes. Message ignored.
15967:20190210:005912.665 Message size 1701978747 from 1.1.1.1 exceeds the maximum size 134217728 bytes. Message ignored.
15966:20190210:005912.665 Message size 1701978747 from 1.1.1.1 exceeds the maximum size 134217728 bytes. Message ignored.
15968:20190210:005912.666 Message size 1701978747 from 1.1.1.1 exceeds the maximum size 134217728 bytes. Message ignored.
15968:20190210:005912.666 Message size 1701978747 from 1.1.1.1 exceeds the maximum size 134217728 bytes. Message ignored.
15968:20190210:005912.666 Message size 1701978747 from 1.1.1.1 exceeds the maximum size 134217728 bytes. Message ignored.
15968:20190210:005912.666 Message size 1701978747 from 1.1.1.1 exceeds the maximum size 134217728 bytes. Message ignored.
15966:20190210:005912.666 Message size 1701978747 from 1.1.1.1 exceeds the maximum size 134217728 bytes. Message ignored.
15966:20190210:005912.667 Message size 1701978747 from 1.1.1.1 exceeds the maximum size 134217728 bytes. Message ignored.
15970:20190210:005912.739 Message size 1701978747 from 1.1.1.2 exceeds the maximum size 134217728 bytes. Message ignored.
15965:20190210:005913.045 Message size 1701978747 from 1.1.1.2 exceeds the maximum size 134217728 bytes. Message ignored.
15964:20190210:005913.354 Message size 1701978747 from 1.1.1.2 exceeds the maximum size 134217728 bytes. Message ignored.
15966:20190210:005913.851 Message size 1701978747 from 1.1.1.2 exceeds the maximum size 134217728 bytes. Message ignored.
15968:20190210:005914.141 Message size 1701978747 from 1.1.1.2 exceeds the maximum size 134217728 bytes. Message ignored.
15964:20190210:005914.427 Message size 1701978747 from 1.1.1.2 exceeds the maximum size 134217728 bytes. Message ignored.
15968:20190210:005914.853 Message size 1701978747 from 1.1.1.2 exceeds the maximum size 134217728 bytes. Message ignored.

Doesn't work on PHP 5.3

In description you say it works in PHP 5.3. But you use short array tags [] (instead of array()), which were introduced only in PHP 5.4.
The fix is easy - change [] to array() in few places where arrays are initialized + few other places where data is assigned to them.

I know it makes no sense to make such changes to support a PHP version which is EOL for many years (although I still got it on one legacy server), so I suggest to change the README and add a link to this issue in case someone needs to run it on PHP 5.3 also...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.