1. On the MySQL side (Zabbix client) modifying parameters for monitoring MySQL
[Email protected] ~]# VIM/ETC/MY.CNF
[MySQL]
Auto-rehash
user= User Name
password= Password
[Mysqladmin]
user= User Name
password= Password
Userparameter=mysql.size[*],echo ' select SUM ($ (case "$ both|" ") echo "Data_length+index_length";; Data|index) echo "$3_length";; Free) echo "Data_free";; ESAC)) from information_schema.tables$ ([["$" = "All" | |! "$"] | | echo "where Table_schema= '") $ ([[["$] =" All "| |! "$"] | | echo "and Table_name= '"); "| /usr/local/mysql-5.6.28/bin/mysql-s/tmp/mysql.sock-n
userparameter=mysql.ping,/usr/local/mysql-5.6.28/ Bin/mysqladmin-s/tmp/mysql.sock Ping | Grep-c Alive
Userparameter=mysql.version,/usr/local/mysql-5.6.28/bin/mysql-s/tmp/mysql.sock-v
[Email protected] ~]#/etc/init.d/zabbix-agent restart
Shutting down Zabbix agent: [OK]
Starting Zabbix agent: [OK]
[Email protected] ~]#
2. Test commands on the Zabbix server
[[email protected] ~]# zabbix_get-s mysql IP address---"mysql.version"
MySQL Ver 14.14 distrib 5.1.73, for Redhat-linux-gnu (x86_64) using ReadLine 5.1
[[email protected] ~]# zabbix_get-s mysql IP address--- "mysql.ping"
0
[Email protected] ~]#
3. Attach the MySQL template to the host you want to monitor on the Zabbix console
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/80/03/wKiom1c0KWGQGmPCAABMRyOJc4w430.png "title=" 1.png " alt= "Wkiom1c0kwgqgmpcaabmryojc4w430.png"/>
4. Drawing of drawings
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/80/00/wKioL1c0LNzR5i4DAACohq0LLdA674.png "title=" 2.png " alt= "Wkiol1c0lnzr5i4daacohq0llda674.png"/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/80/00/wKioL1c0LaehHXe4AACU5V-cDzI670.png "title=" 3.png " alt= "Wkiol1c0laehhxe4aacu5v-cdzi670.png"/>
This article is from the "Days Together" blog, please be sure to keep this source http://tongcheng.blog.51cto.com/6214144/1772671
Zabbix monitoring MySQL