AW: [AGENT++] Dynamically loading MIBs

Eggers, Henning Henning.Eggers at plath.de
Thu May 3 11:38:38 CEST 2007


> I have looked into the API but there does not seem to be a 
> capability in
> SNMP++ to load MIBs at runtime. Is there a possibility to use 
> a compiled
> SMIDB format which some MIB browsers support?

No, I am afraid there is not.

> If not, then I 
> would assume
> we have to resort to compiling the MIBs into headers/source 
> at compile time
> and linking them in.

Yes, you are assuming correctly.

> Does anyone have experience with doing this using
> AgentPro.

Hm, it is either AgentGen Pro or AgenPro, the first being the older (no
longer developed), the latter being the newer. AgenPro sports velocity
templates for you to adapt to your needs. I have so far only used it
with SNMP4J.

AgentGen (which I have used with Agent++) will generate a singleton
class for each accessible MIB object. You will have to overwrite the
get_request and set methods to implement your instrumentation. Actually,
for set requests there are also prepare, commit and undo methods to
ensure data integrity.

There are more things to do for MIB tables.

> I am interested in mapping actual variable names to OIDs in
> commands and getting variable names in responses?

If you are looking for a generic aproach you will have to do a little
hacking. I configured AgentGen to _only_ generate classes for .*Entry
objects and inserted the add calls by hand using a generic SnmpObject
class derived from MibLeaf. This class is doing the instrumentation in a
generic way.

But maybe AgenPro provides more flexibility in this area.

Just to get you started. Good luck! ;-)

Henning




More information about the AGENTPP mailing list