[AGENT++] Agent++ Notifications

Frank Fock fock at agentpp.com
Thu Jun 24 23:47:05 CEST 2004


Hi Mads,

Probably sending a notification is simplier than you think ;-)
See my comments inline:

Mads Møller Grønfeldt wrote:

>My current exercise is getting the trap/notification part working. I have successfully sent a notification with code as shown below:
>
>coldStartOid coldOid;
>
>NotificationOriginator no;
>
>UdpAddress dest("127.0.0.1/162");
>
>no.add_v1_trap_destination(dest);
>
>no.generate(vbs, 0, coldOid, "", "");
>
>  
>
This code from the examples is just an example. To be able to use
a common interface across all platforms, I recommend not using the
NotificationOriginator class directly. Instead one should use the
Mib::notify method.

>Now I would like to get a more generic approach up and running... If I understand correctly I should add the following to my Mib instance:
>
>...
>
>pclMib->add( new snmp_target_mib() );
>
>pclMib->add( new snmp_notification_mib() );
>
>...
>
>  
>
Yes, that's correct. These MIB implementations are needed for configure
notifcation targets and filtering.

>Then I should create a derivate from NotificationType(), but this is where I am lost, so...
>  
>
This is not needed. You can, but it is also feasible to use the 
Mib::notify method
directly.

>1) If I would like to send a notification when one of my MibLeaf derivates changes, what should I do? Please describe which classes I eventually have to instantiate/create/inherit from, which methods to override, how I iterate the SNMP-TARGET-MIB etc. Please be very specific since I am all new in this area.
>
>  
>
Just fill in the necessary parameters to the Mib::notify method and call it.
That's all you'll need.

>2) That was it, but be prepared for more questions :-)
>
>  
>
I am always prepared ;-)

Best regards,
Frank




More information about the AGENTPP mailing list