Zabbix monitoring MySQL

Source: Internet
Author: User
Tags install perl percona

Zabbix monitoring of MySQL is achieved by using the Mysql_performance_monitor package.

1. Install dependent software.
Yum install Perl-file-which perl-libwww-perl perl-digest-sha perl-dbd-mysql perl-time-hires perl-Crypt-SSLeay php Php-mysql

2. Download the Mysql_performance_monitor package.
Wget-c http://www.shinguz.ch/download/mysql_performance_monitor-latest.tar.gz
Tar XF mysql_performance_monitor-latest.tar.gz

3. Install the Percona-monitor-templates package.
[Email protected] ~]# RPM-IHV https://www.percona.com/downloads/percona-monitoring-plugins/1.1.5/ percona-zabbix-templates-1.1.5-1.noarch.rpm
Retrieving https://www.percona.com/downloads/percona-monitoring-plugins/1.1.5/percona-zabbix-templates-1.1.5-1.noarch.rpm
Warning:/var/tmp/rpm-tmp. P8evay:header V4 dsa/sha1 Signature, key ID Cd2efd2a:nokey
Preparing ... ########################################### [100%]
1:percona-zabbix-template########################################### [100%]

Scripts is installed to/var/lib/zabbix/percona/scripts
Templates is installed To/var/lib/zabbix/percona/templates

4. View the Percona-zabbix-templates package build directory file location.
[Email protected] ~]# RPM-QL percona-zabbix-templates
/var/lib/zabbix/percona
/var/lib/zabbix/percona/scripts
/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh
/var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php
/var/lib/zabbix/percona/templates
/var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf
/var/lib/zabbix/percona/templates/zabbix_agent_template_percona_mysql_server_ht_2.0.9-sver1.1.5.xml

5. Copy the configuration file userparameter_percona_mysql.conf to the Zabbix configuration file directory.
[Email protected] ~]# cp/var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf/etc/zabbix/zabbix_ agentd.d/

6. Restart the Zabbix-agent service.
[Email protected] ~]#/etc/init.d/zabbix-agent restart
Shutting down Zabbix agent: [OK]
Starting Zabbix agent: [OK]


7. Modify the user name and password for the connected database
[Email protected] ~]# grep-a 1 root/var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php
$mysql _user = ' user_name ';
$mysql _pass = ' password ';


8. Test.
[Email protected] ~]#/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh GG
2

If there is no data, do the following to see if the sock configuration file location for MySQL in/etc/php.ini is correct.
/usr/bin/php-q/var/lib/zabbix/percona/scripts/ss_get_mystats.php--host localhost--items gg
Troubleshoot errors with error messages.

Zabbix monitoring 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.