Pigoga has asked for the wisdom of the Perl Monks concerning the following question:

I have some troubles with Net::SNMP or with SNMP on device... I have the following code:
(my $session, $error) = Net::SNMP->session( -version => $snmp_version, -hostname => $host, -community => $community, -port => $port ); if (!defined($session)) { print "[" . &logger_time . "] ERROR: $error.\n"; $error=1; } my $result = $session->get_table( -baseoid => $OID_tree, ); if (!defined($result)) { print "[" . &logger_time . "] ERROR: $host $OID_tree " .$sessi +on->error. "\n"; $session->close; $error=1; }
When I try to use it with one of my device, ADSL modem Connexant(other devices, like Cisco, unixbox works good) $session->get_table of this code make the following error : "OBJECT IDENTIFIER length equal to zero" After debuging of the Net::SNMP I have found out that error happens with OID .1.3.6.1.2.1.2.2.1.22.1
snmpwalk works good with this device, and shows:
# snmpwalk -v2c -c public 82.179.195.37 .1.3.6.1.2.1.2.2.1.22.1 interfaces.ifTable.ifEntry.ifSpecific.1 = OID: .ccitt
How can I make my code, that use Net::SNMP, work with no errors, like snmpwalk?

Replies are listed 'Best First'.
Re: Net::SNMP Empty OID problem
by spadacciniweb (Curate) on Nov 19, 2009 at 10:58 UTC
    Hummm, I think the way to go are wireshark or ethereal.
    These software are network analizer, so you see the traffic between your host and device.
    Filter snmp traffic... and you have the answer. Ok?

    bye,
    mariano

    (($_="Mzz ojjdloobnf jt uvy5502383")=~y~b-zg2-5c96-81~a-z0-9~s)=~s~~~s; print