简体   繁体   中英

Zabbix - Web Service timeout

I am trying to create scheduled reports but my zabbix web service is not working. I always get this message:

Cannot connect to web service: timeout was reached

I am using Zabbix Composed installation on Ubuntu server with the docker. Here are images which I am using right now:

zabbix\zabbix-web-service:ubuntu-latest
zabbix\zabbix-web-nginx-mysql:ubuntu-latest
zabbix\zabbix-server-mysql:ubuntu-latest
zabbix\zabbix-agent:ubuntu-latest
mysql:8.0
busybox:latest

I were so desperate that I upgraded my whole solution to the :latest images from the version 5.4 and hoped it will solve my problem - not helped.

I used the wireshark to check TCP traffic and not helped - my zabbix web service will not respond to my zabbix server (1 minute timeout).

I tried to generate a report from an empty dashboard because of data size - not helped.

I tried to set debug logs to level 5 and read logs through the docker - not helped.

I found out that scheduled reports will be generated only when I restart my zabbix web service docker container and immediately after the container startup, I will generate a report. This is the only way when I was able to generate a report. Little bit after the container will be started, I will receive the error again

I am also deploying zabbix in docker, and I can use scheduled reports normally.

I deployed the following container in docker:

  • mysql:5.7
  • zabbix/zabbix-server-mysql:alpine-latest
  • zabbix/zabbix-web-nginx-mysql:alpine-latest
  • zabbix/zabbix-web-service:alpine-latest

zabbix-server-mysql

docker run --name zabbix-server -d --restart always \
    --link mysql:zabbix-mysql \
// ...
    -e ZBX_STARTREPORTWRITERS="2" \
    -e ZBX_WEBSERVICEURL="http://docker:10053/report" \
    -p 10051:10051 \
    -d zabbix/zabbix-server-mysql:alpine-latest

zabbix-web

docker run --name zabbix-web -d --restart always \
  --link mysql:zabbix-mysql \
  --link zabbix-server:zabbix-server \
// ...
  -p 80:8080 \
  zabbix/zabbix-web-nginx-mysql:alpine-latest

zabbix-web-service

docker run --name zabbix-web-service -d --restart always \
    -e ZBX_ALLOWEDIP="127.0.0.1,192.168.1.0/24,172.17.0.0/16" \
    -e ZBX_TLSACCEPT=unencrypted \
    -e ZBX_DEBUGLEVEL=5 \
    -v zabbix_agent2_enc:/var/lib/zabbix/enc \
    --cap-add=SYS_ADMIN \
    -p 10053:10053 \
    zabbix/zabbix-web-service:alpine-latest

Here you need to pay attention to setting ZBX_ALLOWEDIP :

  • The ip address pool of the container is 172.17.0.4/16
  • The ip address of the docker host is 192.168.1.2/24

Configure Zabbix frontend

My zabbix web interface url is http://docker/zabbix.php , I set Frontend URL to http://docker . Don't follow the picture in the document, set Frontend URL to http://docker/zabbix .

You can try to access http://docker/zabbix.php?action=dashboard.print&dashboardid=1 , it should display the dashboard correctly.

If you set Frontend URL to http://docker/zabbix according to the document, you will access http://docker/zabbix/zabbix.php?action=dashboard.print&dashboardid=1 and get File not found.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM