Environment Description:
Zabbix server:192.168.1.1
Zabbix agent:192.168.1.12
First, install Agent client
(1) Adding user groups
Groupadd Zabbix
Useradd-g zabbix-m Zabbix
(2) Unzip the installation package, compile and install
TAR-ZXVF zabbix-3.0.3.tar.gz
CD zabbix-3.0.3
./configure--prefix=/usr/local/zabbix--enable-agent
Make install
(3) Modify the AGENTD configuration file
Vim/usr/local/zabbix/etc/zabbix_agentd.conf
Server= 192.168.1.1
Server IP Address serveractive=192.168.1.1
hostname=192.168.1.12
Must be hostname consistent with Zabbix server when the host is created
(4) Modify startup configuration, add soft link
CP zabbix-3.0.3/misc/init.d/tru64/zabbix_agentd/etc/init.d/
chmod 755/etc/init.d/zabbix_ Agentd
Ln-s/usr/local/zabbix/sbin/*/usr/local/sbin/
Ln-s/usr/local/zabbix/bin/*/usr/local/bin/1234512345
(5) Set self-start
Vim/etc/rc.d/init.d/zabbix_ Agentd
#在第二行添加如下内容
#chkconfig: 2345 10 90
#description: Zabbix Agent
Exit file after saving
#chkconfig--add Zabbix_agentd
#chkconfig Zabbix_agentd on
#/etc/init.d/zabbix_agentd start
Add hosts () in Zabbix server
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/8B/E2/wKioL1hbqk7TUdleAACvwDrAfUw396.png-wh_500x0-wm_3 -wmp_4-s_3364063084.png "title=" Vvv.png "alt=" Wkiol1hbqk7tudleaacvwdrafuw396.png-wh_50 "/>
Second, monitoring MySQL with its own template
First, add the permissions in the client's MySQL, that is, the local MySQL is connected using the Zabbix account.
Mysql> Grant All on * * to [e-mail protected] ' localhost ' identified by "123456";
mysql> flush Privileges;
#拷贝文件到/usr/local/zabbix/etc/zabbix_agentd.conf.d/#指定自己的zabbix安装目录
Cp/tmp/zabbix-3.0.3/conf/zabbix_agentd/userparameter_mysql.conf
/usr/local/zabbix/etc/zabbix_agentd.conf.d/
#添加用来关联mysql的配置文件my. CNF, and modify the MySQL path in the template configuration file
cd/usr/local/zabbix/etc/
# Mysql.sock file Find path through Find/-name Mysql.sock
Vim. my.cnf
[MySQL]
Host=localhost
User=zabbix
password=123456
Socket=/var/lib/mysql/mysql.sock
[Mysqladmin]
Host=localhost
User=zabbix
password=123456
Socket=/var/lib/mysql/mysql.sock
# Modify Userparameter_mysql.conf:
Sed-i ' [email protected]/var/lib/zabbix@/usr/local/zabbix/[email protected] '
/usr/local/zabbix/etc/zabbix_agentd.conf.d/userparameter_mysql.conf
# Modify complete userparameter_mysql.conf content as follows:
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8B/E5/wKiom1hbquXSP2TNAACTgivgZD0865.png-wh_500x0-wm_3 -wmp_4-s_2627383445.png "title=" 2222.png "alt=" Wkiom1hbquxsp2tnaactgivgzd0865.png-wh_50 "/>
#HOME目录为新增 the directory where the. my.cnf file is located
#修改zabbix_agentd the. conf file, add the following line
include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
#重启zabbix-agentd
/etc/init.d/zabbix_agentd restart
Third, add template App mysql templates to 192.168.1.12 host on Zabbix Server page
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/8B/E2/wKioL1hbqw6zcwwaAAGqL92Nwnk961.png-wh_500x0-wm_3 -wmp_4-s_2349106935.png "title=" 1111.png "alt=" Wkiol1hbqw6zcwwaaagql92nwnk961.png-wh_50 "/>
Monitoring Items Show:
Change and delete
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/8B/E6/wKiom1hbsKmi5psMAAF2HDLehio375.png-wh_500x0-wm_3 -wmp_4-s_1502641344.png "title=" Cccc.png "alt=" Wkiom1hbskmi5psmaaf2hdlehio375.png-wh_50 "/>
PS: (If you need more detailed MySQL monitoring, you can use third-party monitoring Percona)
Reference Link: http://blog.csdn.net/mchdba/article/details/51447750
This article is from the "7835882" blog, please be sure to keep this source http://crfsz.blog.51cto.com/7835882/1885182
Zabbix-3.0.3 using the default template to monitor MySQL