Jan 022008

If you install Nagmin module (2.1) for Webmin with MySQL 4.0 or later, you may end up with the error

Error – Perl execution failed

Can’t use an undefined value as a HASH reference at /usr/lib/perl5/DBD/mysql.pm line 115

This can be fixed by one of the two following ways:

1. Upgrade to Nagmin 2.2 module to fix the problem

To upgrade, first make a backup of the /usr/local/nagmin directory:

# mv  /usr/local/nagmin /usr/local/nagmin_bkp

Now, download Nagmin-2.2.0 from


untar the  nagmin-2.2.0.tar.gz

# tar -zxvf  nagmin-2.2.0.tar.gz

Move the directory nagmin-2.2.0 and to /usr/local/nagmin directory

# mv nagmin-2.2.0 /usr/local/ nagmin

Launch the webmin to add the nagmin as a webmin module.

Launch http://<IP or HOSTNAME>:10000 to launch webmin

Login as the admin user.

Click Webmin Configuration.

Click Webmin modules.

Select “from local file” option and and type the location as


and click Install.

This should install the updated Nagmin module (2.2.0) and allow a link to launch Nagmin. Alternatively, click Servers then select “Nagmin Nagios Monitoring”

2. Edit the file /usr/lib/perl5/DBD/mysql.pm

and add the line

$attrhash ||= {};

 just in a new line next to the following:

# Avoid warnings for undefined values

$username ||= ”;

$password ||= ”;

                             <— Add here

So it looks like,

# Avoid warnings for undefined values

$username ||= ”;

$password ||= ”;

$attrhash ||= {};

This should fix the problem.

For more information, check the following MySQL BUG 17323 for more information:


 Posted by at 2:10 pm

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>