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