Ad Widget

Collapse

Custom Zabbix server port instead of 10051

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • olegus
    Member
    • Dec 2023
    • 68

    #1

    Custom Zabbix server port instead of 10051

    We need to use different port on Zabbix server as it is behind Cloudflare and 10051 is not an option. We opened port 2087 and map it to 10051 in server's docker-compose.yaml:
    Code:
    ports:
    - 2087:10051​
    Then on proxy side we changed environment variable for a port in proxy's docker-compose
    Code:
       - ZBX_SERVER_HOST=example.com
       - ZBX_HOSTNAME=zabbix-proxy
       - ZBX_ACTIVE_ALLOW=true
       - ZBX_PROXYMODE=0
       - ZBX_CONFIGFREQUENCY=120​
       - ZBX_SERVER_PORT=2087
    but according to logs it still tries to connect using 10051.
    144:20240201:112143.134 Unable to connect to [example.com]:10051 [cannot connect to [[example.com]:10051]: [4] Interrupted system call]

    What should we change on proxy side to use custom port to communicate with a server?



  • olegus
    Member
    • Dec 2023
    • 68

    #2
    Looks like ZBX_SERVER_PORT var is ignored.
    So we just set
    Code:
    - ZBX_SERVER_HOST=example.com:2087
    but it does not help, proxy still cant talk to a server - here is what I see in logs:

    144:20240201:121844.580 Message from example.com is missing header. Message ignored.

    144:20240201:121844.580 cannot obtain configuration data from server at "example.com": cannot connect to [[example.com]:2087]: [4] Interrupted system call
    Any idea where should I look next?

    ​BTW, both server and proxy use alpine-6.4-latest​ image
    Last edited by olegus; 01-02-2024, 20:26.

    Comment

    • olegus
      Member
      • Dec 2023
      • 68

      #3
      Additional info:
      Zabbix server URL is reachable rfom a proxy host
      Zabbix server port 2087 is open , as shown by telnet:
      telnet example.com 2087
      Trying XX.XX.XX.XXX...
      Connected to example.com.cdn.cloudflare.net.
      Escape character is '^]'.


      That's a verbose log from zabbix-sender, running from inside of a proxy container:

      /var/lib/zabbix $ zabbix_sender -vv -z example.com -p 2087 -s "Monitored Host" -k mysql.queries -o 342.45
      zabbix_sender [198]: DEBUG: In zbx_connect_to_server() [example.com]:2087 [timeout:60, connection timeout:3]
      zabbix_sender [198]: DEBUG: In zbx_is_ip4() ip:'example.com'
      zabbix_sender [198]: DEBUG: End of zbx_is_ip4():FAIL
      zabbix_sender [198]: DEBUG: In zbx_is_ip6() ip:'example.com'
      zabbix_sender [198]: DEBUG: End of zbx_is_ip6():FAIL
      zabbix_sender [198]: Warning: Message from example.com is missing header. Message ignored.
      zabbix_sender [198]: DEBUG: Unable to receive from [example.com]:2087 []
      Sending failed.​

      Comment

      Working...