Can't locate Net/SNMP.pm in @INC When Running check_ifstatus

frank ratty at they.org
Mon May 18 23:08:59 CEST 2009


# yum install perl-Net-SNMP

CPAN can sometimes be useful, but if you're on an RPM system and there's 
an RPM available for the perl package you want I would highly recommend 
going the RPM route. It's too bad cpan isn't easier to turn into an rpm 
(besides cpan2rpm which I often find to be less useful than it's name 
would imply.)

-f

On Mon, 18 May 2009, Andrew Davis wrote:

> Date: Mon, 18 May 2009 16:14:50 -0400
> From: Andrew Davis <nccomp at gmail.com>
> To: Nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] Can't locate Net/SNMP.pm in @INC When Running
>     check_ifstatus
> 
> As root, try "perl -MCPAN -e shell" then "install Net::SNMP". You may want to first do "install
> Bundle::CPAN", then "install Net::SNMP". Also open up the test script (assuming its not a
> compiled binary) and check for all the "use" lines and make sure they're installed. For example,
> from another script I saw:
> 
> use strict;
> use Net::SNMP;
> use Getopt::Long;
> 
> So my steps were:
>       >sudo su -
>       perl -MCPAN -e shell
>       install Bundle::CPAN
>       reload cpan
>       reload index
>       install Net::SNMP
>       install Getopt::Long
> 
> For each, I installed prereq's where prompted...
> 
> Also, depending on your OS, you may want to update the OS first before doing the above. For
> example, with CentOS, an "yum -y update" is good practice every now and then... keeps you nice
> and current. But keep in mind that anything built against a specific package may fail (last time
> I did this, Cacti choked as it was built against a specific version of a library and needed to
> be recompiled).
> 
> Other common perl modules to consider include DBI, DBD::mysql, etc...
> 
> Oh, and put the Net::SNMP line that you changed back... unfortunately, the output of your RPM
> query is showing the SNMP programs themselves. The script you're using is looking for the Perl
> module Net::SNMP. net-snmp and Net::SNMP are two completely different things, yet often times
> codependent.
> 
> Hope this helps...
>
>   A. Davis
>   Email:     nccomp at gmail.com
>
>   "There is no limit to what a man can accomplish
>    if he doesn't care who gets the credit." - Ronald Reagan
> 
> 
> Martin Fontanez wrote:
>             From: Martin Fontanez <jdmfontz at yahoo.com>
>             Subject: Can't locate Net/SNMP.pm in @INC When Running check_ifstatus
>             To: Nagios-users at lists.sourceforge.net
>             Date: Monday, May 18, 2009, 3:46 PM
>
>             I am getting this error and not certain what gives.  Tried various
>             solutions including creating a link to ../net dir but still
>             get errors.  I did yum installs of relevant *snmp* packages.  Is there a
>             standard fix for this error?
>  
> 1 - [root at localhost libexec]# ./check_ifstatus -H localhost
> Can't locate Net/SNMP.pm in @INC (@INC contains: /usr/local/nagios/libexec
> /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7
> /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5
> /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7
> /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5
> /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi
> /usr/lib/perl5/5.8.8 .) at ./check_ifstatus line 39.
> BEGIN failed--compilation aborted at ./check_ifstatus line 39.
> 2 - SNMP.pm is (not on @INC path, but created a link to ...Net/) on the following
> location: 
> [root at localhost libexec]# find / -name SNMP.pm
> /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/SNMP.pm
> [root at localhost libexec]#
>  
> 3 - Looks like I got relevant rpm installed:
> [root at localhost libexec]# rpm -qa | grep -i snmp
> net-snmp-libs-5.3.2.2-5.el5
> net-snmp-perl-5.3.2.2-5.el5
> net-snmp-5.3.2.2-5.el5
> [root at localhost libexec]#
> 4.  Edited the file ../check_ifconfig  and replaced "use Net::SNMP;" with use
> "SNMP;" but that created other errors.
>  
>  
>  
>  
> 
>
>      ______________________________________________________________________________________
> 
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables 
> unlimited royalty-free distribution of the report engine 
> for externally facing server and web deployment. 
> http://p.sf.net/sfu/businessobjects
>
>      ______________________________________________________________________________________
> 
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null
> 
> 
>
-------------- next part --------------
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list