[ZBX-19894] Web check fails on IPv6 Created: 2021 Aug 31 Updated: 2024 Apr 10 |
|
Status: | Elaborating |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Proxy (P), Server (S) |
Affects Version/s: | 5.0.15 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Trivial |
Reporter: | Roy Sigurd Karlsbakk | Assignee: | Alex Kalimulin |
Resolution: | Unresolved | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Irrelevant |
Team: | |
Sprint: | Roadmap Backlog |
Description |
Steps to reproduce:
Result: |
Comments |
Comment by Igor Gorbach (Inactive) [ 2021 Sep 02 ] |
Hello! Have you tried to use brackets before and after ipv6 adress or {HOST.CONN} macro? |
Comment by Roy Sigurd Karlsbakk [ 2021 Sep 02 ] |
I've just added Template App Apache by HTTP to a host on IPv6. I haven't changed anything else. |
Comment by Roy Sigurd Karlsbakk [ 2021 Sep 02 ] |
In that template, there's an item doing the web check {$APACHE.STATUS.SCHEME}://{HOST.CONN}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH} If I add [] around {HOST.CONN}, it should work with IPs, but it also should break the URL if using a hostname. |
Comment by dimir [ 2022 Oct 18 ] |
OverviewcURL expects any IPv6 hostname in the URL to be in square brackets http://[::1]:8080/foo because it needs to know which is the hostname part and which is the port part. We can't guess it automatically. The only thing is to make this configurable. Below are the options I could think of, I see Option 3 as the cleanest solution. Option 1If we would have support for macros in the macro values: we could add a macro to "App Apache by HTTP" template {$APACHE.STATUS.HOST} => {HOST.HOST} which a user could override on the host level {$APACHE.STATUS.HOST} => [{HOST.HOST}] and change the URL in Get status item: {$APACHE.STATUS.SCHEME}://{HOST.CONN}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH} to {$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH} Pros
Cons
Option 2Move the whole URL of the Get status item to the macro: {$APACHE.STATUS.URL} => http://{HOST.CONN}:80/server-status?auto Pros
Cons
Option 3Add support of new macro function to format the hostname part of the URL, e. g. urlform(): {{HOST.*}.urlform()} => returns "DNS", "IPv4", "[IPv6]" Pros
Cons
Option 4Add new macro e. g. {HOST.CONNURL} that will return IPv6 address in square brackets. Pros
Cons
Option 5On level of substitute_simple_macros() detect that it's URL situation and add square brackets automatically. Pros
Cons
Additional thoughtsImplement (probably not in the scope of this task) escaping of macro values. {ITEM.LASTVALUE1.escape(<rules>)} Also would be nice to add support for macro functions to all macros. |
Comment by dimir [ 2022 Oct 19 ] |
Decided today that in order to fix this properly new functionality (ZBXNEXT) needs to be introduced first. The only solutions for now that I see is:
|