[AGENT++] Multiple Mibs, one request_list

Henning Eggers henning.eggers at plath.de
Thu Jan 29 09:17:01 CET 2004


Hi Martin,
Hi Frank,

> Why do you want to use more than one Mib instance?
> I cannot see any advantage?

I believe this is a missunderstanding. Unfortunately the terms "MIB" and
"MIBs" and "MIB module" are very often used incorrectly.

> Loridon, Martin wrote:
> >I am developing an SNMP agent and want to organise the management data
over
> >several mibs.
> >How do not know how to deal with several mibs and one and the same
> >request_list?

Each SNMP agent always has only _one_ MIB therefore the Agent++ code will
have only one instance of the class Mib. The MIB on the agent may be made up
of several MIB modules, which are often wrongly called "MIBs" themselves.
They are not! IF-MIB, SNMPv2-MIB, ATM-MIB etc. are all _modules_ of the MIB.
You can add modules to the mib instance by calling mib.add(...) with the
constructor of the module you want to add, like this:

mib.add( agentpp_simulation_mib() );

When you look at the code generated by AgenPro you will see, that the
classes that end with "_mib" are in fact derived from "MibGroup" and not
from "Mib" because that is all they are. Add all the "MibGroup"-derived
objects you need to your "Mib"-object and you are done.

Actually, it is not even correct to say, that an agent _has_ a MIB but
rather that it _implements_ a _part_ of the global MIB-tree. Just to confuse
you a little bit more ...

Greetings,
Henning





More information about the AGENTPP mailing list