First, install... On the client MariaDB and zabbix, Reference resources Last one

install fpmmm The main reference of the process [1].

  • install fpmmm Dependence
shell> yum install php-cli php-process php-mysqli
shell> cat << _EOF >/etc/php.d/fpmmm.ini
variables_order = "EGPCS"
date.timezone = 'Asia/Shanghai'
_EOF shell> rpm -Uvh http://repo.zabbix.com/zabbix/2.2/rhel/7/x86_64/zabbix-release-2.2-1.el7.noarch.rpm
shell> yum update
shell> yum install zabbix-sender
cd /opt
tar xf /tmp/fpmmm-0.10.5.tar.gz
ln -s fpmmm-0.10.5 fpmmm
  • config
mkdir /etc/fpmmm
cp /opt/fpmmm/tpl/fpmmm.conf.template /etc/fpmmm/fpmmm.conf
chown -R zabbix: /etc/fpmmm
  • vim /etc/fpmmm/fpmmm.conf
# This MUST match Hostname in Zabbix!
[machine01]
xxx # Here you could add a random name of your MySQL/MariaDB instance
[mysqld01] # This MUST match Hostname in Zabbix!
xxx
  • create monitoring user( Create a monitor in mysql Users of fpmmm)
MariaDB [(none)]> create user 'fpmmm'@'127.0.0.1' identified by 'your_password';
MariaDB [(none)]> grant process on *.* to 'fpmmm'@'127.0.0.1';
MariaDB [(none)]> grant replication client on *.* to 'fpmmm'@'127.0.0.1';
MariaDB [(none)]> grant select on mysql.user to 'fpmmm'@'127.0.0.1';

here , It's better to add replication slave jurisdiction

GRANT REPLICATION SLAVE ON *.* TO 'user_fpmmm'@'127.0.0.1';

This official website does not have , But if you don't, it will be in log It reminds you that you need , Mainly for show slave hosts.[3]

  • Adding the zabbix user to the mysql group

usermod -G mysql zabbix

  • test fpmmm.conf And look at log
$ /opt/fpmmm/bin/fpmmm --config=/etc/fpmmm/fpmmm.conf
1
$ cat /tmp/fpmmm/fpmmm.log
24634:2016-12-06 16:07:35.296 - ERR : Cannot read PID file /var/run/mysqld/mysqld.pid (rc=1476).
24634:2016-12-06 16:07:35.296 - ERR : Either file does not exist or I have no read permissions.
24634:2016-12-06 16:07:35.296 - ERR : Are you sure the process is running?
24634:2016-12-06 16:07:35.296 - ERR : Adding the zabbix user to the mysql group might help...
24634:2016-12-06 16:07:35.296 - ERR : Module FromDualMySQLprocess got an error (rc=1476).
24634:2016-12-06 16:07:35.414 - WARN: Binary Log is disabled. Module 'master' does not make sense for host mysqld... (rc=1308).
24634:2016-12-06 16:07:35.443 - WARN: Instance mysqld seems not to be a Slave. (rc=1577).
  • Remove ERR

    • modify pid route : PidFile = /var/lib/mysql/localhost.pid
    • open bin log
shell> vim /etc/my.cnf
[client]
... [mysqld]
...
log-bin=mysql-bin MariaDB [(none)]> show variables like 'log_bin%';
+---------------------------------+--------------------------------+
| Variable_name | Value |
+---------------------------------+--------------------------------+
| log_bin | ON |
| log_bin_basename | /var/lib/mysql/mysql-bin |
| log_bin_index | /var/lib/mysql/mysql-bin.index |
| log_bin_trust_function_creators | OFF |
+---------------------------------+--------------------------------+
  • Finally again test fpmmm.conf
$ /opt/fpmmm/bin/fpmmm --config=/etc/fpmmm/fpmmm.conf
1
$ cat /tmp/fpmmm/fpmmm.log // If there is an accident , Try to use root Run the command as
$ sudo -u root /opt/fpmmm/bin/fpmmm --config=/etc/fpmmm/fpmmm.conf
  • function

After the test is OK , modify zabbix Of agent The configuration file [2]

shell> vim /etc/zabbix/zabbix_agentd.conf
UserParameter=FromDual.MySQL.check,/opt/fpmmm/bin/fpmmm --config=/etc/fpmmm/fpmmm.conf
shell> systemctl restart zabbix-agent
  • hold fpmmm Import your own template into zabbix in

tpl The specific role of the document [4]

Template_FromDual.MySQL.mpm.xml ( monitor mpm agent In itself , This has to import )

Template_FromDual.MySQL.server.xml ( monitor Linux Additional items related to the use of database by the system )

Template_FromDual.MySQL.process.xml ( Monitor all kinds of Linux process [ such as :mysqld,ndbd])

Template_FromDual.MySQL.mysql.xml ( monitor MySQL Common state variables )

Template_FromDual.MySQL.innodb.xml ( monitor InnoDB Storage engine state variables )

Template_FromDual.MySQL.myisam.xml ( monitor MyISAM Storage engine state variables )

Template_FromDual.MySQL.master.xml ( monitor MySQL Master slave copied Master state )

Template_FromDual.MySQL.slave.xml ( monitor MySQL Master slave copied Slave state )

MPM Templates for other purposes :

Template_FromDual.MySQL.ndb.xml ( monitor MySQL Cluster)

Template_FromDual.MySQL.galera.xml ( monitor MySQL Galera Cluster)

Template_FromDual.MySQL.pbxt.xml ( monitor PBXT Storage engine state variables )

Template_FromDual.MySQL.aria.xml ( monitor Aria State variables of storage engine )

Template_FromDual.MySQL.drbd.xml ( monitor DRBD Device status information

  • stay zabbix The management interface creates two host

One of the monitoring machines (one for the machine): Import fpmmm and server These two templates

Another monitoring database (and one for the database): Import other templates

Be careful Agent interface For the current agent Of ip Address .

  • Timed operation fpmmm agent
shell> echo "UserParameter=FromDual.MySQL.check,/opt/fpmmm/bin/fpmmm --config=/etc/fpmmm/fpmmm.conf" > /etc/zabbix/zabbix_agentd.d/fpmmm.conf

Note that the above command can't run regularly , For use crontab Realization .

shell> vim /etc/crontab
* * * * * root echo "" >> /tmp/fpmmm/fpmmm.log & /opt/fpmmm/bin/fpmmm --config=/etc/fpmmm/fpmmm.conf >/dev/null
shell> tail /tmp/fpmmm/fpmmm.log 67721:2016-12-14 15:39:01.293 - INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) (0.10.5) run started.
67721:2016-12-14 15:39:02.587 - INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) run finished (rc=0). 68008:2016-12-14 15:40:01.650 - INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) (0.10.5) run started.
68008:2016-12-14 15:40:02.944 - INFO: FromDual Performance Monitor for MySQL and MariaDB (fpmmm) run finished (rc=0).
  • Don't use fpmmm How to monitor the running state of the database ?

see also Use zabbix2.2 Self contained mysql template, Set up and view mysql Monitoring situation

References

  1. FPMMM INSTALLATION GUIDE
  2. Zabbix coordination fpmmm(mpm) Realize to Mysql Comprehensive monitoring of
  3. http://www.cnblogs.com/zejin2008/p/5416441.html
  4. Zabbix+Mysql Fpmmm(MPM) monitor

How to use fpmmm and zabbix To monitor the client MariaDB More articles on database operation

  1. centos7 And zabbix monitor mysql(mariadb) database

    One .Zabbix3.2.6 Use your own template to monitor MySQL add to zabbix_agent Client method :http://www.cnblogs.com/lei0213/p/8858269.html mysql service ...

  2. Zabbix Server The built-in template monitor has a password MySQL database

    Zabbix Server The built-in template monitor has a password MySQL database author : Yin Zhengjie Copyright notice : Original works , Declined reprint ! Otherwise, the legal liability will be investigated .  One .Zabbix-agent End configuration 1>. Set the password for the database ...

  3. zabbix Add custom monitor

    zabbix Add custom monitor author:headsen  chen   2017-10-16  17:23:17 Personal originality , Please indicate the author of the reprint , Source , Otherwise, legal responsibility will be investigated in accordance with the law Host configuration : First, install it za ...

  4. 5、 ... and Zabbix Whole network monitoring

    The role of monitoring Our responsibilities    1. Ensure the security and reliability of enterprise data .   2. Provide customers with 7*24 Hourly service .   3. Continuously improve the user experience . At the critical moment , Remind us in advance that the server is going to have a problem. When there is a problem , It's easy to find the root of the problem ...

  5. zabbix Whole network monitoring

    Why monitor O & M responsibilities 1. Ensure the security and reliability of enterprise data .2. Provide customers with 7*24 Hourly service .3. Continuously improve the user experience . At the critical moment , Remind us in advance that there is something wrong with the server When something goes wrong , It's easy to find the root of the problem Get the company service ...

  6. Zabbix Custom monitoring 8080 Number of connections on Port

    Zabbix Custom monitoring 8080 Number of connections on Port One zabbix Custom monitoring implementation ideas In fact, if we want to use zabbix The principle of monitoring some services is simple , The steps are :1. Write a script to get some status information of the service to be monitored 2. ...

  7. be based on Zabbix IPMI Monitor server hardware status

    be based on Zabbix IPMI Monitor server hardware status zabbix ipmi The company has many branches , And there is no professional duty in the computer room , The computer room level is not enough . under these circumstances , I want to monitor the computer room environment in real time , So using IPMI The way to get there . Because before has ...

  8. LNMP+zabbix Distributed monitoring build and version upgrade

    LNMP+zabbix Distributed monitoring architecture needs components :gcc gcc-c++ openssl* pcre pcre-devel gd gd-devel libjpeg-devel libpng-devel l ...

  9. zabbix Server monitoring suse System tutorial

    zabbix Server monitoring suse System tutorial author : Yin Zhengjie Copyright notice : Original works , Declined reprint ! Otherwise, the legal liability will be investigated . It took nearly a week to learn how to monitor window and linux Basic information and quotation of the host computer ( I've taken notes ...

Random recommendation

  1. JS introduction

    1,undefined,NaN,Null,infinity 1) undefined yes undefined type var a; // Do not assign values after declaring variables typeof Type judgment method console.log ...

  2. Windows Azure Service Bus (3) queue (Queue) Use VS2013 Development Service Bus Queue

    <Windows Azure Platform List of articles > Prior to Azure Service Bus in , We've already introduced it Service Bus queue (Queue) Basic concepts of . In this chapter ...

  3. this From all aspects

    http://www.cnblogs.com/Wayou/p/all-this.html <JavaScript The essence of language > overall situation this In the global environment of the browser host , function f(x ...

  4. What is? S-OFF, What is? S-ON,HBOOT command , Get along well with Android

    What is? S-OFF?S representative Security Lock, It's a safety lock , Protection lock means .S-OFF It's security ,S-ON It's security on .Secure Lock It's the safety lock . It is used by hardware designers to protect firmware from being swiped ...

  5. WPF Lay out in the canvas N That's ok N Column implementation

    Write one recently WPF project , In the middle, there is a problem of arranging in the canvas ( An algorithm for arranging rows and columns in order ). My logic is a little poor , It took a lot of effort to achieve , There's nothing to be bullied about , Just take it out and share it , Save time for those who need it , If it's useful, don't forget to praise it ...

  6. turn :android git List of open source projects

    1. The collection of Zhihu shows https://www.zhihu.com/question/19804692 2. http://p.codekk.com/

  7. Native APP And mobile Web App Comparison

    China's mobile Internet users have surpassed 4.5 Billion , More than 3.8 Billion , The output value of China's mobile Internet market has exceeded 712.5 One hundred million yuan , Mobile marketing is an inevitable trend in the future , and App It is a powerful marketing tool under this trend : App There are two main directions : Native A ...

  8. Light OJ 1036 - A Refining Company

    The main idea of the topic : One m*n Matrix , There are two minerals, uranium and radium , Now we need to transport uranium and radium to the designated location . To the north is the radium refinery , To the west is the uranium refinery . Now we're going to build the conveyor belt , There are two types of conveyor belt , One is from east to west , The other is from south to north , Conveyor belts can't cross , and ...

  9. _00013 Consistent hash algorithm Consistent Hashing New discussion , And there are corresponding solutions

    I blog : You have a smile on your face Blog address :http://blog.csdn.net/u012185296 Individuality signature : The furthest distance in the world is not the end of the earth , It's not Cape , It's me standing in front of you . You don't feel me Technical direction : ...

  10. CSS3—— Complex selector

    Today, I'm going to show you CSS3 I'm done with the complex selector section , Let's sort out what we have learned . 1. Brother selector : Same location level , It can be called the brotherhood element a. Adjacent Sibling Selectors :next Keep up with [ After the current element ]( One ), Specifies the element of the selector   ...