zabbix2.2 has a template to monitor MySQL , we can use our own template to monitor MySQL, if the template does not meet our needs, we can then customize the key to meet our needs, Next, let's talk about how to use Zabbix to monitor MySQL status with its own template .
first authorize the Zabbix to connect to the database
Mysql>grant USAGE on *. * to ' Zabbix ' @ ' localhost ' identified by ' Zabbix ';
Next, establish the database connection information file /usr/local/zabbix/etc/.my.cnf
[MySQL]
Host=localhost
User=zabbix
Password=zabbix
Socket=/var/lib/mysql/mysql.sock
[Mysqladmin]
Host=localhost
User=zabbix
Password=zabbix
Socket=/var/lib/mysql/mysql.sock
Next, copy the MySQL template key file under the Zabbix installation package to the zabbix/etc/zabbix_agentd.conf.d/ directory
# cp/root/zabbix-2.2.2/conf/zabbix_agentd/userparameter_mysql.conf/usr/local/zabbix/etc/zabbix_agentd.conf.d/
Modify Some of the configuration of userparameter_mysql.conf
Change all Home=/var/lib/zabbix to home=/usr/local/zabbix/etc/.
and ensure that the zabbix_agentd.conf configuration file has the following configuration
include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
Finally restart the ZABBIX_AGENTD service, on the server side of the MySQL template linked to the corresponding host, we can see the monitoring effect
This article from the "source clean is clear, the shape of the end of the shadow straight" blog, please be sure to keep this source http://zhouxt.blog.51cto.com/8743763/1641556
zabbix2.2 Beginner's Guide to monitoring MySQL (vi)