Ad Widget

Collapse

Bring back support for custom Port Numbers within Web Monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alexthefifth
    Junior Member
    • Feb 2019
    • 11

    #1

    Bring back support for custom Port Numbers within Web Monitoring


    Just upgraded from Zabbix 4 to Zabbix 7 and we noticed that we are no longer able to specify a port number in the URL for Web Monitoring steps

    i.e. we are trying to use this as a URL:
    http://{HOST.IP}:{HOST.PORT}

    This used to work fine in Zabbix 4 but in Zabbix 7 we get this error:
    Code:
    URL using bad/illegal format or missing URL
    ​I guess it's because {HOST.PORT} is no longer a valid macro within Web Monitoring? Why?
    Our use case is that we need to monitor many devices which have an HTTP server running on a non-standard port (i.e. not 443 nor 80)
    Last edited by alexthefifth; 24-01-2024, 06:20.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    https://www.zabbix.com/documentation...tion#footnotes
    {HOST.*} macros are supported in web scenario Variables, Headers, SSL certificate file and SSL key file fields and in scenario step URL, Post, Headers and Required string fields. Since Zabbix 5.2.2, {HOST.*} macros are no longer supported in web scenario Name and web scenario step Name fields.​
    I have no reason to doubt that it is not usable there...
    I suspect that is curl in backstage there throwing that error...​
    EDIT: oh and for just in case.. check your selinux, so it allows to connect to any ports instead of well known ones...

    https://man.linuxreviews.org/man8/zabbix_selinux.8.html
    If you want to determine whether zabbix can connect to all TCP ports, you must turn on the zabbix_can_network boolean. Disabled by default.

    setsebool -P zabbix_can_network 1
    Last edited by cyber; 24-01-2024, 15:48.

    Comment

    • alexthefifth
      Junior Member
      • Feb 2019
      • 11

      #3
      Selinux is disabled on our servers so that's not what is causing the error


      I think that documentation is wrong and needs to be updated

      This works without issues:

      Code:
      http://{HOST.IP}
      However this throws an error:

      Code:
      http://{HOST.IP}:{HOST.PORT}
      In a different part of the same documentation you will notice this difference, which seems deliberate:

      HOST.IP specifically says its supported in Web Monitoring

      Click image for larger version  Name:	zabbix host ip.png Views:	0 Size:	100.6 KB ID:	477694


      However HOST.PORT doesn't list Web Monitoring as supported


      Click image for larger version  Name:	zabbix host port.png Views:	0 Size:	42.8 KB ID:	477695
      Last edited by alexthefifth; 24-01-2024, 18:02.

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #4
        The quote I used is from your first pic, that little 4 after "Web monitoring". As it uses {HOST.*}, I still assume it is usable...
        Seems we do not use it this way in our env... if macros are used for urlort, it is set either directly or as user macro, already containing both name and port... We don't define random ports for "agent" to be used via {HOST.PORT}

        Comment

        • dimir
          Zabbix developer
          • Apr 2011
          • 1080

          #5

          I don't really see how it was working for you in 4.0 . Just installed fresh 4.0.0, configured a web scenario step with
          Code:
          URL: http://{HOST.HOST}:{HOST.PORT}/tmp/phpinfo.php
          yes, frontend allowed me to save it but after Zabbix server processed the step I get the following error in Latest data:
          Code:
          Couldn't resolve host name: Couldn't resolve host '192.168.6.85:{HOST.PORT}'
          Even with 4.0.50 I get the same result.
          Last edited by dimir; 16-02-2024, 17:00.

          Comment

          • alexthefifth
            Junior Member
            • Feb 2019
            • 11

            #6
            We are running version 4.0.14

            Here's how we have our hosts configured (agent IP address + non-standard Port)

            Click image for larger version

Name:	zabbixweb1.png
Views:	1250
Size:	49.6 KB
ID:	479139


            This is how the web scenario is configured:


            Click image for larger version

Name:	zabbixweb2.png
Views:	1284
Size:	35.1 KB
ID:	479137






            What we see in Latest Data (seems to be working fine and collecting data):

            Click image for larger version

Name:	zabbixweb3.png
Views:	1244
Size:	80.3 KB
ID:	479138

            Comment

            • dimir
              Zabbix developer
              • Apr 2011
              • 1080

              #7
              Still unable to reproduce with 4.0.14 . Could you make the following, increase http poller debug level by running
              Code:
              zabbix_server -R log_level_increase="http poller"
              Then observer the /var/log/zabbix/zabbix_server.log for the lines like:
              Code:
              2916267:20240219:150809.734 End of http_substitute_variables() data:'http://<HOST>:<PORT>'
              2916267:20240219:150809.735 process_httptest() go to URL "http://<HOST>:<PORT>"
              ​When you got the lines with the 10.133.137.168, post them here and turn off debugging by running
              Code:
              zabbix_server -R log_level_decrease="http poller"

              Comment

              • Wolfsbane2k
                Member
                • Nov 2022
                • 48

                #8
                Did this ever get resolved? We have wanted to be able to change the port on which 4 HTTP servers sits for both webmonitoring and item checks (the host also also supports agent checks) and haven't found a way around the limitation yet.

                Thanks!

                Comment

                Working...