nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Problems with perl module Net::SNMP

This is a discussion on Problems with perl module Net::SNMP within the Linux software forums, part of the Linux Getting Started category; While trying to use Net::SNMP I have problems in this case: 1. Install module from CPAN cpan> install Net::SNMP CPAN: ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 04-11-2007, 09:13 PM
Junior Member
 
Join Date: Apr 2007
Posts: 1
Rep Power: 0
Jason
Default Problems with perl module Net::SNMP

While trying to use Net::SNMP I have problems in this case:

1. Install module from CPAN

cpan> install Net::SNMP
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Database was generated on Thu, 22 Mar 2007 17:08:51 GMT
Net::SNMP is up to date.

2. Test connection with perl script

#!/usr/bin/perl

use Net::SNMP;
use SNMP::MIB::Compiler;

my ($session, $error) = Net::SNMP->session
(
-hostname => $hostname,
-community => $community,
-port => $port
);

$sysUpTime ="1.3.6.1.2.1.1.3.0";
$result = $session ->get_request("$sysUpTime");
for $key (keys (%{$result})) {
print $result->{$key}, "\n";
}

#SNMP::MIB::Compiler I instulled before

3. While testing have a problem

"i-tel:/tmp# ./test_snmp_conectivity
Can't locate object method "session" via package "Net::SNMP" (perhaps you forgot to load "Net::SNMP"?) at ./test_snmp_conectivity line 17."

4. Trying to find SNMP.pm in the system, but there is only SNMP.pm -- Perl 5 interface to the Net-SNMP toolkit !!

5. Then I instull net-snmp-5.4 from source

./configure
make
make install


and try script

"Can't load '/usr/lib/perl5/site_perl/5.8.7/i486-linux/auto/NetSNMP/default_store/default_store.so' for module NetSNMP::default_store:
libnetsnmp.so.15: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.7/i486-linux/DynaLoader.pm line 230.
at /usr/lib/perl5/site_perl/5.8.7/i486-linux/Net/SNMP.pm line 16
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.7/i486-linux/Net/SNMP.pm line 16.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.7/i486-linux/Net/SNMP.pm line 16.
Compilation failed in require at ./test_snmp_conectivity line 11.
BEGIN failed--compilation aborted at ./test_snmp_conectivity line 11."

6. Then make deinstall. It complete with errors.

7. Install module from cpan again. Сomplete successfully.

8. Try testing.

"Can't load '/usr/lib/perl5/site_perl/5.8.7/i486-linux/auto/NetSNMP/default_store/default_store.so' for module NetSNMP::default_store:
libnetsnmp.so.15: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.7/i486-linux/DynaLoader.pm line 230.
at /usr/lib/perl5/site_perl/5.8.7/i486-linux/Net/SNMP.pm line 16
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.7/i486-linux/Net/SNMP.pm line 16.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.7/i486-linux/Net/SNMP.pm line 16.
Compilation failed in require at ./test_snmp_conectivity line 11.
BEGIN failed--compilation aborted at ./test_snmp_conectivity line 11."


Please, help me!! I use Slackware Linux. I have never use Linux before...
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-28-2007, 03:09 AM
Junior Member
User
 
Join Date: Dec 2007
My distro: centos
Posts: 1
Rep Power: 0
dl_sledding is on a distinguished road
Default

Jason,

Did you ever get a solution to this? If so, what was it? I am running into the exact same problem, and cannot find the answer anywhere.

TIA
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On

Similar Threads

Thread Thread Starter Forum Replies Last Post
how would i know that module for usbat02 has loaded Misbah Naveed Linux hardware 0 12-07-2007 12:23 PM
Module shyamprasad Coding in General 0 08-21-2007 12:54 PM
Python with SNMP Supportq rcordeiro Shell scripting 2 12-16-2006 11:48 PM
ISDN module asim.mcp Linux software 0 08-27-2006 04:42 AM
Net-snmp header file puppen Linux software 2 05-23-2006 06:45 PM


All times are GMT +5.5. The time now is 10:33 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36