Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-8605

Web scenario: Allow overriding domain names resolving

XMLWordPrintable

    • Icon: Change Request Change Request
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 6.4.4
    • Frontend (F), Server (S)
    • None

      In a load balance environment, we have multiple web servers serving a set of domain names over HTTPS. We would like to measure the performance of each web server independently by creating a web scenario for each one of them.

       

      The problem: Using a domain name in the "URL" field in the web scenario would lead to resolving the domain to a different web server each (some) time leading to non reliable data.

       

      Workaround (fails for HTTPS): Specify the IP of the web server instead of the domain name. This fails because each web server serves multiple domains (virtual hosts) and thus it responds differently based on the domain name used to connect to it, or more specifically the "Host" HTTP header. And while you can override the HTTP Host header in the current interface, this would fail for HTTPS because An HTTPS server also needs to get the server name provided already in the TLS handshake so that it knows which cert etc to use.

       

      The solution: Zabbix depends on curl under the hood. curl allows you to give curl the proper URL but with a custom IP address to use for the host name we set. The --resolve command line option is our friend

       

      Notes:

      • This method also works perfectly when following redirects since any further use of the same host name will still resolve to the same IP address and redirecting to another host name will then resolve properly.
      • There is also a "--connect-to" option in curl but it would not be suitable for HTTPS and redirects together since it only used to establish the network connection. It does NOT affect the hostname/port that is used for TLS/SSL (e.g. SNI, certificate verification) or for the application protocols.

       

      So please provide an interface parameter to configure the curl's "--resolve" option (or a sub-interface menu since it can be used multiple time to override multiple domains per a web scenario)

       

      Reference: https://daniel.haxx.se/blog/2018/04/05/curl-another-host

            vmurzins Valdis Murzins
            waleedmortaja Waleed Mortaja
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: