Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to monitor MySQL with Zabbix

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to use Zabbix to monitor MySQL, the things involved, learned from the theoretical knowledge, there are many books and documents for your reference, from the perspective of practical significance, accumulated years of practical experience can be shared with you.

Monitoring ideas:

First configure the information of the MySQL CVM on the zabbix host, add the Template App MySQL template that comes with zabbix, then install agent on the mysql CVM, and then add the mysql monitoring script.

Host role:

192.168.1.244 Zabbix Server3.0.5

192.168.1.221 Zabbix Agent3.0.5

1. Set up Zabbix Server (skip it, proxy will not consider it)

2. Set up zabbix agent (skip)

3. Zabbix agent build MySQL (skip) and add MySQL template.

4. To monitor the host, skip selecting a template.

5. Zabbix agent configuration.

Database authorizes zabbix users (root users can also)

Grant all on *. * to zabbix@'localhost' identified by 'zabbix123'

Grant all on *. * to zabbix@'127.0.0.1' identified by 'zabbix123'

# grant all on *. * to zabbix@'192.168.1.244' identified by 'zabbix123'

Flush privileges

6. Create the permissions file for the .MySQL database.

Cd/usr/local/zabbix-3.0.5/etccat .my.cnf # zabbix Agent[mysql] host=localhostuser=zabbixpassword=zabbix123socket=/tmp/ mysql.sock[mysqladmin] host=localhostuser=zabbixpassword=zabbix123socket=/tmp/mysql.sock

7. Custom monitoring MySQL template configuration. (the template is placed on Github)

Cd/ root/zabbix-3.0.5/conf/zabbix_agentdcp userparameter_mysql.conf/usr/local/zabbix-3.0.5/etc/zabbix_agentd.conf.d/cd/usr/local/zabbix-3.0.5/etc/zabbix_agentd.conf.d/sed-ispur scuttle userparameter_mysql.conf varqqqam lib Uniqr ZabixUnix Universe usrUnix ZabixMub 3.0.5

Some configurations are modified in it, and the files are used specifically. Note that the path is the Zabbix installation path.

8. Modify zabbix_agentd.conf configuration file.

Vim zabbix_agentd.confInclude=/usr/local/zabbix-3.0.5/etc/zabbix_agentd.conf.d/#cd/usr/local/zabbix-3.0.5/#mkdir shell

8.1) restart the service (check the log)

/ etc/init.d/zabbix_agentd restart

9. View monitoring

10. Custom monitoring key (Github has relevant instructions and templates)

Use zabbix's custom key, combined with shell scripts, to monitor the values you want to monitor.

Read the above introduction of how to monitor MySQL with Zabbix, hoping to bring some help to everyone in practical application. Due to the limited space in this article, there will inevitably be deficiencies and areas that need to be supplemented. You can continue to pay attention to the industry information section and will update your industry news and knowledge regularly. If you need more professional answers, you can contact us on the official website for 24-hour pre-sales and after-sales to help you answer questions at any time.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report