[AGENT++] How to add a new group with securityName (same with userName) by reading usmMIB persistent storage file before mib initialization (mib->init ())?

Yasemin YILMAZ yaseyilmaz at gmail.com
Wed May 5 10:46:15 CEST 2010


Hi all,

I have an agent application and an administration gui application that
configures the agent. I want to store MIB objects persistently from admin
app and call the function addNewGroup with userName stored into usmMIB as
securityName (added a securityName equaled to userName in UsmUserTable from
admin app) from agent app. Please look at codes below, how can I set XXXX
parameter of the function addNewGroup before mib->init ()?  Are there
Agent++ API functions that read usmMIB file?

Thanks in advance for helps and explanations,


// FROM admin app
________________________________________________.........
UsmUserTable *uut = new UsmUserTable();

MibTableRow* pEntry;
pEntry= uut->addNewRow("myadmin",
               SNMPv3_usmHMACMD5AuthProtocol,
               SNMPv3_usmDESPrivProtocol,
               "12345678",
               "12345678");
pEntry->get_nth (11)->replace_value (new SnmpInt32(4));
________________________________________________.........
mib.save_all ();


// FROM agent app
________________________________________________.........
Vacm* vacm = new Vacm(*mib);
reqList->set_vacm(vacm);
vacm->addNewContext("");
vacm->addNewGroup(SecurityModel_USM, XXXX, "myGroup",
storageType_nonVolatile);
________________________________________________.........
mib->init();


Best regards,
Yasemin



More information about the AGENTPP mailing list