[AGENT++] Security information
Miroslav Beranič ml.
miroslav.beranic at gmail.com
Thu Mar 19 00:05:14 CET 2009
Hi,
thanks for the answer, but I think this is only half of it. What I
mean is, I did what you suggested. But with no luck... It will return
response something like: "No OID found. At the end of the tree".
What I had to do, was to call method
Mib::add(context, entry)
I was only calling method Mib::add(entry).
an example:
...
MibStaticTable* st = new MibStaticTable("1.3.6.1.4.1.4976.6.1.1");
st->add(MibStaticEntry("2.224",
SnmpInt32(1)));
// an oldstyle entry with fully specified OID (deprecated)
st->add(MibStaticEntry("1.3.6.1.4.1.4976.6.1.1.3.224",
OctetStr("An oldstyle table text")));
st->add(MibStaticEntry("2.71",
SnmpInt32(2)));
st->add(MibStaticEntry("3.71",
OctetStr("A table text")));
// An example usage of the MibStaticTable for a read-only scalar
// group:
MibStaticTable* ssg = new MibStaticTable("1.3.6.1.4.1.4976.6.1.2");
ssg->add(MibStaticEntry("1.0",
SnmpInt32(1)));
ssg->add(MibStaticEntry("2.0",
OctetStr("A scalar text object")));
ssg->add(MibStaticEntry("3.0",
Counter32(123456)));
ssg->add(MibStaticEntry("4.1.0",
OctetStr("A scalar text in a sub group")));
ssg->add(MibStaticEntry("4.2.0",
Gauge32(65535)));
mib.add("other", ssg);
mib.add("other", st);
...
and thinks you wrote ... this will be (something) like this:
vacm->addNewAccessEntry("testGroup", "context",
SecurityModel_USM, SecurityLevel_noAuthNoPriv,
match_prefix,
"testView", "testView",
"testView", storageType_nonVolatile);
With this ... it all works.
But, I had to spent a lot of hours, for something, that could have
been written in documentation or one simple example ...
Thanks,
Miroslav Beranič ml.
2009/3/18 Jochen Katz <katz at agentpp.com>:
> Hi,
>
>> What I must change in static_table example to get response for context other?
>
> as you already know, you have to change the vacm configuration. Have a
> look at the calls to vacm->addNewAccessEntry() and vacm->addNewView().
> You have to add the same acces entries for context other, as it is
> already done for the empty context ("").
>
> Regards,
> Jochen
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp
>
More information about the AGENTPP
mailing list