[AGENT++] Agent++ Notifications

Mads Møller Grønfeldt mmg at dse.dk
Thu Jun 24 15:03:24 CEST 2004


Hi,

I am new to SNMP and I have just written a basic application using the very excellent agent++ and snmp++ libraries. I have made a standalone agent, and I am fully able to get and set values through it.

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, "", "");

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() );

...

Then I should create a derivate from NotificationType(), but this is where I am lost, so...

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.

2) That was it, but be prepared for more questions :-)

Best regards

Mads Groenfeldt

 

 




More information about the AGENTPP mailing list