SNMP.pm

Discussion in 'Perl Misc' started by Warrick FitzGerald, Oct 7, 2005.

  1. Hi All,

    I can't seem to use SNMP.pm on my box.

    =====

    #!/usr/bin/perl -w
    use SNMP;
    print "test \n";

    =====

    Fails with the following error:

    =====

    [root@Uploads wfitzgerald]# ./test.pl
    Can't locate SNMP.pm in @INC (@INC contains:
    /usr/lib/perl5/5.8.1/i386-linux-thread-multi /usr/lib/perl5/5.8.1
    /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0
    /usr/lib/perl5/vendor_perl .) at ./test.pl line 2.
    BEGIN failed--compilation aborted at ./test.pl line 2.

    =====

    However the module is in it's @INC path

    =========
    It's there:
    [root@Uploads wfitzgerald]# find /usr/lib/perl5/vendor_perl/5.8.1 |
    grep -i snmp
    /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi/auto/Net/SNMP
    /usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP
    /usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/MessageProcessing.pm
    /usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Dispatcher.pm
    /usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Message.pm
    /usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Security
    /usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Security/Community.pm
    /usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Security/USM.pm
    /usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/PDU.pm
    /usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Transport
    /usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Transport/UDP.pm
    /usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Security.pm
    /usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP.pm

    =====

    Any ideas?

    Thanks
    Warrick
     
    Warrick FitzGerald, Oct 7, 2005
    #1
    1. Advertising

  2. Warrick FitzGerald wrote:

    >Hi All,
    >
    >I can't seem to use SNMP.pm on my box.
    >
    >=====
    >
    >#!/usr/bin/perl -w
    >use SNMP;
    >print "test \n";
    >
    >=====
    >
    >Fails with the following error:
    >
    >=====
    >
    >[root@Uploads wfitzgerald]# ./test.pl
    >Can't locate SNMP.pm in @INC (@INC contains:
    >/usr/lib/perl5/5.8.1/i386-linux-thread-multi /usr/lib/perl5/5.8.1
    >/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
    >/usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl
    >/usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
    >/usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0
    >/usr/lib/perl5/vendor_perl .) at ./test.pl line 2.
    >BEGIN failed--compilation aborted at ./test.pl line 2.
    >
    >=====
    >
    >However the module is in it's @INC path
    >
    >=========
    >It's there:
    >[root@Uploads wfitzgerald]# find /usr/lib/perl5/vendor_perl/5.8.1 |
    >grep -i snmp
    >/usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi/auto/Net/SNMP
    >/usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP
    >/usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/MessageProcessing.pm
    >/usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Dispatcher.pm
    >/usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Message.pm
    >/usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Security
    >/usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Security/Community.pm
    >/usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Security/USM.pm
    >/usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/PDU.pm
    >/usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Transport
    >/usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Transport/UDP.pm
    >/usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP/Security.pm
    >/usr/lib/perl5/vendor_perl/5.8.1/Net/SNMP.pm
    >
    >=====
    >
    >Any ideas?
    >
    >Thanks
    >Warrick
    >
    >
    >

    Opps sorry the error it fails with is:

    [root@Uploads wfitzgerald]# ./test.pl
    Can't locate SNMP.pm in @INC (@INC contains:
    /usr/lib/perl5/5.8.1/i386-linux-thread-multi /usr/lib/perl5/5.8.1
    /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0
    /usr/lib/perl5/vendor_perl .) at ./test.pl line 2.
    BEGIN failed--compilation aborted at ./test.pl line 2.
     
    Warrick FitzGerald, Oct 7, 2005
    #2
    1. Advertising

  3. Warrick FitzGerald

    J. Gleixner Guest

    Warrick FitzGerald wrote:

    >>Hi All,
    >>
    >>I can't seem to use SNMP.pm on my box.
    >>
    >>=====
    >>
    >>#!/usr/bin/perl -w
    >>use SNMP;
    >>print "test \n";


    use Net::SNMP;

    Looking at the online documentation for SNMP would have answered it for
    you: http://search.cpan.org/~dtown/Net-SNMP-5.1.0/lib/Net/SNMP.pm
     
    J. Gleixner, Oct 7, 2005
    #3
  4. J. Gleixner wrote:

    > Warrick FitzGerald wrote:
    >
    >>> Hi All,
    >>>
    >>> I can't seem to use SNMP.pm on my box.
    >>>
    >>> =====
    >>>
    >>> #!/usr/bin/perl -w
    >>> use SNMP;
    >>> print "test \n";

    >>

    >
    > use Net::SNMP;
    >
    > Looking at the online documentation for SNMP would have answered it
    > for you: http://search.cpan.org/~dtown/Net-SNMP-5.1.0/lib/Net/SNMP.pm


    Ok sorry I was trying to simplify my problem, but here's the real situation:

    When running snmptt, I get the same error

    [root@Uploads wfitzgerald]# /usr/sbin/snmptt
    --ini=/etc/snmptt/snmptt.ini --debug2
    Unknown option: debug2
    Config file /etc/snmptt/snmptt.ini loaded
    Can't locate SNMP.pm in @INC (@INC contains:
    /usr/lib/perl5/5.8.1/i386-linux-thread-multi /usr/lib/perl5/5.8.1
    /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0
    /usr/lib/perl5/vendor_perl .) at (eval 2) line 1.

    Could not load the Perl module SNMP! If net_snmp_perl_enable is
    enabled then the SNMP module is required. Please see snmptt.html
    for system requirements. Note: SNMPTT uses the Net-SNMP package's
    SNMP module, NOT the CPAN Net::SNMP module!

    died at /usr/sbin/snmptt line 249.

    ======

    However as I showed it is installed (or so I belive anyway).

    Since snmptt was not written by me, I'm really trying to figure out
    what's going on. Even if I hard code the path


    use lib qw(/usr/lib/perl5/site_perl/5.8.1/Net/);
    use lib qw(/usr/lib/perl5/site_perl/5.8.1/Net/SNMP/);

    I still get other errors so soemthings not right, I just don't know what.


    Thanks
    Warrick
     
    Warrick FitzGerald, Oct 7, 2005
    #4
  5. Warrick FitzGerald

    J. Gleixner Guest

    Warrick FitzGerald wrote:

    > Ok sorry I was trying to simplify my problem, but here's the real situation:
    >
    > When running snmptt, I get the same error
    >
    > [root@Uploads wfitzgerald]# /usr/sbin/snmptt
    > --ini=/etc/snmptt/snmptt.ini --debug2
    > Unknown option: debug2
    > Config file /etc/snmptt/snmptt.ini loaded
    > Can't locate SNMP.pm in @INC (@INC contains:
    > /usr/lib/perl5/5.8.1/i386-linux-thread-multi /usr/lib/perl5/5.8.1
    > /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
    > /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl
    > /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
    > /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0
    > /usr/lib/perl5/vendor_perl .) at (eval 2) line 1.
    >
    > Could not load the Perl module SNMP! If net_snmp_perl_enable is
    > enabled then the SNMP module is required. Please see snmptt.html
    > for system requirements. Note: SNMPTT uses the Net-SNMP package's
    > SNMP module, NOT the CPAN Net::SNMP module!


    OK. It's not installed, or installed in a location that's not part of
    the default @INC.

    I've never heard of it, but looking around the Internet brought me to
    the FAQ, which explains how to install Net-SNMP.

    http://snmptt.sourceforge.net/docs/faqs.shtml

    I'd suggest installing the Net-SNMP module mentioned. Once it's
    installed correctly, it should resolve that error.
     
    J. Gleixner, Oct 7, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dna
    Replies:
    0
    Views:
    1,179
  2. dan byers
    Replies:
    1
    Views:
    611
    Hans =?iso-8859-1?Q?J=F8rgen?= Jakobsen
    Mar 6, 2004
  3. Ofer Razon

    SNMP Agent development

    Ofer Razon, May 31, 2004, in forum: Perl
    Replies:
    1
    Views:
    2,088
    Hans =?iso-8859-1?Q?J=F8rgen?= Jakobsen
    Jun 1, 2004
  4. Kevin Ingram

    SNMP using ASP?

    Kevin Ingram, Jan 17, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    495
    Kevin Ingram
    Jan 17, 2004
  5. milaus

    SNMP module to query net-snmp

    milaus, Aug 31, 2006, in forum: Perl Misc
    Replies:
    3
    Views:
    419
    Dr.Ruud
    Aug 31, 2006
Loading...

Share This Page