Ad Widget

Collapse

Scheduled reports - Cannot connect to web service: couldn't connect to server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pawel.zimny
    Junior Member
    • Aug 2021
    • 3

    #1

    Scheduled reports - Cannot connect to web service: couldn't connect to server

    I recently upgraded Zabbix to 5.4.1 and I wanted to start using scheduled report, but I've got some problems with conifguration (error
    Code:
    Cannot connect to web service: couldn't connect to server
    ).

    My Zabbix is running in Docker on Debian Buster. Everything is based on official containers: Zabbix Server (PostgreSQL), Zabbix Frontend (Apache, PostreSQL) and PostgreSQL12.

    According do documentation (https://www.zabbix.com/documentation...ll/web_service) I installed Google Chrome browser:
    and Zabbix Web Service
    I eddited zabbix_web_service.conf:
    Code:
    AllowedIP=127.0.0.1,::1,0.0.0.0/0,zabbix
    I edited zabbix_server.conf:
    Code:
    StartReportWriters=1
    WebServiceURL=http://localhost:10053/report
    I eddited settings in Zabbix Frontend - Administration -> General -> Other
    Code:
    Frontend URL: http://localhost:8085 (frontend is available at port 8085)
    But when I try to test report generating i get error:
    Cannot connect to web service: couldn't connect to server

    I've already tried with other Frontend URLs, but nothings seems to work. I tried with: http://localhost:10053/report http://192.168.10.18:8085/ http://192.168.10.18:10053/report

    I've verified that I get answear from http://192.168.10.18:10053/report :
    Code:
    {"detail":"Method is not supported."}
    What else can I check/try?
  • dmwcode
    Junior Member
    • Oct 2021
    • 5

    #2
    Curious if you ever resolved this issue?

    Comment

    • pawel.zimny
      Junior Member
      • Aug 2021
      • 3

      #3
      Originally posted by dmwcode
      Curious if you ever resolved this issue?
      I still have the same issue :/

      Comment

      • tim.mooney
        Senior Member
        • Dec 2012
        • 1427

        #4
        I'm not running a new enough version of Zabbix right now to test the web service, but my understanding is that it runs as a separate service, and the main Zabbix server communicates with that service.

        When you installed the zabbix-web-service package, did it come with its own systemd service file? If it did, have you tried enabling and starting that service?

        If it didn't come with its own systemd service file, then that probably means that the zabbix_serverd is supposed to start it. Again, I'm not sure because I'm not running that Zabbix version yet. But if zabbix_serverd is supposed to start it, have you tried restarting zabbix_serverd after you modified zabbix_serverd.conf and made the changes via the web interface?

        I think the systemd service file is the more likely situation, but it's probably one or the other of those two possibilities.

        Comment

        • um3n
          Member
          • Aug 2021
          • 47

          #5
          I wonder if there is a service listening on your machine. Could you check
          Code:
          ss -tulpen
          .
          If zabbix starts correctly your reports service should listen on a port, right?

          Comment

          • dmwcode
            Junior Member
            • Oct 2021
            • 5

            #6
            In my case I eventually got this working but I am not sure what fixed it. My server ended up crashing because the drive filled up due to a very large server log file. Once I fixed that and restarted the scheduled reports started to work. I think those problems were not related though.

            Comment

            • Spectator
              Member
              • Sep 2021
              • 71

              #7
              I have the same problem

              This is the link to my Zabbix WEB interface:



              I've done the following so far:
              apt-get install zabbix-web-service chromium
              In zabbix_server.conf:
              StartReportWriters = 1
              WebServiceURL = http: // localhost: 10053 / report

              On the WEB interface:
              Administration -> General -> Other
              Frontend URL: http://192.168.1.1/zabbix

              At the bottom of Reports -> Scheduled reports -> Customreport (which contains its own dashboard called Customdash), the "Test" button gives this message after 1-2 minutes:

              "Report generating test failed.
              Cannot connect to web service: timeout was reached"


              The Customdash dashboard is loaded at this link:


              In /var/log/zabbix/zabbix_web_service.log I only see this:
              021/11/07 09: 22: 00.804623 received report request from 127.0.0.1:54190

              Do you have any ideas what I could look at?

              Comment

              • pawel.zimny
                Junior Member
                • Aug 2021
                • 3

                #8
                I found the problem.
                In server configuration I was usinng address http://localhost:10053/report it was wrong because in my case Zabbix server is running in docker and Zabbix web service is not running in docker. Zabbix server wasn't albe to connect to web servcie because it was in the other network. I changed the configuration and now everything works fine. Reports are beeing generated and send

                Comment

                • hamimi
                  Junior Member
                  • Jun 2021
                  • 5

                  #9
                  HI, I currently installed Zabbix 6.0 on Ubuntu 18.04, I get an error:
                  Report Generating failed
                  • Cannot connect to web service: couldn't connect to server
                  Although I have enabled StartReportWriters=1 and also added
                  WebServiceURL=http://localhost:10053/report
                  also installed chromium,

                  What else can it be?

                  Comment

                  • Tuor
                    Junior Member
                    • Feb 2015
                    • 16

                    #10
                    Hi

                    I got the same error message: Cannot connect to web service: couldn't connect to server

                    Google Chrome is installed (on Ubuntu Chromium is install as snap and that is not supported by Zabbix).

                    Configuration:
                    StartReportWriters=1
                    WebServiceURL=http://localhost:10053/report

                    pgrep -af report
                    2098 /usr/sbin/zabbix_server: report manager #1 [jobs created 0, processed 0, idle 5.004998 sec during 5.005043 sec]
                    2099 /usr/sbin/zabbix_server: report writer #1 [reports started 0, sent 0, finished 0, idle 167.829255 sec during 167.829485 sec]

                    There is no process listening on port 10053.

                    It seems there is no systemd unit shipped with the package, see docs https://www.zabbix.com/documentation...ll/web_service :
                    After the installation, run zabbix_web_service on the machine, where the web service is installed:
                    shell> zabbix_web_service
                    temporary workaround in a screen/tmux session:
                    su -s /bin/sh - zabbix
                    zabbix_web_service -c /etc/zabbix/zabbix_web_service.conf
                    Last edited by Tuor; 13-04-2022, 12:27.

                    Comment

                  • hamimi
                    Junior Member
                    • Jun 2021
                    • 5

                    #11
                    Thanks SO much Tuor , that worked like a charm!

                    Comment

                    • Tuor
                      Junior Member
                      • Feb 2015
                      • 16

                      #12
                      This doesn't solve the problem, but it is a workaround. If you reboot the server, you will have to start your screen session again. In my opinion this zabbix_web_service deserves a systemd service unit or this is maybe just a bug.

                      Comment


                      • Atsushi
                        Atsushi commented
                        Editing a comment
                        If it is a package for RHEL, it can be managed by systemd with the service name zabbix-web-service.
                    • Tuor
                      Junior Member
                      • Feb 2015
                      • 16

                      #13
                      I created a bug report: https://support.zabbix.com/browse/ZBX-20897

                      Comment

                      • Tuor
                        Junior Member
                        • Feb 2015
                        • 16

                        #14
                        Oh no! There is a service for it, but the service is disabled by default (or I don't know why it was disabled on my system). There is no need for any workarounds!
                        If you want to enable your zabbix_web_service, just run this (on distributions using systemd):
                        Code:
                        systemctl enable --now zabbix-web-service.service
                        The documentation should mention, that this service is disabled by default (as it seems) and you have to enable it first. Maybe other people can check, if this service is enabled or disabled on there system. Maybe it is just me being stupid.^^

                        Comment


                        • gopkris2000
                          gopkris2000 commented
                          Editing a comment
                          In my case, this is the problem. I have restarted the services to fix it.
                          # systemctl start zabbix-web-service.service
                      • cyber
                        Senior Member
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Dec 2006
                        • 4807

                        #15
                        I think most of newly installed services are disabled by default... I guess there is no reason to start things up, if you have not yet configured it properly.

                        Comment


                        • Tuor
                          Tuor commented
                          Editing a comment
                          Fair point.
                      Working...