首页 > 解决方案 > Zabbix 计划报告配置 - 无法连接到 Web 服务:无法连接到服务器

问题描述

我最近将 Zabbix 升级到 5.4.1,我想开始使用计划报告,但是我在配置方面遇到了一些问题(错误Cannot connect to web service: couldn't connect to server)。

我的 Zabbix 在 Debian Buster 上的 Docker 中运行。一切都基于官方容器:Zabbix Server (PostgreSQL)、Zabbix Frontend (Apache, PostreSQL) 和 PostgreSQL12。

根据文档(https://www.zabbix.com/documentation/current/manual/appendix/install/web_service),我安装了 Google Chrome 浏览器:

和 Zabbix Web 服务

我编辑了 zabbix_web_service.conf:
AllowedIP=127.0.0.1,::1,0.0.0.0/0,zabbix

我编辑了 zabbix_server.conf:
StartReportWriters=1
WebServiceURL=http://localhost:10053/report

我在 Zabbix Frontend - Administration -> General -> Other 中编辑了设置
Frontend URL: http://localhost:8085(前端在端口 8085 可用)

但是当我尝试测试生成报告时,我得到了错误:
Cannot connect to web service: couldn't connect to server

我已经尝试过使用其他前端 URL,但似乎没有任何效果。我试过: http://localhost:10053/report http://192.168.10.18:8085/ http://192.168.10.18:10053/report

我已经验证我从http://192.168.10.18:10053/report得到了答案: {"detail":"Method is not supported."}

我还能检查/尝试什么?

标签: zabbix

解决方案


我发现了问题。在服务器配置中,我使用了地址 http://localhost:10053/report 这是错误的,因为在我的情况下,Zabbix 服务器正在 docker 中运行,而 Zabbix Web 服务未在 docker 中运行。Zabbix 服务器无法连接到 web servcie,因为它在另一个网络中。我更改了配置,现在一切正常。报告正在生成并发送


推荐阅读