[AGENT++] Regarding how to set read/write community and username/passwd

Jostmeyer, Danyi danyi.jostmeyer at bachmann.com
Thu May 3 13:02:45 CEST 2012


Hello,

I am using Agent++ v3.5 for our SNMP agent and I am new to Agent++. Our agent supports the mixed SNMP versions (v1, v2c and v3).

Please see my questions below.

(1)    In my code, "_SNMPv3" is enabled and snmp_community_mib is added.


First, I was using RequestList::set_read/write_community functions. But it doesn't work since _SNMPv3 is enabled.



Then, I am planning to use the following sample code to change the default community strings.

......
vacm->addNewGroup(SNMP_SECURITY_MODEL_V2, "public", "v1v2group", storageType_nonVolatile);
vacm->addNewGroup(SNMP_SECURITY_MODEL_V1, "public", "v1v2group", storageType_nonVolatile);
......
// add SNMPv1/v2c community to v3 security name mapping
OctetStr co("public");
MibTableRow* row = snmpCommunityEntry::instance->add_row(Oidx::from_string(co, FALSE));
OctetStr tag("v1v2cPermittedManagers");
snmpCommunityEntry::instance->set_row(row, co, co, reqList->get_v3mp()->get_local_engine_id(), "", tag, 3, 1);


Can you please give me a guide on how I can distinguish which one is for the "read-community" and which one is for the "write-community"? From the above sample, there is only one community string for corresponding SNMP version. Our default read and write community strings are not the same.


(2)    How can I set default username and password? I found that probably I can use USM::add_usm_user(). If then, how can I set auth_protocol and priv_protocol? Do you have an example for it?

Thanks in advance for your help.

Best Regards,
Danyi




More information about the AGENTPP mailing list