zabbix / zabbix-docker

Official Zabbix Dockerfiles
https://www.zabbix.com
GNU Affero General Public License v3.0
2.39k stars 1.38k forks source link

ZBX_SERVER_HOST in frontend config only works with brackets #1550

Open fansari opened 3 days ago

fansari commented 3 days ago
SUMMARY

On all other places where I have put IPv6 address in Zabbix configs (DB_SERVER_HOST, or ZBX_SERVER_HOST in proxies) the IPv6 address can be written without brackets.

Only in the frontend this does not work (and even there DB_SERVER_HOST works without brackets which is confusing).

OS / ENVIRONMENT / Used docker-compose files

OS: CentOS Stream release 9 Docker image: zabbix/zabbix-web-nginx-pgsql:alpine-7.0.5

CONFIGURATION
STEPS TO REPRODUCE

This does not work:

 --env DB_SERVER_HOST=2xxx:xxxx:xxxx::2
 --env ZBX_SERVER_HOST=2xxx:xxxx:xxxx::3

This does not work:

 --env DB_SERVER_HOST=[2xxx:xxxx:xxxx::2]
 --env ZBX_SERVER_HOST=[2xxx:xxxx:xxxx::3]

Using brackets with DB_SERVER_HOST gives this error:

**** PostgreSQL server is not available. Waiting 5 seconds...

This works:

 --env DB_SERVER_HOST=2xxx:xxxx:xxxx::2
 --env ZBX_SERVER_HOST=[2xxx:xxxx:xxxx::3]
EXPECTED RESULTS

I would expect the writing style of IPv6 addresses to be cosistent. Or is there is a reason why only in this place brackets are mandatory?

ACTUAL RESULTS

When ZBX_SERVER_HOST is configured with IPv6 without brackets and you reload the Zabbix GUI there is no attempt to reach the Zabbix server. I checked this with tcpdump.

dotneft commented 3 days ago

Sorry, you said it works when DB_SERVER_HOST specified without brackets, but then said the problem with ZBX_SERVER_HOST. What is correct?

fansari commented 3 days ago

After I noticed that I have to use the brackets for ZBX_SERVER_HOST I tested what happens when I also write the address for DB_SERVER_HOST in brackets. But this does not work. You can see above three combinations I have tested.

You have to use ZBX_SERVER_HOST with brackets but DB_SERVER_HOST without brackets. I find this not very intuitive.