Recently many people have asked me how to use my previous blog template can not monitor, after the communication found that the other side of the MySQL version is 5.6, in the command line to view the truth of the data, when using MYSQL-UXXX-PXXX-PXXX, will be the following error
Warning:using a password on the command line interface can be insecure
The cause of the error is the MySQL 5.6 version of the password security policy, the previous version can be used in the command line with the password will force error, so use Zabbix LLD monitoring MySQL, will be due to receive this error caused by no way to monitor.
The workaround is to:
The first: a client that uses MySQL 5.5
The second type: Using--login-path (recommended)
First, MySQL configuration
Here's how to use the--login-path setting
Mysql_config_editor Set--login-path=local--host=localhost--user=zabbix-p
Command explanation:
--login-path is set to access the name, I set the local;
--host is the host address that specifies the allowed access, which is configured when you grant;
--user is a user name and is also configured for grant time;
-P is the specified password, which is also the grant configuration.
After running the above command, you will be asked to belong to the password, the input will not have any feedback, you can use the following command to view
15:35:38 # mysql_config_editor Print--all[local]user = Zabbixpassword = *****host = localhost
Test
15:35:40 # mysql --login-path=localwelcome to The mysql monitor. commands end with ; or \g.your mysql connection id is 741server version: 5.6.19-67.0-log percona server (GPL), release 67.0, revision 618copyright (c) 2009-2014 percona LLC and/or its affiliatesCopyright (c) 2000, 2014, oracle and/or its affiliates. all rights reserved. oracle is a registered trademark of oracle corporation and/or Itsaffiliates. other names may be trademarks of their respectiveowners . type ' help; ' or ' \h ' for help. Type ' \c ' to clear the current input statement.mysql> quit
It's configured with MySQL secure mode access
Second, Zabbix AGENTD configuration
The following describes the case of key in the Zabbix client configuration file
The default client key is
Userparameter=mysql_stats[*],mysql-h localhost-p $1-uzabbix-pzabbix-e "show Global Status" |grep "\<$2\>" |cut- F2userparameter=mysql_stats_slave[*],mysql-h localhost-p $1-uzabbix-pzabbix-e "show slave Status\G" |grep "\<$2\&G t; "| awk ' {if ($NF = = "Yes") {print 1} else {print 0}} '
Revision changed to
Userparameter=mysql_stats_5.6[*],sudo MySQL--login-path=local-p $1-e "show Global Status" |grep "\<$2\>" |cut-f2 Userparameter=mysql_stats_slave_5.6[*],sudo MySQL--login-path=local-p $1-e "show slave Status\g" |grep "\<$2\>" |awk ' {if ($NF = = "Yes") {print 1} else {print 0}} '
Then configure sudo to add in the/etc/sudoers
Zabbix all= (Root) nopasswd:/usr/bin/mysql
Where/usr/bin/mysql is the MySQL program address, can be modified according to your own situation.
Restart Zabbix AGENTD after completion
Ps-ef|grep zabbix|grep-v Grep|awk ' {print $} ' |xargs kill-9/usr/local/zabbix/sbin/zabbix_agentd-c/usr/local/zabbix/ Conf/zabbix_agentd.conf
Other configuration reference before monitoring MySQL on the line
Third, Zabbix Web configuration
A, Template Import
Import Template Mysql 5.6 Auto discovery into the Zabbix (templates in the attachment), the specific operation is not described.
B. Host affinity Templates
The host administrative Templates that need to monitor MySQL version 5.6 will be monitored and automatically updated by default after 3,600 seconds.
This article is from the "Yin-Technical Exchange" blog, please be sure to keep this source http://dl528888.blog.51cto.com/2382721/1677545
Zabbix Enterprise Application monitoring MySQL version 5.6