Ad Widget

Collapse

Email alerts attempting IPv6 address and failing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • michaelc
    Junior Member
    • Apr 2020
    • 2

    #1

    Email alerts attempting IPv6 address and failing

    Hello, relatively new to Zabbix, and have been trying to get email alerts up and running.

    Been working through "Zabbix 4 Network Monitoring" by Patrik Uytterhoeven and Rihards Olups from Packt Publishing.

    Near as I can tell, I've got everything setup correctly, but been having issues getting email alerts to send.

    Testing the email media (using Office365 mail server), fails with "Connection timeout of 3 seconds exceeded when connecting to Zabbix server "localhost".

    However, if I navigate to "Reports ~> Action Log" after a test action attempts to send an email alert, I'm able to see it failing because "Couldn't connect to server: Failed to connect to 2603:1036:902:16::2: Network is unreachable". IPv6 isn't setup/rolled out to this server, so it would fail attempting to connect to the IPv6 address of the SMTP server... Not sure why Zabbix is defaulting to attempt emails on IPv6 rather than IPv4.

    I don't see anything in the /var/log/zabbix/zabbix_server.log indicating any other issues with email.

    We're running Zabbix 4.2.8 on CentOS Linux 7 (Core) using the following packages installed from the Zabbix 4.0 repo;
    zabbix-agent.x86_64
    zabbix-release.noarch
    zabbix-server-pgsql.x86_64
    zabbix-web.noarch
    zabbix-web-pgsql.noarch

    Thanks in advance for any assistance
    Last edited by michaelc; 21-04-2020, 15:53.
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    Office365 incoming SMTP servers advertise both IPv4 and IPv6 addresses in the DNS.

    If your system sending email (the Zabbix server) has one or more IPv6 address(es), then by default the system will prefer IPv6. See gai.conf(5) and the RFCs it references.

    You either need to fix your IPv6 setup on your Zabbix server, completely disable IPv6, or modify your gai.conf as documented, to get getaddrinfo() to prefer IPv4 for certain address ranges.

    Comment

    • michaelc
      Junior Member
      • Apr 2020
      • 2

      #3
      Awesome, thanks for the explanation!

      I'd suspected it had something to do with IPv6 being enabled(not configured though)... But was thinking/hunting for a way to configure Zabbix itself to prefer IPv4 over IPv6.

      Didn't expect it'd be a configuration in the Linux system itself

      Will probably just roll out IPv6 correctly to the server, as that's already in the pipeline for the distant future.

      Thanks again!

      Comment

      • tim.mooney
        Senior Member
        • Dec 2012
        • 1427

        #4
        You're welcome, glad to help. My work environment has quite a lot of IPv6, so this is something I've had some experience with. The RFCs basically mandate IPv6 is by default preferred in a dual-stack environment whenever both ends of a connection could potentially choose one or the other version. Luckily, they also require a way to tailor that for certain problematic ranges.

        Setting up IPv6 on the server running Zabbix is definitely the recommended way to address this particular issue. Just be advised that once your Zabbix server has a published IPv6 DNS AAAA record, traffic that's finding the server by DNS may also choose IPv6. That means e.g. your browser connection to the web interface may go over IPv6. Also, some external email relays behave differently when you talk to them over IPv6 vs. IPv4. I don't think Office365 is one of those that behaves differently, though, so relaying to users there shouldn't be an issue.

        Comment

        Working...