Mysql monitoring tools: zabbix + MPM (Performance Monitor for MySQL), zabbixmpm

Source: Internet
Author: User

Mysql monitoring tools: zabbix + MPM (Performance Monitor for MySQL), zabbixmpm

MPM is mainly used to monitor various mysql parameter performance indicators. The following describes the configuration of MPM and zabbix:

The following figure shows the configuration file diagram.


It consists of two parts:

1. zabbix template:Template_FromDual.MySQL.*.xml

2. MPM agent perl module:FromDualMySQL*.pm


Installation Method:

1. Install MPM first

In linux 6.4, install the following package:

Yum install perl-File-Which perl-libwww-perl-Digest-SHA perl-DBD-MySQL perl-Time-HiRes \
Perl-Crypt-SSLeay

Decompress the downloaded package:

Tar xf mysql_performance_monitor-latest.tar.gz
Tar xf mysql_performance_monitor_templates-latest.tar.gz

Mysql_performance_monitor_templates-latest.tar.gz is imported to the zabbix servertemplate as needed. mysql_performance_monitor-latest.tar.gz is decompressed and placed on the zabbix client.

2. Configure zabbix client

1. decompress the script on the client, configure the zabbix_agentd.conf file, and add the following content:

UserParameter = FromDual. MySQL. check,/opt/mysql_cece_monitor_agent/FromDualMySQLagent. pl/etc/zabbix/FromDualMySQLagent. conf

2. cp FromDualMySQLagent. conf. template/etc/zabbix/FromDualMySQLagent. conf

And modify the relevant content:

[Default]

Type = mysqld
LogFile =/var/log/zabbix/FromDualMySQLagent. log
Username = root
Password = <secret>
MysqlHost = 127.0.0.1
MysqlPort = 3306
ZabbixServer = localhost
Modules = process mysql myisam innodb


[<Db_server>]

Type = mysqld
Modules = mpm server

[Mysql1] #### this name must be consistent with the host name added by zabbix server.

Type = mysqld
Modules = process mysql myisam innodb
PidFile =/mysql/data/mysql. pid # mysql server pid

The following are the permissions required to monitor the user in the mysql database:
Create user 'mpm' @ '127. 0.0.1 'identified by 'mpmsecret ';
Grant process on *. * TO 'mpm' @ '2017. 0.0.1 ';
Grant replication client on *. * TO 'mpm' @ '2017. 0.0.1 ';


3. Create related directories and files and add permissions

Mkdir-p/var/log/zabbix/cache
Chown-R zabbix:/var/log/zabbix/cache

4. Modify the path of zabbix_send in the FromDualMySQLagent. pl script.

Path of zabbix_sender in FromDualMySQLagent. pl. Sed-I's |/usr/local/bin |/usr/local/zabbix/bin/| G' FromDualMySQLagent. pl

5. start agentd and service zabbix_agentd start


3. Configure the zabbix Server

1. Import related templates. Template_FromDual.MySQL.mpm.xml is required. You can import other templates as needed;

2. Add a host and link it to the MPM template.

Note that the host name must be consistent with the Host Name of the monitored client.


Test and verification:

/Usr/local/zabbixt/mpm/FromDualMySQLagent. pl/etc/zabbix/FromDualMySQLagent. conf
1: indicates that the MPM plug-in is normal. Restart zabbix_agent and load the mpm plug-in.


You can also set it to crontab for regular monitoring.

* ***/Usr/local/zabbixt/mpm/FromDualMySQLagent. pl/etc/zabbix/FromDualMySQLagent. conf 1>/dev/null 2> & 1



Specific can refer to: http://www.fromdual.com/mpm-installation-guide





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.