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:     ncc...@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 <jdmfo...@yahoo.com>
    Subject: Can't locate Net/SNMP.pm in @INC When Running check_ifstatus
    To: Nagios-users@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 - [r...@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: [r...@localhost libexec]# find / -name SNMP.pm
    /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/SNMP.pm
    [r...@localhost libexec]#
3 - Looks like I got relevant rpm installed:
    [r...@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
    [r...@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@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
------------------------------------------------------------------------------
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@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

Reply via email to