ikke/phpzabbix 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ikke/phpzabbix

最新稳定版本:v0.4

Composer 安装命令:

composer require ikke/phpzabbix

包简介

PHP Zabbix API Client

README 文档

README

Zabbix PHP API library based on pyzabbix.

Example

$api = phpzabbix\PHPZabbix::withDefaultClient('http://example.com/zabbix/api_jsonrpc.php');
$api->login('username', 'password');

$hosts = $api->host->get(['output' => ['hostid', 'name']]);

It's also possible to directly set the authorization token, either obtained earlier by logging in, or an API token:

$api = phpzabbix\PHPZabbix::withDefaultClient('http://example.com/zabbix/api_jsonrpc.php');
$api->authToken = 'abcdef123456';

$hosts = $api->host->get(['output' => ['hostid', 'name']]);

Error handling

The following exceptions can be thrown:

  • phpzabbix\Exception\NotAuthorized when trying to make an API call with an invalid or expired auth hash.

  • phpzabbix\Exception\InvalidCredentials when trying to login with invalid credentials.

  • phpzabbix\JSONRPC\ErrorException on other errors, such as invalid API calls

Documentation

The PHPZabbix class does not know every API call, but just translates $api->obj->method() to 'obj.method'. The method call takes an array which is passed as params.

Refer to the Zabbix API for more information about the Zabbix API itself.

Compattibility

This library should work with Zabbix 3.0 and higher. Older versions should also work, but that has not been verified.

License

This code is distributed under the GPLv3 license.

统计信息

  • 总下载量: 12.94k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2017-05-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固