Zabbix + Mysql Fpmmm (MPM) monitoring tutorial

Source: Internet
Author: User
Tags db2 install php localhost mysql mkdir

Mysql Fpmmm is an upgraded version of MPM. It is more convenient to use fpmmm than mpm, but the corresponding optimization parameters must be enabled.
1. Configure the pid


Copy the startup script

Cp support-files/mysql. server/etc/init. d/mysqld
Chkconfig -- add mysqld
Service mysqld start
Pid-file =/var/run/mysqld. pid
Configure environment variables

Vim/etc/profile. d/mysql. sh
Export PATH =/usr/local/mysql/bin: $ PATH
Sh vim/etc/profile. d/mysql. sh
Add the pid in the configuration file

[Root @ localhost mysql] # vim/etc/mysql/my. cnf
Pid-file =/var/run/mysqld. pid
[Root @ localhost mysql] # mkdir/var/run/mysqld
[Root @ localhost mysql] # chown-R mysql. mysql/var/run/mysqld
[Root @ localhost mysql] #/etc/init. d/mysqld start
2. Install zabbx-agnet

Rpm-ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
Yum install-y zabbix-agent-2.4.7 zabbix-sender-2.4.7 zabbix-2.4.7 agent-2.4.7
Vim/etc/zabbix/zabbix_server.conf
Server = 192.168.128.128
ErverActive = 192.168.128.128
Hostname = Zabbix server
3. fpmmm monitoring

Yum install php-cli php-process php-mysqli
Cat <_ EOF>/etc/php. d/fpmmm. ini
Variables_order = "EGPCS"
Date. timezone = 'Europe/Zurich'
_ EOF
Download fpmmm

Wget-P/usr/local/https://support.fromdual.com/admin/download/fpmmm-0.10.5.tar.gz
Cd/usr/local
Tar xf fpmmm-0.10.5.tar.gz
Ln-s fpmmm-0.10.5 fpmmm
Cd fpmmm
Mkdir/etc/fpmmm
Cp/usr/local/fpmmm/tpl/fpmmm. conf. template/etc/fpmmm. conf
Chown-R zabbix:/etc/fpmmm
Authorize fpmmm,

Vim/etc/profile. d/mysql. sh
Export PATH =/usr/local/mysql/bin: $ PATH
Sh vim/etc/profile. d/mysql. sh
Mysql-e "grant all on *. * TO 'fpmmm' @ '192. 168.158.130 'identified BY 'password ';""
Mysql-e "grant all on *. * TO 'fpmmm' @ '2017. 0.0.1 'identified BY 'password ';"
Add zabbix users to mysql

Usermod-G mysql zabbix
Modify the fpmm configuration file

[Root @ localhost fpmmm] # egrep-v "^ # | ^ $"/etc/fpmmm. conf
[Default]
Type = mysqld
LogLevel = 2
LogFile =/tmp/fpmmm. log
CacheFileBase =/tmp/fpmmm/fpmmmCache
AgentLockFile =/tmp/fpmmm. lock
Username = fpmmm
Password = password
MysqlHost = 127.0.0.1
MysqlPort = 3306
ZabbixServer = 192.168.158.128
Disabled = false
Modules = innodb master myisam mysql process security
PidFile =/var/lib/mysql/mysqld. pid
[Mysql-master] # This MUST match Hostname in Zabbix!
Type = mysqld
Modules = fpmmm server
[Mysql-master] # This MUST match Hostname in Zabbix!
Type = mysqld
MysqlPort = 3306
Modules = process mysql myisam innodb master slave security
PidFile =/var/run/mysqld. pid
Test

[Root @ localhost fpmmm] #/usr/local/fpmmm/bin/fpmmm -- config =/etc/fpmmm. conf
1
Add mysql. check

Vim/etc/zabbix/zabbix_agentd.conf
UserParameter = FromDual. MySQL. check,/usr/lcaol/fpmmm/bin/fpmmm -- config =/etc/fpmmm. conf
Scheduled Tasks

[Root @ localhost fpmmm] # crontab-l
* ***/Usr/local/fpmmm/bin/fpmmm -- config =/etc/fpmmm. conf>/dev/null
Observe logs

96402: 12:09:02. 338-WARN: Instance db2 seems not to be a Slave. (rc = 1577 ).
96402: 12:09:02. 373-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) run finished (rc = 0 ).
96608: 12:10:01. 438-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) (0.10.5) run started.
96608: 12:10:02. 616-WARN: Instance db2 seems not to be a Slave. (rc = 1577 ).
96608: 12:10:02. 649-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) run finished (rc = 0 ).
96808: 12:11:01. 678-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) (0.10.5) run started.
96808: 12:11:02. 823-WARN: Instance db2 seems not to be a Slave. (rc = 1577 ).
96808: 12:11:02. 866-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) run finished (rc = 0 ).
97010: 12:12:01. 891-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) (0.10.5) run started.
97010: 12:12:03. 048-WARN: Instance db2 seems not to be a Slave. (rc = 1577 ).
97010: 2016-05-12:12:03. 081-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) run finished (rc = 0 ).
97210: 12:13:01. 137-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) (0.10.5) run started.
97210: 12:13:02. 322-WARN: Instance db2 seems not to be a Slave. (rc = 1577 ).
97210: 12:13:02. 355-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) run finished (rc = 0 ).
97411: 12:14:01. 380-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) (0.10.5) run started.
97411: 12:14:02. 534-WARN: Instance db2 seems not to be a Slave. (rc = 1577 ).
97411: 12:14:02. 569-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) run finished (rc = 0 ).
97611: 12:15:01. 607-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) (0.10.5) run started.
97611: 12:15:02. 765-WARN: Instance db2 seems not to be a Slave. (rc = 1577 ).
97611: 12:15:02. 799-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) run finished (rc = 0 ).
97811: 12:16:01. 846-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) (0.10.5) run started.
97811: 12:16:03. 003-WARN: Instance db2 seems not to be a Slave. (rc = 1577 ).
97811: 2016-05-12:16:03. 037-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) run finished (rc = 0 ).
98011: 2016-05-12:17:01. 095-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) (0.10.5) run started.
98011: 12:17:02. 263-WARN: Instance db2 seems not to be a Slave. (rc = 1577 ).
98011: 12:17:02. 304-INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) run finished (rc = 0 ).
View graph

 

 

 

Template_FromDual.MySQL.mpm.xml (monitor the mpm agent itself, which must be imported)
Template_FromDual.MySQL.server.xml (additional items related to Linux and database usage)
Template_FromDual.MySQL.process.xml (monitors various Linux processes [such as mysqld, ndbd])
Template_FromDual.MySQL.mysql.xml (monitor common MySQL status variables)
Template_FromDual.MySQL.innodb.xml (monitor InnoDB storage engine status variables)
Template_FromDual.MySQL.myisam.xml (monitor the status variable of the MyISAM storage engine)
Template_FromDual.MySQL.master.xml (monitor the Master status of MySQL Master-slave replication)
Template_FromDual.MySQL.slave.xml (monitor the Slave status of MySQL master-Slave replication)

Other MPM templates:
Template_FromDual.MySQL.ndb.xml (monitoring MySQL Cluster)
Template_FromDual.MySQL.galera.xml (monitoring MySQL Galera Cluster)
Template_FromDual.MySQL.pbxt.xml (monitor PBXT storage engine status variables)
Template_FromDual.MySQL.aria.xml (monitor the status variables of the Aria storage engine)
Template_FromDual.MySQL.drbd.xml (monitor the status of a DRBD device)

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.