Download the PHP package kamermans/zabbix-client without Composer

On this page you can find all versions of the php package kamermans/zabbix-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zabbix-client

zabbix-client

This is a simple, yet powerful Zabbix API client for PHP. I have made no attempt to model the Zabbix API in PHP functions, but rather, I have made the interface extremely easy to use in order to query the Zabbix JSON-RPC API.

There are several examples in examples/ that should be quite useful. You can even make a copy of zabbix_auth.php and call it zabbix_auth_local.php and that file will be used by the examples instead, so you don't need to taint the git repo.

Compatibility

This library is designed and tested for Zabbix 2.2 and it's likely to have problems with other versions. If you want to add support for 2.4 (or any other version) you are more than welcome :)

Authentication

Zabbix uses a username and password to connect initially, then an auth token for subsequent requests.

Here's how you connect and authenticate:

Calling Zabbix Endpoints

All the Zabbix endpoints are described in the Zabbix Documentation.

To call and endpoint, use the $client->request(string endpoint, array params=[]) method:

Note that $response is a kamermans\ZabbixClient\ApiResponse object that has some magical properties. In the example above, the Zabbix endpoint apiinfo.version returns a single string, so you can use $response as a string as well.

Most endpoints return an associative array as a response:

As you can see, you can iterate over the response object (although it's still a kamermans\ZabbixClient\ApiResponse).

In this example we also passed an array of parameters as the second argument.

Error Handling

When the Zabbix API returns an error, it is wrapped up into a proper exception and thrown.

There are three types of exceptions that you can catch inside the kamermans\ZabbixClient namespace:

Utility Functions

Response Dumping

For easy troubleshooting of responses, you can use the ApiResponse::dump() function to output the response to the screen, or ApiResponse::dd() to dump and die:

Server Ping

There is a utility function to check to latency (in milliseconds) to the Zabbix Server API:

Complete Example

This example lists all the system items in the Zabbix Server:

Output:


All versions of zabbix-client with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
graze/guzzle-jsonrpc Version ^3.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kamermans/zabbix-client contains the following files

Loading the files please wait ....