{"id":37262533,"url":"https://github.com/zl-php/zabbix-api","last_synced_at":"2026-01-15T23:21:48.477Z","repository":{"id":63025420,"uuid":"564569853","full_name":"zl-php/zabbix-api","owner":"zl-php","description":"一个基于 Laravel 开发的 Zabbix SDK","archived":false,"fork":false,"pushed_at":"2022-11-11T06:00:25.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T13:58:08.536Z","etag":null,"topics":["api-zabbix","laravel","laravel-zabbix","zabbix","zabbix-api","zabbixapi"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zl-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-11T01:51:52.000Z","updated_at":"2022-11-11T06:31:31.000Z","dependencies_parsed_at":"2022-11-11T07:18:47.208Z","dependency_job_id":null,"html_url":"https://github.com/zl-php/zabbix-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zl-php/zabbix-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zl-php%2Fzabbix-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zl-php%2Fzabbix-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zl-php%2Fzabbix-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zl-php%2Fzabbix-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zl-php","download_url":"https://codeload.github.com/zl-php/zabbix-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zl-php%2Fzabbix-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28473974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T22:27:41.514Z","status":"ssl_error","status_checked_at":"2026-01-15T21:54:47.910Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-zabbix","laravel","laravel-zabbix","zabbix","zabbix-api","zabbixapi"],"created_at":"2026-01-15T23:21:47.719Z","updated_at":"2026-01-15T23:21:48.466Z","avatar_url":"https://github.com/zl-php.png","language":"PHP","readme":"\u003ch1 align=\"center\"\u003eLaravel Zabbix SDK\u003c/h1\u003e\n\n一个基于 Laravel 开发的 Zabbix SDK\n\n## 环境要求\n- PHP \u003e= 7.1\n- pimple/pimple \u003e= 3.5\n\n## 安装\n使用 [composer](http://getcomposer.org/):\n\n目前阿里云Composer镜像同步问题尚未解决，建议使用官方镜像或者腾讯等镜像\n\n```shell\n# 取消当前镜像配置\ncomposer config -g --unset repos.packagist\n\n# 使用腾讯镜像\ncomposer config -g repos.packagist composer https://mirrors.tencent.com/composer/\n\n# 安装\ncomposer require zuogechengxu/zabbix\n```\n\n## 使用\n\n### 初始化\n``` php\nuse Zuogechengxu\\Zabbix\\Application;\n\n$zbx_config = [\n    'zabUrl' =\u003e 'http://xxx.xx.xx.xx',\n    'zabUser' =\u003e 'Admin',\n    'zabPassword' =\u003e 'zabbix'\n];\n\n$app = new Application($zbx_config);\n```\n\n### 获取用户令牌（user.login）\n``` php\nuse Zuogechengxu\\Zabbix\\Application;\n\n# 获取用户令牌，返回数组，设置了缓存2小时\n$token = $app-\u003eauth_token-\u003egetAuthToken();\n\n# 刷新令牌\n$app-\u003eauth_token-\u003erefresh()\n\n# 获取zabbix api版本，返回字符串\n$version = $app-\u003eauth_token-\u003egetApiVersion();\n```\n\n### 调用其他api，示例\n``` php\nuse Zuogechengxu\\Zabbix\\Application;\n\n# 使用以下方法可以直接调用 Zabbix 任意 API，该方法默认自动处理了用户令牌逻辑，以获取主机为例。\n$params = [\n    \"filter\" =\u003e [\"host\" =\u003e ['Zabbix server']]\n];\n\n# 返回数据\n$host = $app-\u003erpc-\u003ecall('host.get', $params)\n\n# 返回原始 response 对象\n$host = $app-\u003erpc-\u003ecall('host.get', $params, true)\n```\n\n## 说明\n\n因该项目缓存 Token 直接使用了Laravel Cache 的 Facades，建议将 CACHE_DRIVER=file 改为 CACHE_DRIVER=redis\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzl-php%2Fzabbix-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzl-php%2Fzabbix-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzl-php%2Fzabbix-api/lists"}