How to Install and Configure MySQL Plugin in Munin

If you want to monitor your MySQL server this article will help you a lot.

In this article I will show how you can install and configure MySQL Plugin in Munin.

Install and Configure MySQL Plugin in Munin

Follow the below link to install and configure MySQL Plugin.

1. Install munin-node via epel repository.

# yum install munin-node

2. Install perl-Cache-Cache.

# yum install perl-Cache-Cache

3. Now create softlink as shown below:

[root@localhost plugins]# ln -s /usr/share/munin/plugins/mysql_slowqueries  /etc/munin/plugins/mysql_slowqueries

[root@localhost plugins]# ln -s /usr/share/munin/plugins/mysql_threads /etc/munin/plugins/mysql_threads

[root@localhost plugins]# ln -s /usr/share/munin/plugins/mysql_queries /etc/munin/plugins/mysql_queries

[root@localhost plugins]# ln -s /usr/share/munin/plugins/mysql_bytes /etc/munin/plugins/mysql_bytes

[root@localhost plugins]# ln -s /usr/share/munin/plugins/mysql_innodb /etc/munin/plugins/mysql_innodb

4. Create a file “/etc/munin/plugin-conf.d/mysql” with below contents.

# /etc/munin/plugin-conf.d/mysql

env.mysqluser munin
env.mysqlpassword munin-password-here

5. Create mysql user and assign corresponding privileges.

mysql> create user munin@localhost identified by 'munin-password-here';
mysql> GRANT PROCESS, SUPER ON *.* TO 'munin'@'localhost';
mysql> GRANT SELECT ON `mysql`.* TO 'munin'@'localhost';
mysql> flush privileges;

6. Restart munin-node.

[root@localhost plugins]# /etc/init.d/munin-node restart
Stopping Munin Node agents: [ OK ]
Starting Munin Node: [ OK ]

7. Check the suggestions and install the plugins.

munin-node-configure  --suggest 2>/dev/null |grep mysql
munin-node-configure  --shell | grep mysql | sh

8. Testing.

# cd /etc/munin/plugins 

You will get some output like below:

# munin-run mysql_queries
delete.value 90606
insert.value 1676603
replace.value 0
select.value 226947405
update.value 1342158
cache_hits.value 350481266
Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website To become an author at LookLinux Submit Article. Stay connected to Facebook.

About the author


Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

1 Comment

  • Some questions about the article.

    Does this monitor the munin server itself or other MySQL server?

    Does this need to be installed on the munin server or maybe just in the client?

Leave a Comment