Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > SNMP.pm

Reply
Thread Tools

SNMP.pm

 
 
Warrick FitzGerald
Guest
Posts: n/a
 
      10-07-2005
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

 
Reply With Quote
 
 
 
 
Warrick FitzGerald
Guest
Posts: n/a
 
      10-07-2005
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.
 
Reply With Quote
 
 
 
 
J. Gleixner
Guest
Posts: n/a
 
      10-07-2005
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-SN...ib/Net/SNMP.pm
 
Reply With Quote
 
Warrick FitzGerald
Guest
Posts: n/a
 
      10-07-2005
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-SN...ib/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
 
Reply With Quote
 
J. Gleixner
Guest
Posts: n/a
 
      10-07-2005
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments