[AGENT++] Multiple SNMP agents in single application
Claus Klein
claus.klein at arcormail.de
Tue Mar 12 06:10:40 CET 2013
Hi,
there are 2 little unresolved problems with the same mib under
different context values.
How to get the context value and how to work with this static instance
variable:
netSnmpExampleInteger::netSnmpExampleInteger():
MibLeaf(oidNetSnmpExampleInteger, READWRITE, new NS_SNMP
SnmpInt32(42), (VMODE_LOCKED | VMODE_DEFAULT)) {
// This leaf object is a singleton. In order to access it use
// the static pointer netSnmpExampleInteger::instance.
instance = this;
//--AgentGen BEGIN=netSnmpExampleInteger::netSnmpExampleInteger
//FIXME how to get mycontext?
//XXX if (netSnmpHostsEntry::contextmap[mycontext])
if (netSnmpHostsEntry::instance) {
// NOTE register a call of
netSnmpExampleInteger::change_notification()
netSnmpHostsEntry::instance->register_for_notifications(this);
}
//--AgentGen END
}
On 08.03.2013, at 21:14, Jochen Katz wrote:
> Hi,
>
>> I need to host the same MIB at multiple ports within a single
>> application.
>> Each hosted MIB (at a different port) will end up accessing
>> different data
>> within the application.
>>
>> Can I do this within agent++/snmp++? If so, how? I see that
>> instances are
>> used for each MIB object, so I am unsure how I can have a single
>> MIB that
>> is hosted multiple times access different data within a single
>> application.
>
> there can only be one instance of agent++ Mib class in an application
> and the same is true for other classes of agent++/snmp++.
>
> You can add your MIB objects for several contexts and then either use
> SNMPv3 with different contextEngineIDs or map several SNMPv1/v2c
> communities to the different contexts.
>
> Regards,
> Jochen
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp
More information about the AGENTPP
mailing list