Monitor MySQL
1. Monitor MySQL using the Percona monitor plugin
[email protected] alertscripts]# Yum install http://www.percona.com/downloads/percona-release/redhat/0.1-4/ percona-release-0.1-4.noarch.rpm
2.Percona Components
3. Install Percona-zabbix template PHP php-mysql
[email protected] alertscripts]# yum install percona-zabbix-templates php php-mysql
4. See what software is installed
[[email protected] alertscripts]# Rpm-qa PHP
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/A0/A1/wKioL1mevxGhvvPBAABbBlMKpY0268.png "title=" Clipboard.png "alt=" Wkiol1mevxghvvpbaabbblmkpy0268.png "/>
5. Import templates
Template See attachment
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/A0/A3/wKioL1mev-uTlW3EAADE9i5lqsk436.png "title=" Clipboard1.png "alt=" Wkiol1mev-utlw3eaade9i5lqsk436.png "/>
6. Copy the configuration file
[Email protected] alertscripts]# Cp/var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf/etc/zabbix /zabbix_agentd.d/
7. Where the script is stored
[Email protected] scripts]# pwd
/var/lib/zabbix/percona/scripts
8. Restart Service
[Email protected] scripts]# systemctl restart Zabbix-agent
9, create a profile, content, user name, password.
< note: In a production environment, you need to create a monitoring user >
[Email protected] scripts]# vim ss_get_mysql_stats.php.cnf
[email protected] scripts]# cat SS_GET_MYSQL_STATS.PHP.CNF
<?php
$mysql _user = ' root ';
$mysql _pass = ' S3cret '; (my root password is empty here, because there is no setting)
9, open the configuration file to view the contents of monitoring, as required to obtain the appropriate parameters
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/A0/A4/wKioL1mewCayIqbvAAGItZI4pyA821.png "title=" Clipboard3.png "alt=" Wkiol1mewcayiqbvaagitzi4pya821.png "/>
10. Execute the next script
[Email protected] scripts]#./get_mysql_stats_wrapper.sh
The indicators obtained
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/A0/A4/wKioL1mewEjRwoidAAAt0SYXLag522.png "title=" Clipboard4.png "alt=" Wkiol1mewejrwoidaaat0syxlag522.png "/>
11. Configure the host to add templates
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/01/F5/wKiom1mewIXgDMByAACX4uDT1ao739.png "title=" Clipboard5.png "alt=" Wkiom1mewixgdmbyaacx4udt1ao739.png "/>
Then view the graphic
Number of connections
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/A0/A5/wKioL1mewKGR_a-IAANLKvNcmuE567.png "title=" Clipboard6.png "alt=" Wkiol1mewkgr_a-iaanlkvncmue567.png "/>
This article is from a "glass of water" blog, please be sure to keep this source http://6528161.blog.51cto.com/6518161/1959137
Monitoring and monitoring of Zabbix MySQL