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

I have a problem doing a get_bulk_request in a perl where its to not fully incrementing the last part of the OID. I suspect this is Arris not doing somethign properly but was wondering if anyone has encountered a similar situation and if they had any solutions to work around? Running the snmpbulkget from the command line returns all the OIDs properly and it what I’m hoping to accomplish in my perl script.

use Net::SNMP; use Net::SNMP::Util; my @testoid = ( '1.3.6.1.4.1.4115.1.20.1.1.3.26.1.2' ); my ($snmp, $error) = Net::SNMP->session( -hostname => "$host", -community => "$Community", -timeout => 60, -nonblocking => 1, -debug => 0, -maxmsgsize => 65535, -version => 'snmpv2c' ); if (!defined $snmp) { print STDERR "ERROR: %s.\n", $error; exit 1; } my $ret = $snmp->get_bulk_request( -callback => [\& table_cb, {}], -maxrepetitions => 10, -varbindlist => [@testoid] ); sub table_cb { my $everything = shift; print Dumper($everything); }

Print Dumper $everything Returns the following and doesn’t jump from .10008 to .10101 so I’m missing arrisRouterWPAPreSharedKey.10101 and arrisRouterWPAPreSharedKey.10102

'1.3.6.1.4.1.4115.1.20.1.1.3.26.1.2.10001' => 'TopSecret', '1.3.6.1.4.1.4115.1.20.1.1.3.26.1.2.10002' => 'BPP8EX50', '1.3.6.1.4.1.4115.1.20.1.1.3.26.1.2.10003' => 'BPP8EX50', '1.3.6.1.4.1.4115.1.20.1.1.3.26.1.2.10004' => 'BPP8EX50', '1.3.6.1.4.1.4115.1.20.1.1.3.26.1.2.10005' => 'BPP8EX50', '1.3.6.1.4.1.4115.1.20.1.1.3.26.1.2.10006’ => 'BPP8EX50', '1.3.6.1.4.1.4115.1.20.1.1.3.26.1.2.10007' => 'BPP8EX50', '1.3.6.1.4.1.4115.1.20.1.1.3.26.1.2.10008’ => 'BPP8EX50',

Running snmpbulkget from the command line off the same box, I return all the OIDs I’m looking for.
snmpbulkget -v2c -mall -cpublic x.x.x.x 1.3.6.1.4.1.4115.1.20.1.1.3.26.1.2
ARRIS-ROUTER-DEVICE-MIB::arrisRouterWPAPreSharedKey.10001 = STRING: "TopSecret"
ARRIS-ROUTER-DEVICE-MIB::arrisRouterWPAPreSharedKey.10002 = STRING: "BPP8EX50"
ARRIS-ROUTER-DEVICE-MIB::arrisRouterWPAPreSharedKey.10003 = STRING: "BPP8EX50"
ARRIS-ROUTER-DEVICE-MIB::arrisRouterWPAPreSharedKey.10004 = STRING: "BPP8EX50"
ARRIS-ROUTER-DEVICE-MIB::arrisRouterWPAPreSharedKey.10005 = STRING: "BPP8EX50"
ARRIS-ROUTER-DEVICE-MIB::arrisRouterWPAPreSharedKey.10006 = STRING: "BPP8EX50"
ARRIS-ROUTER-DEVICE-MIB::arrisRouterWPAPreSharedKey.10007 = STRING: "BPP8EX50"
ARRIS-ROUTER-DEVICE-MIB::arrisRouterWPAPreSharedKey.10008 = STRING: "BPP8EX50"
ARRIS-ROUTER-DEVICE-MIB::arrisRouterWPAPreSharedKey.10101 = STRING: "SuperTopSecret"
ARRIS-ROUTER-DEVICE-MIB::arrisRouterWPAPreSharedKey.10102 = STRING: "BPP8EX50"

Replies are listed 'Best First'.
Re: Perl scripted get_bulk_request versus command line snmpbulkget
by NetWallah (Canon) on Nov 04, 2015 at 18:49 UTC
    If you look at the section on "Non-blocking SNMPv2c get-bulk-request for ifTable" , in Net::SNMP, it seems to indicate that a NON BLOCKING request may require multiple calls to "get_bulk_request" from inside the callback sub.

    I'd suggest either try a BLOCKING call, or follow the protocol in the documented example for non-blocking calls.

            “The sources of quotes found on the internet are not always reliable.” — Abraham Lincoln.3; cf.