Link to home
Start Free TrialLog in
Avatar of c3very
c3veryFlag for United States of America

asked on

Linux Perl Error

I'm trying to install a nagios plugin but i'm getting an error within CPAN.
[root@Opsview libexec]# ./check_vmware_esxi.pl 
Can't locate Try/Tiny.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/lib/perl5/site_perl/5.8.8/Module/Implementation.pm line 10.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/Module/Implementation.pm line 10.
Compilation failed in require at /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Params/Validate.pm line 12.
BEGIN failed--compilation aborted at /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Params/Validate.pm line 12.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Nagios/Plugin/Functions.pm line 11.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Nagios/Plugin/Functions.pm line 11.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Nagios/Plugin.pm line 4.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Nagios/Plugin.pm line 4.
Compilation failed in require at ./check_vmware_esxi.pl line 33.
BEGIN failed--compilation aborted at ./check_vmware_esxi.pl line 33.

Open in new window

So then i try and install the Tiny.pm
cpan[1]> install Config::Tiny
Reading '/root/.cpan/Metadata'
  Database was generated on Tue, 20 Mar 2012 06:17:46 GMT
Running install for module 'Config::Tiny'
Running make for A/AD/ADAMK/Config-Tiny-2.14.tar.gz
Fetching with LWP:
http://cpan.knowledgematters.net/authors/id/A/AD/ADAMK/Config-Tiny-2.14.tar.gz
CPAN::LWP::UserAgent->new dies with Can't locate HTTP/Config.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 /usr/local/nagios/libexec) at /usr/lib/perl5/site_perl/5.8.8/LWP/UserAgent.pm line 770.

Catching error: "Can't call method \"mirror\" on an undefined value at /usr/lib/perl5/5.8.8/CPAN/FTP.pm line 633.\cJ" at /usr/lib/perl5/5.8.8/CPAN.pm line 392
	CPAN::shell() called at -e line 1

Open in new window

Not sure what to do next....
Avatar of Papertrip
Papertrip
Flag of United States of America image

Are you running a distro with yum setup?  If you do and have the rpmforge repo, just type
yum install perl-Try-Tiny

Open in new window


FYI Config::Tiny is a different module than what the error is saying.

[root@broken ~]# yum info perl-Try-Tiny
Loaded plugins: fastestmirror, presto, priorities
Loading mirror speeds from cached hostfile
 * base: mirrors.kernel.org
 * epel: mirrors.kernel.org
 * extras: mirrors.cat.pdx.edu
 * rpmforge: apt.sw.be
 * updates: ftp.osuosl.org
85 packages excluded due to repository priority protections
Available Packages
Name        : perl-Try-Tiny
Arch        : noarch
Version     : 0.09
Release     : 1.el6.rf
Size        : 18 k
Repo        : rpmforge
Summary     : minimal try/catch with proper localization of $@
URL         : http://search.cpan.org/dist/Try-Tiny/
License     : Artistic/GPL
Description : This module provides bare bones try/catch statements that are designed to
            : minimize common mistakes with eval blocks, and NOTHING else.
            :
            : This is unlike TryCatch which provides a nice syntax and avoids adding another
            : call stack layer, and supports calling return from the try block to return from
            : the parent subroutine. These extra features come at a cost of a few
            : dependencies, namely Devel::Declare and Scope::Upper which are occasionally
            : problematic, and the additional catch filtering uses Moose type constraints
            : which may not be desirable either.
            :
            : The main focus of this module is to provide simple and reliable error handling
            : for those having a hard time installing TryCatch, but who still want to write
            : correct eval blocks without 5 lines of boilerplate each time.
            :
            : It's designed to work as correctly as possible in light of the various
            : pathological edge cases (see BACKGROUND) and to be compatible with any style of
            : error values (simple strings, references, objects, overloaded objects, etc).
Avatar of c3very

ASKER

i do have yum setup.

[root@Opsview ~]# yum install perl-Try-Tiny
.......
Running Transaction
  Installing     : perl-Try-Tiny                                                                                                  1/1 

Installed:
  perl-Try-Tiny.noarch 0:0.09-1.el5.rf                                                                                                

Complete!

Open in new window


I don't know if this is necessary but i went back into CPAN to install Config::Tiny but i still get an error.
cpan[1]> install Config::Tiny
Reading '/root/.cpan/Metadata'
  Database was generated on Tue, 20 Mar 2012 06:17:46 GMT
Running install for module 'Config::Tiny'
Running make for A/AD/ADAMK/Config-Tiny-2.14.tar.gz
Fetching with LWP:
http://cpan.knowledgematters.net/authors/id/A/AD/ADAMK/Config-Tiny-2.14.tar.gz
CPAN::LWP::UserAgent->new dies with Can't locate HTTP/Config.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 /root) at /usr/lib/perl5/site_perl/5.8.8/LWP/UserAgent.pm line 770.

Catching error: "Can't call method \"mirror\" on an undefined value at /usr/lib/perl5/5.8.8/CPAN/FTP.pm line 633.\cJ" at /usr/lib/perl5/5.8.8/CPAN.pm line 392
	CPAN::shell() called at -e line 1

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Papertrip
Papertrip
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of c3very

ASKER

Ok, that seemed to work.  Just running the script without an arguments returns the correct response.  I'll have to open another question to troubleshoot the error i'm getting with args.