How to install the MySQL monitor plugin PMP on Zabbix

Source: Internet
Author: User
Tags install php percona

PMP, full name is Percona monitoring Plugins, is a plugin written by Percona company for MySQL monitoring. Support Nagios,cacti. Starting with PMP 1.1, Zabbix is supported.

Below, see how to install the PMP on the Zabbix.

Configuring the Zabbix Agent

Download PMP

: https://www.percona.com/downloads/percona-monitoring-plugins/

Since my Linux version is Rhel 6.7, select RPM package

# wget https://www.percona.com/downloads/percona-monitoring-plugins/1.1.6/percona-zabbix-templates-1.1.6-1.noarch.rpm

# RPM-IVH percona-zabbix-templates-1.1.6-1.noarch.rpm

warning:percona-zabbix-templates-1.1. 6-1. Noarch.rpm:Header V4 dsa/SHA1 Signature, key ID cd2efd2a:nokeypreparing ...                ########################################### [%]   1: percona-zabbix-template########################################### [%/var/lib/zabbix/ percona//var/lib/zabbix/percona/templates

Copy the configuration file for the PMP

# cp/var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf/etc/zabbix/zabbix_agentd.d/

Make sure that include=/etc/zabbix/zabbix_agentd.d/is turned on in the Zabbix-agent configuration file

Restart Zabbix-agent Service

# Service Zabbix-agent Restart

Create a monitoring user for MySQL

Mysql> Grant Process,super,select on * * to [e-mail protected] ' localhost ' identified by ' monitor ';

mysql> flush Privileges;

To modify a user name and password in a script

# vim/var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php

$mysql _user = ' monitor '; $mysql _pass = ' monitor '; $mysql _port = 3306;

Test whether the script can get state information to the database

The script needs to test two parts of the content

1. State variables of the MySQL instance itself

2. is MySQL a slave

Test the state variables of the MySQL instance itself

#/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh GG

/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper. SH  * file  /usr/bin/php-q/var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php--host localhost--items gg

Because its script is implemented in PHP, it is necessary to install PHP and Php-mysql

# Yum Install php php-mysql

Re-test the script

#/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh GG

A value return represents OK

Test if MySQL is a slave

#/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh Running-slave

Returns 0 and 1 are normal, and returning to "Access denied" is problematic.

Templates for importing PMP

Zabbix_agent_template_percona_mysql_server_ht_2.0.9-sver1.1.6.xml in the/var/lib/zabbix/percona/templates directory

How to install the MySQL monitor plugin PMP on Zabbix

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.