Munin is a monitoring tool used to monitor the performance of computers/servers, networks, SANs, applications, databases, weather measurements and other parameters. Munin remembers and records information it captured and presents them in graphs through a web interface. On cPanel/WHM server, you can easily install it from plugin section.
After successful installation, Munin will start colleting required data and will show you the graphs, including MySQL nodes such as MySQL throughputs, MySQL queries, MySQL Slow Queries, and MySQL threads. However, if you restart the server, Munin will fail to monitor MySQL nodes and it will stop showing graphs for MySQL.
The error is due to a bug in a Perl library Munin uses which causes $PATH variable to be lost, and then causes the plugin cannot find the mysqladmin program which it needs to retrieve the numbers to populate in the graphs. Uninstall and reinstall Munin Service Monitor may make it works again, however, a more permanent solution is to hardcode the path of the program, which will fix the problem. Following is the guideline to specify the path to mysqladmin to Munin.
Fix for Munin installed by cPanel/WHM
1. Find the path where mysqladmin is installed using one of the following commands:
The above command will return a path to mysqladmin (i.e. /usr/bin/mysqladmin)
2. Edit Munin configuration file /etc/munin/plugin-conf.d/cpanel.conf and modify the [mysql*] as below:
Ensure the env.mysqladmin value is path returned by step 1. Also ensure that /root/.my.cnf contains correct MySQL root password.
3. Restart Munin service:
4. Wait a while for MySQL statistics to be gathered, and check the graphs again.
Fix for the host or server without cPanel Control Panel:
Simply add the “env.mysqladmin /usr/bin/mysqladmin” (ensure that the path is correct according to your system) to the /etc/munin/plugin-conf.d/munin-node file will do the trick.