Re: table retrieval in "session" or in "transaction"
"Dave Shield" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On 07/02/2008, Humpolicek <[email protected]> wrote: > I am unable to determine when some snmp client begins to read my > table and when this client finished it's retrieval. That's pretty much standard for any SNMP MIB implementation. The agent receives and processes each request independently. It can't really distinguish between a client that is walking the full table, and one that is picking out individual items. And of course, there's nothing to say that you'll only ever have one client querying your agent. It's quite feasible to have several management clients all trying to walk the same table at the same time. The usual technique to avoid reading in all the table information for each request, is to cache an internal copy of the table, and use this information to process the individual requests. Then it's just a matter of walking through this internal table, with no need to interact with the underlying system every time. The Net-SNMP agent toolkit includes a cache helper, designed for this very purpose. If you generate your MIB code template using the command mib2c -c mib2c.iterator.conf -S cache=1 myTable then this will include the necessary framework for re-loading the table data whenever it's deemed "too old". Alternatively, you might want to look at the code generated by mib2c -c mib2c.table_data.conf -S cache=1 myTable which is probably more efficient, since it doesn't have to walk through the whole table every time. The helper knows which rows are valid, so can go directly to the appropriate one for each request. But that's a much more flexible and reliable approach than trying to recognise when a client is walking the table. Dave ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users