Ad Widget

Collapse

Zabbix 7.0 fails to connect to Azure MySQL DB

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Krlus
    Junior Member
    • Aug 2025
    • 2

    #1

    Zabbix 7.0 fails to connect to Azure MySQL DB

    Good morning, evening or night.

    I'm currently implementing a new Zabbix environment at my company, we are going from a 6.0 LTS setup with a mysql db on the same machine as the zabbix_server to a cloud setup, a few important details:
    Zabbix server vm SO is a Oracle Linux 8.
    The database is an Azure MySQL Managed Database on version 8.4,
    Zabbix Server is 10.190.33.9 and DB is 10.190.34.9

    I currently can connect from the server to the DB using mysql just fine, but zabbix won't connect to the database, stating the following error:
    47589:20250808:103011.322 VMware monitoring: YES
    947589:20250808:103011.322 SMTP authentication: YES
    947589:20250808:103011.322 ODBC: YES
    947589:20250808:103011.322 SSH support: YES
    947589:20250808:103011.322 IPv6 support: YES
    947589:20250808:103011.322 TLS support: YES
    947589:20250808:103011.322 ******************************
    947589:20250808:103011.322 using configuration file: /etc/zabbix/zabbix_server.conf
    947589:20250808:103011.331 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to MySQL server on 'xyz.mysql.database.azure.com' (13)
    947589:20250808:103011.331 database is down: reconnecting in 10 seconds

    My conf file is using the following parameters:
    ListenPort=10051
    SocketDir=/run/zabbix
    DBHost:xyz.mysql.database.azure.com
    DBName=zabbix
    DBPassword=said password for the user, tried it and works in mysql
    DBPort=3306
    DBTLSConnect=required

    I've tried messing with the configs, not using DBTLSConnect at all, it is the same error.
    Tried using verify_ca or verify_full with a valid crt and pem, I get an error saying my installation doesn't support it.

    I'm truly out of ideas here, does anyone have any troubleshooting ideas?
  • Answer selected by Krlus at 13-08-2025, 12:18.
    Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    Does your system have SELinux or something similar enabled and blocking the Zabbix server process from accessing the database connection?

    Markku

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1781

      #2
      Does your system have SELinux or something similar enabled and blocking the Zabbix server process from accessing the database connection?

      Markku

      Comment

      • MRedbourne
        Senior Member
        • Feb 2023
        • 103

        #3
        Building on Markku's suggestion, the command you're looking for is to look at SELinux issues:

        (as root): ausearch -m avc -ts recent
        (as root): semanage export

        If you run the ausearch commands, it should return:
        [...]
        <no matches>
        the semanage export command should contain:
        Code:
        boolean -m -1 zabbix_can_network
        Note that if the above line isn't present, OR, if the line is (see below), then Zabbix is likely being denied. To fix this, you run the following commands on any zabbix server.
        Code:
        boolean -m [B]-0[/B] zabbix_can_network
        Fix: (one of, as root)
        semanage boolean -m -1 zabbix_can_network
        audit2allow -a -M ZabbixServer && semodule -i ZabbixServer.pp

        Comment

        • Krlus
          Junior Member
          • Aug 2025
          • 2

          #4
          Originally posted by Markku
          Does your system have SELinux or something similar enabled and blocking the Zabbix server process from accessing the database connection?

          Markku
          Yep, this was the problem, I managed to fix it yesterday by disabling SELINUX during some more troubleshooting, now I just need to add the exception, thanks so much guys!

          Comment

          Working...