Zabbix Official Support Monitor MySQL, but using the default template directly is not available and requires additional settings to use. If you only need to do a simple monitoring of MySQL database, Zabbix self-brought template can meet the requirements;
Here are the steps to monitor MySQL with a template that comes with Zabbix:
Environment: zabbix2.2 Centos6.5 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.
2, if not to go to Zabbix official download Url:https://zabbix.org/mw/images/d/d4/template_app_mysql-2.2.0.xml, and then in the Zabbix server's front-end Web Interface configuration- > Templates page, select Import (various gods translations), and in the new page the downloaded template files are imported.
3, Configure the MySQL client , create a user to get the relevant data of MySQL
GRANT USAGE on *. mysqlcheck ' @ ' localhost ' identified by ' Mysqlcheck '; FLUSH privileges;
4, 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:
VIM/USR/LOCAL/ZABBIX/ETC/.MY.CNF This is the installation path of my client Agent [mysql]host = Localhostuser = Mysqlcheckpassword = Mysqlcheck Socket =/var/run/mysqld/mysqld.sock is configured according to its own mysql socket [mysqladmin]host = Localhostuser = MYSQLCHECKPASSW Ord = Mysqlchechksocket =/var/run/mysqld/mysqld.sock
5, modify/usr/local/zabbix/etc/zabbix_agentd.d/userparameter_mysql.conf, This file is used to develop Zabbix agent how to get MySQL data , We need to modify all the/var/lib/zabbix to the path of the current . my.cnf file/usr/local/zabbix/etc/. Save and restart the Zabbix Agent after Setup is complete
# sed-i ' s#/var/lib/zabbix#/usr/local/zabbix/etc/#g '/usr/local/zabbix/etc/zabbix_agentd.d/userparameter_ MYSQL.CONF # service Zabbix-agent restart
6 , the above configuration is complete. After you start monitoring, the main opportunity generates two new graphics.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/80/F2/wKioL1dFUufjIMldAAGNKkflP4E768.png "title=" Mysql.png "alt=" Wkiol1dfuufjimldaagnkkflp4e768.png "width=", "height=", "border=", "0" hspace= "0" vspace= "0" style= " width:750px;height:180px; "/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/80/F3/wKiom1dFUjWQm2arAADsdA57oy8860.png "title=" Sql.png "alt=" Wkiom1dfujwqm2araadsda57oy8860.png "width=", "height=" 145 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:750px;height:145px; "/>
This article is from the "Crazy_sir" blog, make sure to keep this source http://douya.blog.51cto.com/6173221/1783024
Zabbix 2.2 Using your own template to monitor MySQL