Monitoring and monitoring of Zabbix MySQL

Source: Internet
Author: User
Tags php script percona

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

    • PHP script

    • Shell script to invoke PHP script

    • Zabbix configuration file

    • Zabbix template file

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.