Hi Dave, Thanks for your help.
I will try your suggestion, but it should focus on "periodically update". My key question is how to *not* get *all* external data one time. The external data is really huge in my case, and automatic updating is still not enough for my scenior. Is there any method to get the index values in template code generated from "mib2c.iterate_access.conf"? Thanks in advance. BR, 永鈦鑫 iTAS Corporation 新竹市水源街75號 NO. 75,Shuiyuan St., Hsinchu City, Taiwan, R.O.C. Tel:03-5716099 Ext.1208 E-mail:tewen.hs...@itas.com.tw ----- Original Message ----- From: "Dave Shield" <d.t.shi...@liverpool.ac.uk> To: "Tewen Hsieh" <tewen.hs...@itas.com.tw> Cc: <net-snmp-coders@lists.sourceforge.net> Sent: Monday, June 08, 2009 8:33 PM Subject: Re: Could anyone give me some suggestions? > 2009/6/8 Tewen Hsieh <tewen.hs...@itas.com.tw>: >> Loading the internal cache in the 'init_xxx()' routine is not fisable for >> my >> case, becaues my external data will be updated periodically. >> Also the loacl structure needs to be updated periodically. > > OK - an alternative approach might be to run > > mib2c -Scache=1 -c mib2c.iterate.conf .... > > This will generate code for the "iterate" helper instead, > which is similar to iterate_access (with the same get_first,next > hook routines). The main difference is that it uses the > standard MIB handler routine, rather than individual routines > for each column object. > > The reason for suggesting this (rather than iterate_access) is that > it includes support for "cached data" - i.e. loading the external > data separate from the iteration framework itself. > > Now in itself, that doesn't get you any further forward, as it would > normally just load the external data when the first request comes > in (as currently), plus whenever the cached data is regarded as > "too old". So you'd still have this long delay. > > But it's also possible to run the reload routine automatically, on a > regular basis (perhaps in a separate thread), so that it's always > ready for incoming requests. > > If you have a look at the 'agent/mibgroup/hardware/cpu' code, > that's the approach which is taken here. > > Have a play with that - see if it's any better suited to your needs. > > Dave ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders