zabbix of centos7 monitors mysql (mariadb) database

1. Zabbix 3.2.6 uses its own template to monitor MySQL

 Add zabbix_agent client method: http://www.cnblogs.com/lei0213/p/8858269.html

mysql server side configuration

1. Need to know:

  1. If you want to monitor the mysql or mariadb database, you must first ensure the normal operation of the server, so you need to monitor the linux server first. If you add linux monitoring, you can check my previous blog post.

2. The database requires authorization.

mysql>GRANT USAGE ON *.* TO 'zabbix'@'localhost' IDENTIFIED BY 'zabbix';

3. Configure userparameter_mysql.conf (you need to download the zabbix client installation package here, in fact, the server installation can be)

cd zabbix-3.2.6/conf/zabbix_agentd/
cp userparameter_mysql.conf /etc/zabbix/zabbix_agentd.conf.d/

4. Add the configuration file my.cnf used to associate mysql, and modify the mysql path in the template configuration file

cd /etc/zabbix/
vim .my.cnf

5. Add or change the following passwords in the mysql configuration file my.cnf

  #user=zabbixAuthorized user

  #password=zabbix authorized user password

  #soket=soket storage location, absolute path

[mysql]
host=localhost
user=zabbix
password=zabbix
socket=/var/lib/mysql/mysql.sock
[mysqladmin]
host=localhost
user=zabbix
password=zabbix
socket=/var/lib/mysql/mysql.sock

  After the addition is complete, restart the mysql database server to see if it can be used normally.

4. Modify userparameter_mysql.conf

  Change /var/lib/zabbix in the /etc/zabbix/zabbix_agentd.conf.d/userparameter_mysql.conf configuration file to /etc/zabbix

sed -i 's@/var/lib/zabbix@/etc/zabbix@g' /etc/zabbix/zabbix_agentd.conf.d/userparameter_mysql.conf

5. Modify the zabbix_agentd.conf file and add the following line

Include=/etc/zabbix/zabbix_agentd.conf.d/*.conf

6. Restart mysql and agentd services

zabix-server configuration

  Note that I am monitoring by proxy here

1. Create a mysql monitoring group

  

 

2. Add monitoring host

 

3. Add monitoring template

4. View

 

 

Reference and: http://blog.51cto.com/wzlinux/1944741

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324972661&siteId=291194637