Setting up the mysql_ Plugin in Munin

After spending a few days trying to get the mysql_ plugin working in my munin installation, I’ve decided to write up the process. It include some pointers about troubleshooting and diagnosing problems with the plugin.

Once you have munin and mysql working:

# Save this to /etc/munin/plugin-conf.d/mysql_
[mysql_*]
env.mysqlconnection DBI:mysql:mysql;host=127.0.0.1;port=3306
env.mysqluser munin
env.mysqlpassword 5uperS3cr3tPassw0rd

You may need to install some perl dependencies:

yum install -y perl-Cache-Cache

Now, test that your new user is able to connect to the db thorough munin. You should not see any mysql errors printed here.

munin-node-configure –suggest 2>&1 | grep mysql

Next, install the suggested mysql plugins:

(munin-node-configure –shell 2>&1 | grep mysql | /bin/bash); service munin-node restart

Finally, you can confirm that the plugin is setup and working properly by testing it by running munin-run and telnet:

munin-run mysql_connections
max_connections.value 151
Max_used_connections.value 3
Aborted_clients.value 2
Aborted_connects.value 1
Threads_connected.value 3
Connections.value 36
telnet localhost 4949
Trying 1.2.3.4…
Connected to localhost.
Escape character is ‘^]’.
# munin node at localhost
fetch mysql_connections
max_connections.value 151
Max_used_connections.value 3
Aborted_clients.value 2
Aborted_connects.value 1
Threads_connected.value 3
Connections.value 38
quit
Connection closed by foreign host.

Src: http://alexcline.net/2013/07/12/setting-up-the-mysql_-plugin-in-munin/

Share

Leave a Reply