First, the relevant instructions
The production line uses the Zabbix 2.4.5 to monitor all business and system networks, of course, also need to monitor the MySQL database related information, Zabbix with the MySQL monitoring template can monitor MySQL, this article in the Zabbix 2.4.5 version, Other versions please experiment on your own.
Second, configure the MySQL to monitor
1, first authorized to let Zabbixagent connect the database:
Log in to MySQL as MySQL Roott
$mysql-uroot-p123456-e "GRANT USAGE on * * to ' zabbixagent ' @ ' localhost ' identified by ' zbbixagent '"; $GRANT usage,proces S,super,replication client,replication SLAVE on * * to ' zabbixagent ' @ ' localhost ' identified by ' zabbixagent '; $flush privileges;
Or:
#mysql-uroot-p-E "GRANT USAGE on *. * to ' zabbixagent ' @ ' localhost ' identified by ' zabbixagent '"
2. Add MySQL configuration file
Vim/etc/zabbix/.my.cnf
#Zabbix agent[mysql]host=localhostuser=zabbixagentpassword=zabbixagentsocket=/data1/mysqldb/mysql/mysql.sock[ Mysqladmin]host=localhostuser=zabbixagentpassword=zabbixagentsocket=/data1/mysqldb/mysql/mysql.sock
Note:socket specifically put there, please modify the path before viewing cat/etc/my.cnf
Third, modify/etc/zabbix/zabbix_agent.conf
Modify the following:
Unsafeuserparameters=1
include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
Four, modify MySQL template parameters
Zabbix- 2.4.4 with the MySQL template, the default is placed in/etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf
need to put home=/var/lib/zabbix Replace with: Home=/etc/zabbix
, $s/\/var\/lib/\/etc/g (full replacement of vim command line mode)
Restart Zabbix_agent
#service Zabbix_agent Restart
If you cannot plot or appear not supported to Zabbix server tail-f/var/log/zabbix/ Zabbix_server.log
27659:20150428:111248.007 error reason for "ydnwy-01:mysql.status[uptime]" changed:received Value [ERROR 2002 (HY000):
can ' t connect to local MySQL server through socket '/data1/mysqldb/mysql/mysql.sock ' ( ]
is not suitable for value type [Numeric (unsigned)] and data type [Decimal]
Similar error stating monitoring side Mysql.sock access problem, please Check permissions or
#ln-S/data1/mysqldb/mysql/mysql.sock/var/lib/mysql/mysql.sock
V. Refer to the following documents
http://lihuipeng.blog.51cto.com/3064864/1558971
This article is from the "Learning, learning" blog, please be sure to keep this source http://dyc2005.blog.51cto.com/270872/1943405
zabbix2.4.5 comes with MySQL monitor