PHPackages                             confirm-it-solutions/php-zabbix-api - 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. [API Development](/categories/api)
4. /
5. confirm-it-solutions/php-zabbix-api

ActiveLibrary[API Development](/categories/api)

confirm-it-solutions/php-zabbix-api
===================================

PhpZabbixApi library

2.5.0(4y ago)118148.6k—1.2%61[3 issues](https://github.com/confirm/PhpZabbixApi/issues)MITPHPPHP ^5.3 || ^7.0

Since May 11Pushed 4y ago16 watchersCompare

[ Source](https://github.com/confirm/PhpZabbixApi)[ Packagist](https://packagist.org/packages/confirm-it-solutions/php-zabbix-api)[ Docs](https://github.com/confirm/PhpZabbixApi)[ RSS](/packages/confirm-it-solutions-php-zabbix-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (20)Used By (0)

PhpZabbixApi
============

[](#phpzabbixapi)

The 3.x versions of this package are compatible and tested with Zabbix™ from version 3.0.0 up to 3.4.15. If you are migrating this package from 2.x to 3.0, please follow the [upgrade notes](UPGRADE-3.0.md).

[![Packagist Version](https://camo.githubusercontent.com/2fb5d0990f4ede2b38af0a2c324ae7955c2c9837249f75e1988af9d46581af98/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6e6669726d2d69742d736f6c7574696f6e732f7068702d7a61626269782d617069)](https://packagist.org/packages/confirm-it-solutions/php-zabbix-api)[![Packagist License](https://camo.githubusercontent.com/1767396e95e3f01c748d2727d2a0e23ed7e41437af3dccf545a81e01da2d8559/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636f6e6669726d2d69742d736f6c7574696f6e732f7068702d7a61626269782d617069)](https://packagist.org/packages/confirm-it-solutions/php-zabbix-api)

[![Packagist Downloads](https://camo.githubusercontent.com/19ffd3a9e092f89b5a0d003222672162ff8be66c61a037efe9eb5915c42e4f13/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6e6669726d2d69742d736f6c7574696f6e732f7068702d7a61626269782d617069)](https://packagist.org/packages/confirm-it-solutions/php-zabbix-api/stats)

[![Test](https://github.com/confirm/PhpZabbixApi/actions/workflows/test.yaml/badge.svg)](https://github.com/confirm/PhpZabbixApi/actions/workflows/test.yaml)[![Quality assurance](https://github.com/confirm/PhpZabbixApi/actions/workflows/qa.yaml/badge.svg)](https://github.com/confirm/PhpZabbixApi/actions/workflows/qa.yaml)[![Lint](https://github.com/confirm/PhpZabbixApi/actions/workflows/lint.yaml/badge.svg)](https://github.com/confirm/PhpZabbixApi/actions/workflows/lint.yaml)

About
-----

[](#about)

PhpZabbixApi is an open-source PHP SDK to communicate with the [Zabbix JSON-RPC API](https://www.zabbix.com/documentation/3.4/manual/api).

Because this package is generated directly from the origin Zabbix PHP front-end source code, each real Zabbix JSON-RPC API method is implemented directly as a PHP method. This means PhpZabbixApi is IDE-friendly, because you've a declared PHP method for each API method, and there are no PHP magic functions or alike.

License
-------

[](#license)

PhpZabbixApi is licensed under the [MIT license](LICENSE).

Installing
----------

[](#installing)

Make sure the version of the package you are trying to install is compatible with your Zabbix API version. If you aren't sure about your Zabbix API version, send a request to the `apiinfo.version` method:

```
curl -X POST  \
    -H 'Content-Type: application/json-rpc' \
    -d '{"jsonrpc":"2.0","method":"apiinfo.version","params":{},"id":1}'

```

Replace `` with your Zabbix API endpoint (for example, "[https://your-zabbix-domain/api\_jsonrpc.php](https://your-zabbix-domain/api_jsonrpc.php)"). Then, you will be able to install the PhpZabbixApi version that is better for you:

```
composer require confirm-it-solutions/php-zabbix-api:

```

All [tagged](https://github.com/confirm/PhpZabbixApi/tags) versions can be installed, for example:

```
composer require confirm-it-solutions/php-zabbix-api:^3.0

```

or:

```
composer require confirm-it-solutions/php-zabbix-api:^3.2

```

The tag names may include [build metadata](https://semver.org/#spec-item-10) (the part after the plus sign) to easily identify which range of Zabbix API versions are supported. By instance, the tag `42.1.2+z3.0.0-z3.4.15` denotes that PhpZabbixApi version `42.1.2`is compatible and tested with Zabbix API from version `3.0.0` to `3.4.15`.

If you're looking for more *bleeding-edge* versions (e.g. for testing), then you could also use development [branches](https://github.com/confirm-it-solutions/PhpZabbixApi/branches)by setting a specific [stability flag](https://getcomposer.org/doc/04-schema.md#package-links)in the version constraint:

```
composer require confirm-it-solutions/php-zabbix-api:3.0@dev

```

Using the thing
---------------

[](#using-the-thing)

### Naming concept

[](#naming-concept)

To translate a Zabbix API call into an SDK method call, you can simply do the following:

1. Remove the dot;
2. Capitalize the first character of the action.

Example:

Zabbix APIPHP SDK`graph.get``graphGet()``host.massUpdate``hostMassUpdate()``dcheck.isWritable``dcheckIsWritable()`### Basic usage

[](#basic-usage)

To use the PhpZabbixApi you just have to load `ZabbixApi.php`, create a new `ZabbixApi`instance, and you're ready to go:

```
