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
http://downloads.sourceforge.net/nagmin/nagmin-2.2.0.tar.gz?modtime=1083196800&big_mirror=0
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
/usr/local/nagmin/nagmin-2.2.0.wbm
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: