Ad Widget

Collapse

Zabbix 6 New installation: No data with mysql agent template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kefler
    Junior Member
    • Apr 2022
    • 1

    #1

    Zabbix 6 New installation: No data with mysql agent template

    I installed new Zabbix 6.0.3 LTS on Debian 11. Everything works great, but I have problem with monitoring host with MariaDB 10.6.7 (Debian 11) using dedicated template. On Zabbix Server I configured new host to monitoring by "MySQL by Zabbix agent" template to monitoring. According to https://www.zabbix.com/integrations/mysql:

    1. On mariadb host I created /etc/zabbix/zabbix_agentd.d/template_db_mysql.conf with:
    Code:
    #template_db_mysql.conf created by Zabbix for "Template DB MySQL" and Zabbix 4.2
    #For OS Linux: You need create .my.cnf in zabbix-agent home directory (/var/lib/zabbix by default)
    #For OS Windows: You need add PATH to mysql and mysqladmin and create my.cnf in %WINDIR%\my.cnf,C:\my.cnf,BASEDIR\my.cnf https://dev.mysql.com/doc/refman/5.7/en/option-files.html
    #The file must have three strings:
    #[client]
    #user='zbx_monitor'
    #password='<password>'
    #
    UserParameter=mysql.ping[*], mysqladmin -h"$1" -P"$2" ping
    UserParameter=mysql.get_status_variables[*], mysql -h"$1" -P"$2" -sNX -e "show global status"
    UserParameter=mysql.version[*], mysqladmin -s -h"$1" -P"$2" version
    UserParameter=mysql.db.discovery[*], mysql -h"$1" -P"$2" -sN -e "show databases"
    UserParameter=mysql.dbsize[*], mysql -h"$1" -P"$2" -sN -e "SELECT COALESCE(SUM(DATA_LENGTH + INDEX_LENGTH),0) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='$3'"
    UserParameter=mysql.replication.discovery[*], mysql -h"$1" -P"$2" -sNX -e "show slave status"
    UserParameter=mysql.slave_status[*], mysql -h"$1" -P"$2" -sNX -e "show slave status"
    2. Created a MySQL user for monitoring:
    Code:
    CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY 'mypassword'; GRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zbx_monitor'@'%';
    3. On mariadb host I created /var/lib/zabbix/.my.cnf:
    Code:
    [client]
    user='zbx_monitor'
    password='mypassword'
    4. Restart zabbix-agent by:
    Code:
    systemctl restart zabbix-agent
    Unfortunatelly, I cannot see any data in Monitoring → Latest data for monitored host. There is only an exclamation mark with message:
    Code:
    Preprocessing failed for: WARNING: Forcing protocol to TCP due to option specification. Please explicitly state intended ...
    1. Failed: cannot extract XML value with xpath "/resultset/row[field/text()='Connection_errors_tcpwrap']/field[@name='Value']/text()": cannot parse xml value: Start tag expected, '<' not found
    In zabbix server logs (/var/log/zabbix/zabbix_server.log) I found:
    Code:
    (...)
    noname.xml:1: parser error : Start tag expected, '<' not found
    WARNING: Forcing protocol to TCP due to option specification. Please explicitl
    Zabbix user on mariadb host has HOME variable at /var/lib/zabbix:
    Code:
    cat /etc/passwd
    (...)
    zabbix:x:108:116::/var/lib/zabbix/:/usr/sbin/nologin
    Any advice?
  • LarsV
    Junior Member
    • Jun 2022
    • 2

    #2
    I have the same problem as descriped above.
    I to have a Debian 11 on client/ agent and server.
    But running Zabbix server 5.4.12

    My MariaDB version is 10.6.8.

    This is working finde on same server with data from other agents.
    And the main difference i can find is that the clients/ agents where it works is running MariaDB v. 10.5.15.

    Comment

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

      #3
      What happens if you try to remove that error message by specifying the protocol in the mysql/mysqladmin commands? --protocol=tcp

      Markku

      Comment

      • LarsV
        Junior Member
        • Jun 2022
        • 2

        #4
        Originally posted by Markku
        What happens if you try to remove that error message by specifying the protocol in the mysql/mysqladmin commands? --protocol=tcp

        Markku
        Then it works for me.
        Thanks for pushing me in the right direction.

        Now to find out why.

        Comment

        • cyztalzboyz
          Junior Member
          • Mar 2022
          • 1

          #5
          Originally posted by LarsV

          Then it works for me.
          Thanks for pushing me in the right direction.

          Now to find out why.
          How do you fix? please detail for help

          Thanks

          Comment

          Working...