Templates are made by myself, I hope to bring the role of everyone.
Client configuration file (download from server)
Zabbix_agentd.conf
Client software
Zabbix_agents_2.0.3.linux2_6.amd64.tar.gz
Template
Template_mysql.xml , Template_mysql_repl.xml
1 , add Zabbix user and user groups
vd14yywg01:~ # Groupadd Zabbix
vd14yywg01:~ # useradd-g zabbix-m Zabbix
2 , creating Zabbix Client Directory
vd14yywg01:~ # Mkdir-p/usr/local/zabbix/etc
3 , move the software and configuration files to the appropriate directory
vd14yywg01:~ # MV zabbix_agents_2.0.3.linux2_6.amd64.tar.gz/usr/local/zabbix/
vd14yywg01:~ # MV zabbix_agentd.conf/usr/local/zabbix/etc/
vd14yywg01:~ # cd/usr/local/zabbix/
Vd14yywg01:/usr/local/zabbix # tar zxvf zabbix_agents_2.0.3.linux2_6.amd64.tar.gz
4 , modify Configuration
Vd14yywg01:/usr/local/zabbix # CD etc/
VD14YYWG01:/USR/LOCAL/ZABBIX/ETC # VI zabbix_agentd.conf
#### configured as follows
server=10.70.216.36 # # # service-side IP
listenport=10050 # # # Client Port
listenip=172.16.202.173 # # # client IP
hostname=vd14yywg01 # # # Client Host name
### add monitoring at the end MYSQL
Userparameter=mysql.ping,/usr/bin/mysqladmin-uroot-proot Ping--socket=/var/lib/mysql/mysql.sock| Grep-c Alive
Userparameter=mysql.version,/usr/bin/mysql-v--socket=/var/lib/mysql/mysql.sock
Userparameter=mysql.processlist,echo "show full processlist;" | /usr/bin/mysql-uroot-proot--socket=/var/lib/mysql/mysql.sock | Wc-l
# # #mysql Status
Userparameter=mysql.status[*],echo "show global status like ' $ ';" | /usr/bin/mysql-uroot-proot--socket=/var/lib/mysql/mysql.sock | Tail-1 | awk ' {print $$2} '
# # #mysql Variables
Userparameter=mysql.variables[*],echo "Show variables like ' $ ';" | /usr/bin/mysql-uroot-proot--socket=/var/lib/mysql/mysql.sock | Tail-1 | awk ' {print $$2} '
#mysql REPL
Userparameter=mysql. Slave_io_running,/usr/bin/mysql-uroot--socket=/var/lib/mysql/mysql.sock-e ' show Slave status\g ' |grep-e ' Slave_IO_R Unning "|awk ' {print $} ' |grep-c Yes
Userparameter=mysql. Slave_sql_running,/usr/bin/mysql-uroot--socket=/var/lib/mysql/mysql.sock-e ' show Slave status\g ' |grep-e ' Slave_SQL _running "|awk ' {print $} ' |grep-c Yes
5 , start
VD14YYWG01:/USR/LOCAL/ZABBIX/ETC # /usr/local/zabbix/sbin/zabbix_agentd-c/usr/local/zabbix/etc/zabbix_ Agentd.conf
6 , view startup
VD14YYWG01:/USR/LOCAL/ZABBIX/ETC # NETSTAT–TUNLP
.....
.....
TCP 0 0 172.16.202.173:10050 0.0.0.0:* LISTEN 24855/zabbix_agentd
......
7 , Import MYSQL the corresponding template Template_mysql.xml , Template_mysql_repl.xml import into the template.
650) this.width=650; "title=" 1.png "src=" Http://s1.51cto.com/wyfs02/M01/75/A5/wKioL1ZALEux9uBtAAA-ARDWeJY930.png " alt= "Wkiol1zaleux9ubtaaa-ardwejy930.png"/>
650) this.width=650; "title=" 2.png "src=" Http://s1.51cto.com/wyfs02/M00/75/A5/wKioL1ZALFfTpRMaAADNQB6QU8I607.png " alt= "Wkiol1zalfftprmaaadnqb6qu8i607.png"/>
8 , put the import template relationship host
650) this.width=650; "title=" 3.png "src=" Http://s3.51cto.com/wyfs02/M02/75/A8/wKiom1ZALCCS1p84AADBdYsReOI925.png " alt= "Wkiom1zalccs1p84aadbdysreoi925.png"/>
Click Add
650) this.width=650; "title=" 4.png "src=" Http://s4.51cto.com/wyfs02/M01/75/A5/wKioL1ZALHWQKQNMAAC5qTqerDE334.png " alt= "Wkiol1zalhwqkqnmaac5qtqerde334.png"/>
Click Archive.
9 , view results such as
650) this.width=650; "title=" 5.png "src=" Http://s1.51cto.com/wyfs02/M02/75/A5/wKioL1ZALIrQmARIAACbw2DPIjM325.png " alt= "Wkiol1zalirqmariaacbw2dpijm325.png"/>
650) this.width=650; "title=" 6.png "src=" Http://s3.51cto.com/wyfs02/M01/75/A5/wKioL1ZALJSBvmHJAACw0RpPmIM846.png " alt= "Wkiol1zaljsbvmhjaacw0rppmim846.png"/>
This article is from the "Fly Hung 膤" blog, please be sure to keep this source http://jxzhfei.blog.51cto.com/1382161/1710983
Zabbix Monitor MySQL templates