[ZBX-20725] mysql template does not work in 6.0.1 Created: 2022 Mar 10 Updated: 2024 Apr 10 Resolved: 2024 Mar 01 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Agent (G) |
Affects Version/s: | 6.0.1 |
Fix Version/s: | 6.0.28rc1, 6.4.13rc1, 7.0.0beta2, 7.0 (plan) |
Type: | Problem report | Priority: | Trivial |
Reporter: | John Stones | Assignee: | Denis Rasikhov |
Resolution: | Fixed | Votes: | 1 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
KVM Ubuntu 20.04 Linux 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux |
Attachments: |
![]() ![]() |
Team: | |
Story Points: | 1 |
Description |
The MySQL template "MySQL by Zabbix agent" does not work In /var/lib/zabbix created .my.cnf [client] Also tried[client] host = localhost {{And }} [mysql]
In mysql create user with grant GRANT USAGE,REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON . TO 'zabbix_monitor'@'localhost'; auth method correct toozabbix_monitor | localhost | mysql_native_password | *72A13047AB1160DB1323E12A0862763A907DF629
template_db_mysql.conf have UserParameter=mysql.ping[*], mysqladmin -h"$1" -P"$2" ping
Also tried this from https://www.zabbix.com/forum/zabbix-troubleshooting-and-problems/380651-zabbix-4-2-3-template-db-mysql-access-denied-for-user-zabbix-error
UserParameter=mysql.ping, mysqladmin --defaults-extra-file='/var/lib/zabbix/.my.cnf' ping | grep -c alive
But in server logs see Preprocessing failed for: ERROR 1045 (28000): Access denied for user 'zabbix'@'localhost' (using password: NO)
In Similar server and settings works fine in other KVM server. Please help |
Comments |
Comment by Mark Oudsen [ 2022 Mar 18 ] |
Similar issue here while using MariaDB 10.6.x (issues starting appearing after upgrade from 10.4.x to 10.6.x to have a supported setup for Zabbix 6.0 LTS). Did some root cause analysis and found a resolution for it: add the protocol to the .my.cnf ... (in my case /var/lib/zabbix/.my.cnf)
[client] protocol=tcp user=<user> password=<password> https://mariadb.com/kb/en/mysql-command-line-client/ Reason why this started "failing" in 10.6.x is that MariaDB no longer wants to 'guess' which type of connection should be used ... Zabbix 6.0.2 LTS |
Comment by Mark Oudsen [ 2022 Mar 18 ] |
PS: figured this out by looking at all default settings with mysql -? for my server(s).
host (No default value)
html FALSE
xml FALSE
line-numbers TRUE
unbuffered FALSE
column-names TRUE
sigint-ignore FALSE
port 0
progress-reports TRUE
prompt \N [\d]>
protocol
quick FALSE
raw FALSE
reconnect TRUE
Note the line with protocol set to 'empty'. Fill it with one of the options allowed (like "tcp") and the WARNING statement disappears hence resulting in valid processable output for the mysql discovery again. |
Comment by John Stones [ 2022 Aug 08 ] |
Did not work @hoppa |
Comment by Denis Rasikhov [ 2024 Feb 23 ] |
Could not reproduce with latest versions (MariaDB 10.11.6, MySQL 8.0.36), maybe it was some kind of a bug in some specific MariaDB client versions. Although it wouldn't hurt to add this option to configuration example, as the template only uses TCP connection anyway. |
Comment by Denis Rasikhov [ 2024 Mar 01 ] |
Fixed in:
|