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

"James Deng D (SH/CBC)" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <DA04AFDC78737F4BA618C8386C581DCA8260D2@ecnshmw511.eapac.ericsson.se>
Thanks Dave

My current solution is: register a alarm function to reload my table
repeatedly

snmp_alarm_register(30, SA_REPEAT, reload_Table, NULL);
/*reaload the entire table every 30 secs*/

My table is not massive, so I think there should be little performance
cost there.

So can I conclude that the agent never knows at which time they are
processing a retrieve of the whole table?
It just only knows the GETNEXTs and never has a separate bar between two
snmptable request?  


Thanks again

//James



-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Dave Shield
Sent: Monday, August 21, 2006 17:39
To: James Deng D (SH/CBC)
Cc: [email protected]
Subject: Re: What should I do if I want to update the table list before
each request for the whole table

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.