SNMP.pm

  • Thread starter Warrick FitzGerald
  • Start date
W

Warrick FitzGerald

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
 
W

Warrick FitzGerald

Warrick said:
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.
 
W

Warrick FitzGerald

J. Gleixner said:
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
 
J

J. Gleixner

Warrick said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,961
Messages
2,570,130
Members
46,689
Latest member
liammiller

Latest Threads

Top