Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Linux Perl Error

Posted on 2012-03-20
4
Medium Priority
?
1,823 Views
Last Modified: 2012-06-27
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....
0
Comment
Question by:c3very
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 21

Expert Comment

by:Papertrip
ID: 37745011
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).
0
 
LVL 2

Author Comment

by:c3very
ID: 37745053
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

0
 
LVL 21

Accepted Solution

by:
Papertrip earned 2000 total points
ID: 37745078
Don't bother with Config::Tiny unless your script fails due to it not being there.  If that happens then just yum install perl-Config-Tiny

Does your script work now?
0
 
LVL 2

Author Closing Comment

by:c3very
ID: 37745142
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.
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question