Newbie question: generating v3 trap
D. R. Evans
N7DR____arrl.net
Sat Sep 22 15:17:01 CEST 2001
On 22 Sep 2001 at 10:58, Frank Fock wrote:
> 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.
>
Strange; I have PGP enabled (obviously :-)) and I can read them, etc. I've been
using PGP since one of Phil's early releases (Phil used to live near me) and I
can't recollect any reflector ever having a problem with PGP messages before.
Anyway, I'll try to remember to turn off the digital signatures for future
posts.
> 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.
>
I certainly agree that this is commonly better; in this particular case,
however, for some of the events that occur at boot time, it has to be done a
certain way, and that requires that a v3 message be sent -- and in fact that
only v3 be supported throughout.
> 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?
>
YES YES YES. What tricked me is that this I had not spotted the inclusion of a
static variable called instance. And even if I had noticed it, I probably
wouldn't have understood how it was supposed to be used. SO THANK YOU VERY MUCH!
>From this point on, I expect everything to be (relatively) plain sailing, since
it should just be a matter of writing code.
The C++ style of agent++ is hugely different from the C++ style that I normally
see (and I was on the ANSI C++ committee for a couple of years, so I'm not
exactly a stranger to C++), so it has been very difficult for me to understand
the basic design of the program. Having a user-level "new" without a
corresponding user-level "delete" is also something I have to struggle with as
well :-) But I've had to come to terms with that style since Java became
popular, although I never use it myself.
Doc Evans
--------------------------------------------------------------
Phone: +1 303 494 0394
Mobile: +1 720 839 8462
Fax: +1 781 240 0527
--------------------------------------------------------------
More information about the AGENTPP
mailing list