On Sat, 2012-10-27 at 19:04 +0200, Garry wrote: > Hi, > > after searching the web and digging through numerous posts and pages > without much success, I've come here for some help/pointers towards a > solution ... > > I'm trying to write a program to query several fields from > SNIP-manageable devices (which works fine querying one field after > another), but instead of using multiple GET/GETNEXT commands, I would > like to use a batch request to reduce the load on the network and the > latency ... just, I can't find any decent documentation on how to ... > I've give up trying to understand the snmpbulkwalk code, especially as > it doesn't have any clear comments or samples on how to request multiple > specific OIDs or OID trees (if that is possible as such) > > Is there any documentation on how to actually use SNMP_MSG_GETBULK?
The algorithm is described in RFC 1905 4.2.3. A GetBulk is equivalent to a GetNext with the (non-repeaters) first arguments to the GetBulk followed by (max-repetitions) GetNext's with the remaining arguments. I think an example is useful here: snmpgetbulk -Cn=1 -Cm=2 localhost sysUpTime sysORID sysORDescr on my machine generates the response sysUpTime.0 = .... sysORID.1 = .... sysORDescr.1 = ... sysORID.2 = ... sysORDescr.2 = ... It is worth noting that my sysORTable have more than 2 rows. If I try with more rows than I have then the result becomes ... sysORID.9 = ... sysORDescr.9 = ... sysORDescr.1 = ... sysORUpTime.1 = ... What happened here is that I read past the end of the table and so the getnext iterations just continued. I would suggest that you play around a little with snmpbulkget to try what GetBulk does and then you can decide if it does what you want to do. Note that snmpbulkwalk does multiple requests, not just quite as many as snmpwalk. How are the variables you wish to look at spread? Is any of them a table? If none of them is a table then I think a Get or GetNext suits your use case better, but remember that you can put many request OID's in them as well. /MF ------------------------------------------------------------------------------ WINDOWS 8 is here. Millions of people. Your app in 30 days. Visit The Windows 8 Center at Sourceforge for all your go to resources. http://windows8center.sourceforge.net/ join-generation-app-and-make-money-coding-fast/ _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders