Mib table and DB table

Ron Sperber - Israel RonS____gilat.com
Sun Aug 19 19:42:39 CEST 2001


Thanks Alex,
I've tried your suggestion and it works fine with the following exceptions:
 - I don't get the same results when more than one manager queries the Mib
simultaneously -      
   My agent is multithreaded.
 - I have problems with GetBulk - can you give a pointer on how you
implemented it ?

Frank suggested using the MibComplexEntry class - I couldn't think on any
good sheme - Can any one help me with this one ?
TIA, 
	Ron

> -----Original Message-----
> From: Alex Finogenov [mailto:afinogenov____malibunet.com]
> Sent: Wednesday, August 08, 2001 8:13 PM
> To: 'Ron Sperber - Israel'; 'agentpp-dl____agentpp.com'
> Subject: RE: Mib table and DB table
> 
> 
> Ron,
> 
> I have been working on this for a few weeks. Depending on 
> your requirements
> and complexity of the MIB (tables with AUGMENTS clause, 
> etc.), it may be
> complex.
> 
> My major requirement was to modify minimum code when a MIB is changed
> (recompiled). I achieved this by subclassing  MibTable (use 
> Decorator and
> Bridge design patterns) and overloading update() (you preload all the
> relevant rows for the request), prepare_set_request() (here I added
> additional validation, fix agent++ bugs until the new release),
> commit_set_request() (here I figure out which rows have been added,
> modified). Also I overloaded row_added() and row_delete() 
> (the latter is the
> only way to easily know when a row is deleted.)
> 
> The main logic is was not a problem, returning right errors and make
> dependent tables (with AUGMENTS clause) work in cooperation 
> with their base
> tables is more challenging. There is also a problem of 
> rolling back and
> returning proper errors when something goes wrong in the back 
> end systems
> while everything passed fine through the SNMP agent.
> 
> You may have to write some sort of simple state machine to 
> keep track of
> what has happened and what has to happen to your tables, because the
> agent++'s processing of the varbinds depends only on the 
> sequence of them in
> the request, but table independencies may force you to have your own
> sequence of events (update(), prepare_set(), etc.)
> To deliver the agent in a short time frame I had to go 
> single-threaded.
> 
> Have fun,
> 
> Alex  
> 
> -----Original Message-----
> From: Ron Sperber - Israel [mailto:RonS____gilat.com]
> Sent: Wednesday, August 08, 2001 9:46 AM
> To: 'agentpp-dl____agentpp.com'
> Subject: Mib table and DB table
> 
> 
> Hi,
> I have this dilemma:
> I've constructed a mib containing a table that corresponds to 
> a dynamic
> table located in an SQL server.
> This table can contain up to 10,000 entries and is a dynamic 
> one - meaning
> row van be added or deleted.
> My question is - since I do not want to keep all the table 
> present in the
> memory all the time (which means that I have to pass all over 
> the DB table
> once a while) I need another schema to respond with the right values.
> I thought of 2 solutions
> 	- using the MibComplexEntry - but in this case there a lot of DB
> access per request (at least in my implementation...)
> 	- using the usual mibTable and update the Mib in the 
> update function
> - but in this case when do I delete the entries ? I 	  can 
> expect several
> managers querying simultaneously.
> Has anyone dealt with such situation?
> thanks in advance ,
> 			Ron
> 



More information about the AGENTPP mailing list