PHPackages                             zuogechengxu/zabbix - 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. zuogechengxu/zabbix

ActiveLibrary[API Development](/categories/api)

zuogechengxu/zabbix
===================

Laravel Zabbix Api

v1.0(3y ago)13MITPHPPHP &gt;=7.1

Since Nov 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/zl-php/zabbix-api)[ Packagist](https://packagist.org/packages/zuogechengxu/zabbix)[ RSS](/packages/zuogechengxu-zabbix/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel Zabbix SDK
==================

[](#laravel-zabbix-sdk)

一个基于 Laravel 开发的 Zabbix SDK

环境要求
----

[](#环境要求)

- PHP &gt;= 7.1
- pimple/pimple &gt;= 3.5

安装
--

[](#安装)

使用 [composer](http://getcomposer.org/):

目前阿里云Composer镜像同步问题尚未解决，建议使用官方镜像或者腾讯等镜像

```
# 取消当前镜像配置
composer config -g --unset repos.packagist

# 使用腾讯镜像
composer config -g repos.packagist composer https://mirrors.tencent.com/composer/

# 安装
composer require zuogechengxu/zabbix
```

使用
--

[](#使用)

### 初始化

[](#初始化)

```
use Zuogechengxu\Zabbix\Application;

$zbx_config = [
    'zabUrl' => 'http://xxx.xx.xx.xx',
    'zabUser' => 'Admin',
    'zabPassword' => 'zabbix'
];

$app = new Application($zbx_config);
```

### 获取用户令牌（user.login）

[](#获取用户令牌userlogin)

```
use Zuogechengxu\Zabbix\Application;

# 获取用户令牌，返回数组，设置了缓存2小时
$token = $app->auth_token->getAuthToken();

# 刷新令牌
$app->auth_token->refresh()

# 获取zabbix api版本，返回字符串
$version = $app->auth_token->getApiVersion();
```

### 调用其他api，示例

[](#调用其他api示例)

```
use Zuogechengxu\Zabbix\Application;

# 使用以下方法可以直接调用 Zabbix 任意 API，该方法默认自动处理了用户令牌逻辑，以获取主机为例。
$params = [
    "filter" => ["host" => ['Zabbix server']]
];

# 返回数据
$host = $app->rpc->call('host.get', $params)

# 返回原始 response 对象
$host = $app->rpc->call('host.get', $params, true)
```

说明
--

[](#说明)

因该项目缓存 Token 直接使用了Laravel Cache 的 Facades，建议将 CACHE\_DRIVER=file 改为 CACHE\_DRIVER=redis

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1279d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fca6b6d9c0b5cfa9c98c5b2cad4228e90e2096fec04f210b3182e34b8c21984a?d=identicon)[zl-php](/maintainers/zl-php)

---

Top Contributors

[![zl-php](https://avatars.githubusercontent.com/u/19991986?v=4)](https://github.com/zl-php "zl-php (6 commits)")

---

Tags

api-zabbixlaravellaravel-zabbixzabbixzabbix-apizabbixapi

### Embed Badge

![Health badge](/badges/zuogechengxu-zabbix/health.svg)

```
[![Health](https://phpackages.com/badges/zuogechengxu-zabbix/health.svg)](https://phpackages.com/packages/zuogechengxu-zabbix)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
