Newbie question: generating v3 trap

Frank Fock Frank.Fock____t-online.de
Sat Sep 22 10:58:27 CEST 2001


Please do not post signed messages to the list. It makes it impossible for
some people (who have PGP enabled) to read your messages or the
replies on them.

OK, now our question:

The SNMP-TARGET-MIB is not supposed to be changed from within
an agent. Although this can be done, it is better design to let the end-user
choose whether she wants to get v1, v2c, or v3 traps or informs.

Since there could be only one instance of the SNNP-TARGET-MIB in
an agent, you can access its objects through its singleton pointers, for
example:

MibLeaf* r = snmpTargetParamsEntry::instance->find("1.3.6....");
or
MibLeaf* r = snmpTargetParamsEntry::instance->get(col, row);

Hopes that answers your question?

Regards,
Frank


"D. R. Evans" wrote:

> Well, I'm glad that the weekend is about to start.
>
> I spent four hours today poring over the agent++ code trying to figure out how
> to get to the snmp_target_mib once it's been added with the
>
> mib.add(new snmp_target_mib());
>
> command, and I still haven't been able to see how it's supposed to be done.
>
> I simplified the problem I was trying to solve, because if I could only find out
> how my agent was supposed to read values in the snmpTargetAddrTable, I could
> work out everything from that point on. At this point, I'd be happy just to be
> able to get to anything at all in the SNMP-TARGET-MIB that's been added to the
> "mib" variable.
>
> (Incidentally, in case it isn't clear, it's obvious how to get to it from a
> manager by using the process_request() function in the agent. It's how to get at
> it from inside the agent that I still don't understand.)
>
> I really am not dense, although people here might be excused for thinking that I
> am. I do understand SNMP, enough to be dangerous anyway; it's the "how to use
> agent++ to do what I want" that I don't understand.
>
> Incidentally, I did go out and buy the Zeltserman book, but it just seems to be
> a mid-level rewrite of parts of the RFCs, along with some background to provide
> context. I haven't seen anything in there that helps me understand the
> practicalities of using agent++ :-(
>
> It is clear to me from the archives that other people have cottoned on to using
> agent++ more or less instantly; I'm obvously missing something very, very
> elementary and once the answer becomes known I shall kick myself hard. I'm not
> blaming agent++ at all -- it looks excellent -- it's my own inability to see the
> trick in using it that annoys me more than anything.
>
> Anyway, it's the weekend and I'm going to try not to think about this stuff for
> a day or two.
>
>   Doc Evans
>




More information about the AGENTPP mailing list