First, authorize the Zabbix to connect to the database:
Mysql-uroot-p123456-e "GRANT USAGE on * * to ' zabbix ' @ ' localhost ' identified by ' Zabbix '";
Second, establish database connection information file:/usr/local/zabbix/etc/.my.cnf
# Zabbix Agent[mysql]host=localhostuser=zabbixpassword=zabbixsocket=/tmp/mysql.sock[mysqladmin]host= Localhostuser=zabbixpassword=zabbixsocket=/tmp/mysql.sock
Third, copy the MySQL template userparameter_mysql.conf need to use the key to the/usr/local/zabbix/etc/zabbix_agentd.conf.d/directory:
Files in Zabbix can be found in the installation package
cp/root/zabbix-2.2.6/conf/zabbix_agentd/userparameter_mysql.conf/usr/local/zabbix/etc/zabbix_agentd.conf.d/
Iv. Modify the userparameter_mysql.conf file:
Change all Home=/var/lib/zabbix to home=/usr/local/zabbix/etc/
That's the second step. The directory location of the. My.cnf that we created.
V. Modification of the zabbix_agentd.conf file:
Make sure you have the following configuration:
include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
Enable ZABBIX_AGENTD to automatically add the userparameter_mysql.conf file under/usr/local/zabbix/etc/zabbix_agentd.conf.d/directory
Finally restart the ZABBIX_AGENTD, the Template App MySQL to join the monitoring is OK, also good:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4A/F2/wKiom1QnfByBA6WBAATJ3XaOf1c330.jpg "style=" float: none; "title=" 1.png "alt=" Wkiom1qnfbyba6wbaatj3xaof1c330.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4A/F4/wKioL1QnfEWwL1etAAVJQTIh1nI224.jpg "style=" float: none; "title=" 2.png "alt=" Wkiol1qnfewwl1etaavjqtih1ni224.jpg "/>
The middle of the fault is I restart the database caused, ignore it ~ ~
This article is from the "Operations Notes" blog, make sure to keep this source http://lihuipeng.blog.51cto.com/3064864/1558971
Monitor the database using the MySQL monitor template Zabbix2.2 comes with