Click to See Complete Forum and Search --> : Perl crashing on DBI call


singlespeed
10-10-2005, 10:22 AM
hello all,

Just had to rebuild a server here and while getting nagios back up and running I've run into a perl problem with one of my nagios plugins scripts.

the perl script that has the problem basically just reads info out of a MySQL db and processes it.

I'm sure I'm missing some software, but not sure what. :confused:

This script ran fine before the server crashed and I had to rebuild.

the offending line (28) in the script is:

my $dbh = DBI->connect( "dbi:mysql:telaurus:127.0.0.1", "user", "pass" ) or die "nope\n";

Error message when the script is run:

install_driver(mysql) failed: Can't load '/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.10: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at ./check_avg_traffic line 28

Perl software currently installed:

[root@MIS02TC07927 libexec]# rpm -qa | grep perl
perl-Parse-Yapp-1.05-30
perl-XML-Grove-0.46alpha-25
perl-DBD-MySQL-2.1021-3
perl-XML-Dumper-0.4-25
perl-Digest-HMAC-1.01-11.1
perl-HTML-Tagset-3.03-28
perl-libwww-perl-5.65-6
perl-XML-Encoding-1.01-23
newt-perl-1.08-4
perl-Digest-SHA1-2.01-15.1
perl-DBI-1.32-9
perl-HTML-Parser-3.26-17
perl-XML-Parser-2.31-15
perl-libxml-enno-1.02-29
mod_perl-1.99_09-10.ent
perl-Time-HiRes-1.38-3
perl-5.8.0-89.10
perl-libxml-perl-0.07-28
perl-SGMLSpm-1.03ii-11
perl-Net-DNS-0.31-3.1
perl-CPAN-1.61-89.10
perl-Filter-1.29-3
perl-URI-1.21-7
perl-XML-Twig-3.09-3
perl-CGI-2.81-89.10
perl-DateManip-5.42a-0.rhel3

Thanks!

jeff

flukshun
10-10-2005, 04:25 PM
is MySQL installed?

looks like it's missing this: libmysqlclient.so.10

singlespeed
10-10-2005, 06:01 PM
yes, MySQL is installed and running.

what part of MySQL (server, client, shared etc) is libmysqlclient.so.10 from?

bwkaz
10-10-2005, 06:32 PM
Based on the name, it would probably be from the "-client" part of mysql... ;)

Also try:

ldd /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mysql.so

and see whether it says anything about a missing library.

singlespeed
10-12-2005, 08:38 AM
MySQL-client is installed.

[root@MIS02TC07927 scripts]# ldd /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mysql.so
libmysqlclient.so.10 => not found
libz.so.1 => /usr/lib/libz.so.1 (0x00fd5000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x00278000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00143000)
libm.so.6 => /lib/tls/libm.so.6 (0x00c04000)
libc.so.6 => /lib/tls/libc.so.6 (0x00a61000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00c39000)

[root@MIS02TC07927 scripts]# rpm -qa | grep My
perl-DBD-MySQL-2.1021-3
MySQL-devel-standard-4.1.13-0.rhel3
MySQL-server-standard-4.1.13-0.rhel3
MySQL-shared-standard-4.1.13-0.rhel3
MySQL-client-standard-4.1.13-0.rhel3

the problem was MySQL-client-standard-4.1.13-0.rhel3, I needed MySQL-shared-compat-4.1.13-0 for backwards compatability.