[AGENT++] [AGENTX] How does dynamic table work in agentX?

Jens Engel Jens.Engel at Marconi.com
Mon Mar 21 11:32:17 CET 2005


Hi Moore,

>I wanna shift my monolithic application to the agentX framework, howerver,
>the dynamic mibtable does not register it at master. My question is:
Should
>I replace the MibTable with AgentXSharedTable if the region is not
overlaped
>in subagents?

If a table is completely provided by one subagent, you should use the
Agentpp::MibTable class.
Otherwise, if multiple subagents provide a non-overlapping set of rows for
a table,
you should use the AgentXSharedTable class.


SOME COMMENTS ON AgentXSharedTable:
---------------------------------------

PRECONDITION: You should have called the MibTable::update() method
(at least once after the connection comes up) to populate your table with
rows.

The newest version of AgentX++ (v1.4.11, 2005-01-11) contains a
MibTable::reinit() dummy method.
The AgentXSharedTable::reinit() triggers the (re-)registration of the table
rows.
It is called each time when the AgentX connection to the Master SNMP agent
comes up.
NOTE: This is mandatory when your AgentX goes up and down
      (for example when the Master agent is stopped and restarted on user
request).

You should probably override this method to recheck the "population" of
your table, ala:

void MySharedTable::reinit(void)
{
      // -- STEP 1: Delegate to BaseClass for AgentX row registration w/
Master of existing rows.
      AgentXSharedTable::reinit();

      // -- STEP 2: Trigger row (re-)discovery as incremental update.
      // NOTE: Each call to add_row()/remove_row() will perform AgentX
registration/unregistration.
      this->update();
}


One other thing to consider when functionality is split-up to several
subagents:
----------------------------------------------------------------------------------

There are at least 2 kind of tables:
1. The SNMP user/client can create new rows (when RowStatus object exists
and is writable)
2. Row creation occurs internally or is static

The first case is currently not supported as SharedTable (Frank, please
correct me if I am wrong!).
It would require some kind of request multiplexing intelligence in the
Master agent,
when a new row should be created (-> to which subagent this request is
forwarded).

The second case is no problem for the SharedTable class.
NOTE: If you need case 1, you should probably consider using SNMP context
instead (supported by SNMPv3).
For other SNMP versions, you might enmulate this functionality by using the
SNMP-COMMUNITY-MIB.

Ciao,
Jens Engel

AGENTPP mailing list
AGENTPP at agentpp.org
http://lists.agentpp.org/mailman/listinfo/agentpp






More information about the AGENTPP mailing list