Hi Robert, Thank you for your reply and advice.
I have now managed to implement my table using MfD. It works fine and I'm really pleased with it. In the beginning I was a bit daunted by the MfD, but turns out it is really simple - hence the name I guess :-) I also did an alternative implementation where I read data from a file using the iterator approach - but it seems the iterator has a bit of an overhead. When a user does an 'snmptable' or 'snmpwalk' on the table I can see at least twice the number of requests to read the file than there are lines in the file. Perhaps this is expected, or (more likely) a mistake in my implementation. Anyway iterator works too and gives the right results, but perhaps it reads the file more times than it has to. One last question: is there any examples of how scalar data can be cached? I can see the MfD takes care of caching for the tables, but when I run mib2c with no arguments it doesn't give me the choice of MfD for the scalar object. Lastly, if anybody thinks that it'd be beneficial to share my adventures with implementing tables, I can document my experience and what I did in a step-by-step tutorial and post them here. I'm quite good at documenting stuff - more than coding it seems :-) Thanks once again, --a On Tue, Jul 13, 2010 at 4:06 PM, Robert Story <rst...@freesnmp.com> wrote: > On Thu, 8 Jul 2010 19:54:50 +0100 Angela wrote: > AP> (1). Data is external to the agent (lives in a database), caching is > AP> desirable but not essential. > > several of the tables have the option to use the cache helper, which can also > be easily added to those that don't. > > AP> (2). Ideally looking for an implementation that can be loaded as a .so > AP> with dlmod. > > Module code is independent of how it is loaded/called, so this is a build > issue, not a coding issue. > > AP> (2). Ease of use, since not an NetSNMP expert, still trying to get my > AP> head round the API :-) > AP> > AP> The mib2c.mfd.conf seems a good option, but don't know where to start. > AP> The online tutorial didn't help me much. > > did you check out the generated readme's and todo files? > > AP> Anyway, any advice or pointer to the differences between > AP> iterate_access, arrays, tabledata, etc. will be very very much > AP> appreciated, since I'm a noob :-) > > If you run mib2c without specifying a conf file, it will ask you a series of > questions to guide you. > > I suggest that you generate several and compare them. I'd stay away from > iterate, but table_data and mfd are both good choices. MfD is best if you > don't have a good handle on the net-snmp api, as it's mostly 'fill in the > blanks' and handles several complex issues for you under the covers. The > table_data helper is my second choice, but it is much more spartan and you > have to look out for and handle the tricky stuff yourself. [I've actually made > good progress in adding to this template to deal with RowStatus handling, > which can be pretty trick, but haven't had time to polish it up and check it > in.] > > I'm sure Dave will chime in and defend some of the other options real soon > now. :-) > > ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders