Fix Unknown table engine ‘INNODB’ error on Munin

In newer MySQL versions, if you have InnoDB disabled, Munin will fail to run giving you the following error:

root@myserver [~]# munin-run mysql_connections
DBD::mysql::st execute failed: Unknown table engine 'INNODB' at /etc/munin/plugins/mysql_connections line 958.

This is caused because the error message is changing between versions and the mysql_ plugin for munin hasn’t been updated in order to recognize it.
The fix is pretty simple, just open /usr/share/munin/plugins/mysql_ with vim on line 958 (hint: vim +958 filename) and replace as bellow.

Original code

    if ($@) {
 	        if ($@ =~ /Cannot call SHOW INNODB STATUS because skip-innodb is defined/) {
 	            $data->{_innodb_disabled} = 1;
 	            return;
 	        }
 	        die $@;

Fixed code

    if ($@) {
 	        if ($@ =~ /Unknown table engine 'INNODB'|Unknown storage engine 'innodb'|Cannot call SHOW INNODB STATUS because skip-innodb is defined/i) {
 	            $data->{_innodb_disabled} = 1;
 	            return;
 	        }
 	        die $@;

Save the file and you’re good to go 🙂

Leave a Reply