[pysnmp-users] Troubles switching from hlapi synchronous bulkCmd to asyncore equivalent
Brought to you by:
elie
From: Graham H. <gr...@ze...> - 2016-08-23 12:42:25
|
Hi All, I've a python+pySNMP script querying an agent using the hlapi (synchronous) api and I want to switch it to using the hlapi.asyncore api instead. This is with version 4.3.2 and using bulkCmd(). To do this I had to move most of my code into a callback function, create a cbCtx object to pass in a dict to store the results into and then call the snmp-engine's transport dispatcher. I've come across two problems: 1. Since the hlapi.asyncore version of bulkCmd() does not seem to support the "lexicographicMode=False" option, I now get "extra" results returned when the data in the asked-for table runs out. Sometimes this contains entries for "columns" in the table that I have *not* asked for, sometimes it contains "columns" from "rows" in the next table 2. My callback seems to be called only once per query, so if the table is larger than the number of rows that will fit in one response, the code does not issue a new request and my results are truncated. My callback does not return a value, but if I add a "return True" to the end, it seems to loop forever, including many, many, results from beyond the end of the asked-for table Are these well known problems ? I can't find an example in the pysnmp code (or documentation) for the hlapi.asyncore version of bulkCmd(). Is this because no-one uses it ? Would I be better off switching from hlapi bulkCmd() to the "Native SNMP API" version ? Regards, Graham -- *Graham Hudspith Zeetta Networks Limited*Software Engineer Engine Shed, Station Approach, gr...@ze... Temple Meads, Bristol, BS1 6QH United Kingdom zeetta.com <http://www.zeetta.com/> |