{"id":2039,"date":"2013-01-27T09:41:16","date_gmt":"2013-01-27T13:41:16","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=2039"},"modified":"2013-03-20T08:38:21","modified_gmt":"2013-03-20T12:38:21","slug":"munin-unable-to-generate-mysql-stats","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/munin-unable-to-generate-mysql-stats","title":{"rendered":"Munin Unable to Generate Mysql Stats"},"content":{"rendered":"<p>Munin plugin is known to have issues while generating Mysql graphs. The mysql graph remains empty due to a bug in the Perl library that causes the path to the mysqladmin to be lost.<\/p>\n<p>The solution is to specify the path to mysqladmin in the \/etc\/munin\/plugin-conf.d\/cpanel.conf file. Edit the file<\/p>\n<blockquote>\n<pre># nano \/etc\/munin\/plugin-conf.d\/cpanel.conf<\/pre>\n<\/blockquote>\n<p>and add the below line in the [mysql*] section<\/p>\n<blockquote>\n<pre>env.mysqladmin \/usr\/bin\/mysqladmin<\/pre>\n<\/blockquote>\n<p>The mysql section should look like follows<\/p>\n<blockquote>\n<pre>[mysql*]\r\nuser root\r\ngroup wheel\r\nenv.mysqladmin \/usr\/bin\/mysqladmin<\/pre>\n<\/blockquote>\n<p>Restart the munin-node\u00a0 service and see if it works. If it doesn&#8217;t, it indicates munin cannot read the values of mysql variables i.e. the username\/password of mysql.<\/p>\n<p>In such a case, have munin read the Mysql password from the .my.cnf file directly which is residing under the \/root directory. To achieve this, create a file say, \/root\/mysqlpass<\/p>\n<blockquote>\n<pre># nano \/root\/mysqlpass<\/pre>\n<\/blockquote>\n<p>and add the following command<\/p>\n<blockquote>\n<pre>\/usr\/bin\/mysqladmin -uroot -p`cat \/root\/.my.cnf | grep pass \\\r\n| sed s\/pass\/\/ | sed s\/=\/\/ | sed s\/\\\"\/\/g` $@<\/pre>\n<\/blockquote>\n<p>The sed command may look confusing but it just removes words and characters around the password.<\/p>\n<p>Set executable permission on the file<\/p>\n<blockquote>\n<pre># chmod 755 \/root\/mysqlpass<\/pre>\n<\/blockquote>\n<p>Now edit the \/etc\/munin\/plugin-conf.d\/cpanel.conf file again and replace<\/p>\n<blockquote>\n<pre>env.mysqladmin \/usr\/bin\/mysqladmin<\/pre>\n<\/blockquote>\n<p>with<\/p>\n<blockquote>\n<pre>env.mysqladmin \/root\/mysqlpass<\/pre>\n<\/blockquote>\n<p>Once done, restart the munin-node service and munin will start generating the Mysql graphs<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Munin plugin is known to have issues while generating Mysql graphs. The mysql graph remains empty due to a bug in the Perl library that causes the path to the mysqladmin to be lost.<br \/>\nThe solution is to specify the path to mysqladmin in the \/etc\/munin\/plugin-conf.d\/cpanel.conf file. Edit the file<\/p>\n<p># nano \/etc\/munin\/plugin-conf.d\/cpanel.conf<\/p>\n<p>and add the below line in the [mysql*] section<\/p>\n<p>env.mysqladmin \/usr\/bin\/mysqladmin<\/p>\n<p>The mysql section should look like follows<\/p>\n<p>[mysql*]<br \/>\nuser root<br \/>\ngroup wheel<br \/>\nenv.mysqladmin \/usr\/bin\/mysqladmin<\/p>\n<p>Restart the munin-node\u00a0 service and see if it works. If it doesn&#8217;t, it indicates munin cannot read the values of [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1456,1458,1455,1457,1454],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/2039"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=2039"}],"version-history":[{"count":7,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/2039\/revisions"}],"predecessor-version":[{"id":2045,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/2039\/revisions\/2045"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=2039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=2039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=2039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}