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:
2. Created a MySQL user for monitoring:
3. On mariadb host I created /var/lib/zabbix/.my.cnf:
4. Restart zabbix-agent by:
Unfortunatelly, I cannot see any data in Monitoring → Latest data for monitored host. There is only an exclamation mark with message:
In zabbix server logs (/var/log/zabbix/zabbix_server.log) I found:
Zabbix user on mariadb host has HOME variable at /var/lib/zabbix:
Any advice?
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"
Code:
CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY 'mypassword'; GRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zbx_monitor'@'%';
Code:
[client] user='zbx_monitor' password='mypassword'
Code:
systemctl restart zabbix-agent
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
Code:
(...) noname.xml:1: parser error : Start tag expected, '<' not found WARNING: Forcing protocol to TCP due to option specification. Please explicitl
Code:
cat /etc/passwd (...) zabbix:x:108:116::/var/lib/zabbix/:/usr/sbin/nologin
Comment