MPM is mainly used to monitor the performance indicators of various mysql parameters. The following is a brief description of its configuration with zabbix: The following is its configuration file relationship diagram, which mainly includes two parts: 1. zabbix template: template_FromDualMySQL * xml2, MPMagentperl module: Fro MPM is mainly used to monitor various mysql parameter performance indicators. The following is a brief description of its configuration with 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 = mysqldLogFile =/var/log/zabbix/FromDualMySQLagent. logUsername = rootPassword =
MysqlHost = 127.0.0.1MysqlPort = 3306 ZabbixServer = localhostModules = process mysql myisam innodb [
] Type = mysqldModules = mpm server [mysql1] #### The name must be consistent with the host name added by zabbix server. Type = mysqldModules = process mysql myisam innodbPidFile =/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