How to sync a MibTable with an STL::vector?

Stefan.Mueller-Wilken____resco.de Stefan.Mueller-Wilken____resco.de
Mon Apr 14 10:52:10 CEST 2003





Hi there!

Ok, I admit it: I'm lost within the realms of table construction...

What I want to do is to have an STL::vector (first version, later to be
changed to a MySQL table) be accessible via SNMP get- and set-requests.
I've got no problem with initializing the table at startup. I use a
MibTable derivate, add columns and iterate through the vector, adding rows
and replacing their values at MibTable instantiation. So far, so good. What
I just can't get a grasp on is how to handle changes, additions  etc. to
the vector and how to keep the corresponding MibTable in sync later on.

Quite a few posts to the list have dealt with similar problems (esp.
synchronizing MibTables with database tables) and have hinted at using the
MibTable::update(...) method. The documentation explains that
MibTable::update() is used by the Mib to find out about the number of rows
the receiver contains. Sounds as if this should be the right place to
rebuild the MibTable from the vector!

Unfortunately, my experiments show that MibTable::update(...) is called
_on_every_ columnar _and_every_ row and not - as I would have expected -
once per table. Additionally, the Request* changes on every call, rendering
my effords to ignore subsequent calls to update useless. And it seems quite
a waste to make n x m calls to change the n rows of my m column table. Do I
really have to completely zap the MibTable and rebuild it from scratch on
every call? What's the proper way to do the trick?

Just to make things worse, I couldn't find any (complete) examples on how
to sync Agent++ MibTables with databases or STL containers in posts to the
lists or in the documentation. :-(

Could anyone who has done this before set me on the right track and help me
with a complete example source? Thanks!

Cheers,
 Stefan




More information about the AGENTPP mailing list