Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^2: SNMP problems

by ribasushi (Monk)
on Sep 11, 2007 at 22:05 UTC ( #638446=note: print w/replies, xml ) Need Help??

in reply to Re: SNMP problems
in thread SNMP problems

Here is my complete test script:
#!/usr/bin/perl use warnings; use strict; use SNMP; use Data::Dumper; $Data::Dumper::Useqq = 1; my $switchaddr = '<SET_ME>'; my $community = '<SET_ME>'; my $snmp = SNMP::Session->new ( DestHost => $switchaddr, Community => $community, Version => '2c', ) or die "Unable to connect to $switchaddr\n"; for my $oid (qw/ . . /) { print "\nTrying snmpwalk on $oid\n=========================\n"; print scalar `snmpwalk -O n -v 2c -c $community $switchaddr $oid`; print "\nTrying SNMP->gettable on $oid\n=========================\ +n"; my $response; eval { $response = $snmp->gettable ($oid) }; if ($@) { print "FAILED: $@\n"; } else { print Dumper $response; } }

and here is the result.

Replies are listed 'Best First'.
Re^3: SNMP problems
by andyford (Curate) on Sep 12, 2007 at 10:46 UTC

    Wow, ran your code and still got no results from gettable() for either OID but my snmpwalk results look great. I'm using perl 5.8.5 and SNMP 5.1.2 on Linux. How 'bout you?

    Update: fixed version and module name

    non-Perl: Andy Ford

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://638446]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2018-05-21 04:16 GMT
Find Nodes?
    Voting Booth?