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_
Next, create a new user in mysql:
mysql> CREATE USER firstname.lastname@example.org IDENTIFIED BY '5uperS3cr3tPassw0rd';
mysql> GRANT SUPER,PROCESS ON *.* TO email@example.com;
mysql> GRANT SELECT ON mysql.* TO firstname.lastname@example.org;
mysql> FLUSH PRIVILEGES;
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
telnet localhost 4949
Connected to localhost.
Escape character is '^]'.
# munin node at localhost
Connection closed by foreign host.
I was getting errors mentioning “# Bad exit” while using telnet; running
munin-run showed the actual error messages.