in reply to Re: Net:SNMP get_table() method failing
in thread Net:SNMP get_table() method failing

hmm, thanks - but no dice I'm afraid.

I tried modifying my call to the sub to be more specific (skipping the scalars), and inserting a print "OID:$oid\n"; just before the get_table() call. This produced the following output:

OID:1.3.6.1.4.1.3309.1.4.17.5 ERROR: Received noError(0) error-status at error-index 1 OID:1.3.6.1.4.1.3309.1.4.4
(there are two separate calls currently - the first fails, the second succeeds).
I then tried a manual snmpwalk using the OID printed - ie. the same one that was passed to get_table(), which produced:
snmpwalk -v1 -c XXXXXX x.x.x.x 1.3.6.1.4.1.3309.1.4.17.5 SNMPv2-SMI::enterprises.3309.1.4.17.5.1.2.1 = Counter32: 1 SNMPv2-SMI::enterprises.3309.1.4.17.5.1.4.1 = IpAddress: 61.115.200.69 SNMPv2-SMI::enterprises.3309.1.4.17.5.1.6.1 = IpAddress: 61.115.200.99 SNMPv2-SMI::enterprises.3309.1.4.17.5.1.10.1 = INTEGER: 1

So, based on the above (and your earlier comments in the CB), I'm fairly convinced now that the problem lies with the get_table() method.

My next approach will be to investigate using get_next_request instead, as you suggested in the CB. (unless you have any other suggestions? ;)

Thanks again for your help :)

Replies are listed 'Best First'.
Re^3: Net:SNMP get_table() method failing
by monarch (Priest) on Oct 31, 2006 at 23:01 UTC
    It's hard to tell what exactly the problem is without the MIB text and access to the device itself. Plus you've said some indexes return expected results and some don't - adding to the confusion.

    One of my earlier posts (Re^3: Where is the bug in this Net::SNMP code?) shows example code for pulling out tabular objects of a printer MIB. Another even earlier post (Re^3: SNMP from script conflicts with snmpwalk) discusses issues to do with reading tables and ensuring all objects in a table align.

    I've never used get_table myself, it's a relatively new function introduced into Net::SNMP. If you're unsure exactly what the behaviour is of your code then doing it the hard way (like I like to do) may be your best option so you can easily debug.