Buenas tardes. No consigo monitorizar mi base de datos Mysql utilizando el template mysql by zabbix agent. Dispongo de la siguiente configuración:
Mysql version 8.0.27
rpm -qa |grep zabbix
zabbix6.0-agent-6.0.16-1.el8.x86_64
zabbix6.0-6.0.16-1.el8.x86_64
pcp-export-zabbix-agent-5.3.1-5.0.2.el8.x86_64
zabbix6.0-selinux-6.0.16-1.el8.noarch
/etc/zabbix/zabbix_agentd.d/template_db_mysql.conf
#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...ion-files.html
#The file must have three strings:
#[client]
#user='zbx_monitor'
#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" zz0.cq8h1oiqyljzz
/etc/zabbix_agentd.conf
PidFile=/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=ip server
ListenPort=10050
ServerActive=ip server
Hostname=Nameserver
Include=/etc/zabbix/zabbix_agentd.d/template_db_mysql.conf
/var/lib/zabbix/.my.cnf
[client]
user='zabbix'
password='mipassword'
He probado con la opción sin éxito:
default-authentication-plugin=caching_sha2_password
Error de zabbix server log:
noname.xml:1: parser error : Start tag expected, '<' not found
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.x.X:3306' (13)
Pruebas realizadas. En la macro del template tambien he probado con la 127.0.0.1
Si realizo un telnet en la propia maquina donde esta mysql obtengo esta respuesta:
[root@xxx-db zabbix_agentd.d]# telnet localhost 3306
Trying ::1...
Connected to localhost.
Escape character is '^]'.
U
8.0.27-commercialxKSfD29B�(c-5`6B
caching_sha2_password2#08S01Got timeout reading communication packetsConnection closed by foreign host.
Desde el servidor:
[root@xxx-reports ~]# telnet 192.168.89.20 3306
Trying 192.168.x.X...
Connected to 192.168.x.X.
Escape character is '^]'.
U
8.0.27-commercialy*
M8r
Help meeeee
Mysql version 8.0.27
rpm -qa |grep zabbix
zabbix6.0-agent-6.0.16-1.el8.x86_64
zabbix6.0-6.0.16-1.el8.x86_64
pcp-export-zabbix-agent-5.3.1-5.0.2.el8.x86_64
zabbix6.0-selinux-6.0.16-1.el8.noarch
/etc/zabbix/zabbix_agentd.d/template_db_mysql.conf
#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...ion-files.html
#The file must have three strings:
#[client]
#user='zbx_monitor'
#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" zz0.cq8h1oiqyljzz
/etc/zabbix_agentd.conf
PidFile=/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=ip server
ListenPort=10050
ServerActive=ip server
Hostname=Nameserver
Include=/etc/zabbix/zabbix_agentd.d/template_db_mysql.conf
/var/lib/zabbix/.my.cnf
[client]
user='zabbix'
password='mipassword'
He probado con la opción sin éxito:
default-authentication-plugin=caching_sha2_password
Error de zabbix server log:
noname.xml:1: parser error : Start tag expected, '<' not found
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.x.X:3306' (13)
Pruebas realizadas. En la macro del template tambien he probado con la 127.0.0.1
Si realizo un telnet en la propia maquina donde esta mysql obtengo esta respuesta:
[root@xxx-db zabbix_agentd.d]# telnet localhost 3306
Trying ::1...
Connected to localhost.
Escape character is '^]'.
U
8.0.27-commercialxKSfD29B�(c-5`6B
caching_sha2_password2#08S01Got timeout reading communication packetsConnection closed by foreign host.
Desde el servidor:
[root@xxx-reports ~]# telnet 192.168.89.20 3306
Trying 192.168.x.X...
Connected to 192.168.x.X.
Escape character is '^]'.
U
8.0.27-commercialy*
M8r
Help meeeee
Comment