Page 1 of 2
Issues installing CPAN module
Posted: Wed May 04, 2016 11:28 am
by bosecorp
I have successfully installed the oracle plugin in our development server, and when i was trying to install the same on our production server i got a error while installing the perl module
I'm following the doc
https://assets.nagios.com/downloads/nag ... 1458764679
below is the error.
# cpan -i DBD::Oracle
Error while requiring CPAN::Config:
CPAN/Config.pm did not return a true value at /usr/share/perl5/CPAN/HandleConfig.pm line 485.
I tried comparing the file (HandleConfig.pm) from dev and prod server and the line 485 is identical.
# uname -a
Linux nagmonus1 2.6.32-431.5.1.el6.x86_64 #1 SMP Fri Jan 10 14:46:43 EST 2014 x86_64 x86_64 x86_64 GNU/Linux
Re: Issues installing CPAN module
Posted: Wed May 04, 2016 1:32 pm
by tgriep
Lets try and reinstall cpan and see if that fixes the issue. Login as root in the Xi server and
Enter “perl -MCPAN -e shell” to start the CPAN module.
Type “o conf init” into the prompt. This will start the CPAN perl module configuration utility.
Enter "yes" when prompted as you run through the configuration utility.
Type "exit" and press "Enter" to leave the CPAN module.
If everything works, try reinstalling the DBD::Oracle module.
Re: Issues installing CPAN module
Posted: Wed May 04, 2016 3:03 pm
by bosecorp
# perl -MCPAN -e shell
Error while requiring CPAN::Config:
CPAN/Config.pm did not return a true value at /usr/share/perl5/CPAN/HandleConfig.pm line 485.
Getting same error.
Re: Issues installing CPAN module
Posted: Wed May 04, 2016 3:44 pm
by tgriep
Lets try and reinstall CPAN using yum.
Run this as root on your Nagios server to do so.
Re: Issues installing CPAN module
Posted: Wed May 04, 2016 3:47 pm
by bosecorp
Still same issue..
# yum reinstall perl-CPAN -y
Loaded plugins: refresh-packagekit, rhnplugin
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Reinstall Process
Bose-prod-rhel-x86_64-server-6 | 1.5 kB 00:00
UBS-KITS-UBSLNX | 2.9 kB 00:00
bose-prod-rhel-x86_64-6-epel | 1.5 kB 00:00
epel/metalink | 10 kB 00:00
nagios-base | 1.5 kB 00:00
nagiosxi-deps | 1.5 kB 00:00
rpmforge | 1.9 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package perl-CPAN.x86_64 0:1.9402-136.el6_6.1 will be reinstalled
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Reinstalling:
perl-CPAN x86_64 1.9402-136.el6_6.1 Bose-prod-rhel-x86_64-server-6 246 k
Transaction Summary
=====================================================================================================================================================================================================
Reinstall 1 Package(s)
Total download size: 246 k
Installed size: 671 k
Downloading Packages:
perl-CPAN-1.9402-136.el6_6.1.x86_64.rpm | 246 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : perl-CPAN-1.9402-136.el6_6.1.x86_64 1/1
Verifying : perl-CPAN-1.9402-136.el6_6.1.x86_64 1/1
Installed:
perl-CPAN.x86_64 0:1.9402-136.el6_6.1
Complete!
root@nagmonus1:(05-04 16:02): /root
# cpan
Error while requiring CPAN::Config:
CPAN/Config.pm did not return a true value at /usr/share/perl5/CPAN/HandleConfig.pm line 485.
root@nagmonus1:(05-04 16:02): /root
# perl -MCPAN -e shell
Error while requiring CPAN::Config:
CPAN/Config.pm did not return a true value at /usr/share/perl5/CPAN/HandleConfig.pm line 485.
Re: Issues installing CPAN module
Posted: Wed May 04, 2016 3:54 pm
by bosecorp
How do i verify if the perl-modules DBI and DBD::Oracle are installed?
Is there any other method?
# rpm -qa| grep -i dbi
perl-DBI-1.609-4.el6.x86_64
perl-DBIx-Simple-1.32-3.el6.noarch
# rpm -qa| grep -i dbd
perl-DBD-MySQL-4.013-3.el6.x86_64
perl-DBD-SQLite-1.27-3.el6.x86_64
Re: Issues installing CPAN module
Posted: Wed May 04, 2016 4:23 pm
by tgriep
I think the Oracle Instant Client is suppose to install the DBD::Oracle module and as far as I know, you can check it through cpan but yours is erroring out.
What version of the Oracle Instant Client did you install?
If you installed 12.1, try removing that and installing 11.2. I have heard some reports that 12.1 has issues.
Can you run the following on your server and post the output?
Code: Select all
ls -l /usr/local/share/perl5/CPAN/
find / -name MyConfig.pm
Re: Issues installing CPAN module
Posted: Thu May 05, 2016 2:51 pm
by bosecorp
I did not saw this issue on the dev server.
I have installed 12.1 oracle client installed.
# rpm -qa| grep -i oracle
oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64
oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64
oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64
Also when i compared the dev and the prod server, i found that the production server does not have /root/.cpan directory
It has /root/.cpanm instead.
Re: Issues installing CPAN module
Posted: Thu May 05, 2016 3:12 pm
by tgriep
I think the issue is that if cpan finds a file called MyConfig.pm, it uses the configuration settings in that file and they are corrupted somehow.
That is what the find command is for in my earlier post, to find the MyConfig.pm file.
If you move the .cpanm folder out of the /root/ folder, does that fix it for you?
Re: Issues installing CPAN module
Posted: Thu May 05, 2016 3:13 pm
by bosecorp
On my prod server i do have the cpan module installed
# rpm -qa| grep -i cpan
perl-CPAN-1.9402-136.el6_6.1.x86_64
perl-Parse-CPAN-Meta-1.40-136.el6_6.1.x86_64
perl-CPANPLUS-0.88-136.el6_6.1.x86_64