Zabbix official support for monitoring MySQL, but directly using the default template is not available, but also need to go through additional settings to use. If you only need to do a simple monitoring of the MySQL database, Zabbix the template can meet the requirements, if there is a higher demand that need to write their own scripts, or use the fromdual plug-in, recently in research, there are always some problems, can not solve, if a successful, Welcome to Exchange ~ ~
Reference: Http://www.fromdual.com/mpm-installation-guide
Here are the steps to monitor MySQL with a template that comes with Zabbix.
Environment: zabbix2.4.5 ubuntu14.04 LTS MySQL 5.5
1, determine the Zabbix in the MySQL monitoring template. The default is already in the zabbix2.2 and above versions. Templates Name: Template App MySQL.
If not then go to Zabbix official download Url:https://zabbix.org/mw/images/d/d4/template_app_mysql-2.2.0.xml, then configure the Web interface on the front-end of the Zabbix server- > Templates page, select Import (various gods translations), and in the new page the downloaded template files are imported.
2, configure the MySQL client, create a user to get the relevant data of MySQL
' Mysqlcheck '@'localhost'mysqlcheck'; FLUSH privileges;
3, set up the account after the new/etc/zabbix/.my.cnf on the monitored side to provide Zabbix agent access to the database, similar to the following:
sudo Vim +/etc/zabbix/. my.cnf[mysql]host = Localhostuser == mysqlchecksocket =/var/run/mysqld/mysqld.sock[ Mysqladmin]host = localhostuser == mysqlchechksocket =/var /run/mysqld/mysqld.sock
4, modify/etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf, this file is used to develop Zabbix agent how to get MySQL data, we need to put all the/var/lib/ Zabbix modified to the path/etc/zabbix of the current. my.cnf file. Save and restart the Zabbix Agent after Setup is complete
sudo sed ' [email protected]/var/lib/[email protected]/etc/[email protected] ' /etc/zabbix/zabbix_agentd.d/userparameter_mysql.confsudo service zabbix-agent restart
5, the above configuration is complete. After you start monitoring, the main opportunity generates two new graphics.
Zabbix comes with templates to monitor MySQL