[AGENT++] SNMP-COMMUNITY-MIB help needed.

Frank Fock fock at agentpp.com
Sat May 12 16:43:46 CEST 2018


Hi Piotr,

The code you quoted is commented out with reason. 

Using the community MIB with SNMPv3 disabled makes no sense. The COMMUNITY MIB provides services for SNMPv2c and v1 that makes sense with SNMPv3 but not if you do not use SNMPv3.

Hope that helps.

Berst regards,
Frank 

> On 11. May 2018, at 17:54, Piotr Grudzinski <piotr at powersmiths.com> wrote:
> 
> Hello,
> 
> Here is some code from: Agent++\agent++-4.1.1\agenpro\simagent\src\agent.cpp
> 
> void init(Mib& mib)
> {
>  mib.add(new simSysGroup());
>  mib.add(new snmpGroup());
> mib.add(new agentpp_simulation_mib());
> mib.add(new TestAndIncr(oidSnmpSetSerialNo));
> mib.add(new snmp_target_mib());
> // Not added by default:
> // mib.add(new snmp_community_mib());
> mib.add(new snmp_notification_mib());
> #ifdef _SNMPv3
> UsmUserTable *uut = new UsmUserTable();
> 
> With the line:
>   mib.add(new snmp_community_mib());
> included the compiler fails if _SNMPv3 is not defined.
> 
> There are two confusing things:
> 1. The code above indicates the  snmp_community_mib can be used
> without _SNMPv3  being defined.
> 2. Looking inside agent_pp/snmp_community_mib.h gives me an impression
> that something is incorrect. Nothing will be included if _SNMPv3 is
> not defined but at the same time there is another #ifdef _SNMPv3
> inside the first one ( in the snmpTargetAddrExtEntry class).
> 
> So, the question is: can the snmp_community_mib class be used without
> _SNMPv3 being defined?
> 
> Regards,
> Piotr
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> https://oosnmp.net/mailman/listinfo/agentpp



More information about the AGENTPP mailing list