Several schemes of munin monitoring MySQL database state

Source: Internet
Author: User
Tags install perl

Munin has the MySQL monitoring function, but it is not enabled. Try two ways to monitor MySQL.

First, install the Perl extensions for Munin MySQL

# yum Install Perl-cache-cache perl-ipc-sharelite perl-dbd-mysql

Second, create a MySQL user for monitoring


Mysql> CREATE USER munin@localhost identified by ' 123456 ';
Mysql> GRANT super,process on *.* to Munin@localhost;
mysql> FLUSH privileges;

Two, munin with the MySQL

1, establish munin MySQL plug-in soft connection
# ln-sf/usr/share/munin/plugins/mysql_*/etc/munin/plugins

2, create the configuration file


# vim/etc/munin/plugin-conf.d/mysql.conf//Add the following

Env.mysqlconnection dbi:mysql:mytest;host=localhost;port=3306
Env.mysqladmin/usr/bin/mysqladmin
Env.mysqluser Munin
Env.mysqlpassword 123456

3, see if Munin is supporting MySQL

# munin-node-configure |grep MySQL
Mysql_ | Yes |
Mysql_bytes | Yes |
Mysql_innodb | Yes |
Mysql_isam_space_ | Yes |
mysql_queries | Yes |
mysql_slowqueries | Yes |
Mysql_threads | Yes |

4, see Munin mysql configuration is correct

[Root@node1 plugin-conf.d]# munin-node-configure--suggest 2>&1 | grep MySQL
Mysql_ | Yes | Yes (+bin_relay_log +commands +connections +files_tables +
If the Perl module is missing, it will be no|no.
Then reboot the Munin and configure it. The point to note here is that Munin's own MySQL, there are not many things to monitor, and some of the functions do not come out of the picture.

Third, with the Third-party munin MySQL plugin (recommended)

1, download Address: Https://github.com/kjellm/munin-mysql

2, unpack, configure, and install


# Unzip Munin-mysql-master.zip
# CD Munin-mysql-master
# VIM Makefile//Modify installation files
Plugin_dir:=/usr/share/munin/plugins///Munin plugins path

# Vim mysql.conf//original Delete, add the following
Env.mysqlconnection dbi:mysql:mytest;host=localhost;port=3306
Env.mysqladmin/usr/bin/mysqladmin
Env.mysqluser Munin
Env.mysqlpassword 123456

# chmod +x Makefile//Add executable
# make install//installation command

After the installation is complete, the Munin is automatically restarted. With a third party munin MySQL plugin, monitor the function of many, and can generate pictures

Related Article

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.