Re: What should I do if I want to update the table list before each request for the whole table

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 21/08/06, James Deng D (SH/CBC) <[email protected]> wrote:
> I want to update my table (which is a linked list) before each request for
> the whole table instead of each column,
> That's to say, I want to get the latest table list each time when I execute
> a snmptable command.

And what should the agent do when it gets a request for an individual
element of the table
(rather than someone walking the whole table)?   Should it re-load the
table or not?


> For a scalar, I can use the get handler, and set the latest value each time
> when I get a MODE_GET request, is there a MODE_GET_LIST or something like
> that for me to track a request for a whole table?

No - as far as the agent is concerned, it receives a sequence of
GETNEXT requests (which may well be converted into MODE_GET by the
time they reach the MIB handler).

The usual approach in this situation is to cache the contents of the
table for a given period, and only reload this once the cache has
expired.  If you set the timeout to be fairly short
(say 2-3 s), then that will probably have the same general effect -
particularly if the table isn't massive.

There's an example of this approach in (e.g) mibII/udpTable.c
See the end of 'init_udpTable()' and the routines 'udpTable_load' and
'udpTable_free'

Dave

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.