[AGENT++] Using specific traps
amine mohamed
med_amine007 at hotmail.fr
Tue Dec 10 16:49:26 CET 2013
Hello ,
i tried agent++ and i'm very satisfied with the results.thanks to your help i succeded to work all the snmp commands .Now i'm trying to work with traps whoever i failed to understand it well .i have generated functions from my mib:
XTrap::xmib_XTrap(): NotificationType()
int xtrap:notify(const OctetStr& context, Vbx* vbs, int sz)
xmib_YTrap::ymib_YTrap(): NotificationType()
int xmib_YTrap::notify(const OctetStr& context, Vbx* vbs, int sz)
in the other hand i found this code in the atm_mib example
Vbx* vbs = 0;
coldStartOid coldOid;
NotificationOriginator no;
// add an example destination
UdpAddress dest("127.0.0.1/162");
no.add_v2_trap_destination(dest, "defaultV1Trap", "v1trap", "public");
send the notification
mib->notify("", coldOid, vbs, 0);
this code working but when i change it to :
Vbx* vbs = new Vbx[14];
coldStartOid coldOid;
NotificationOriginator no;
// add an example destination
UdpAddress dest("127.0.0.1/162");
no.add_v2_trap_destination(dest, "defaultV1Trap", "v1trap", "public");
vbs[0].set_oid("1.3.6.1.2.1.92.1.3.2.1.4.0.1");
vbs[1].set_value(2);
// send the notification
mib->notify("","1.3.6.1.4.1.XXXXXX",vbs,14);
it fails to be sent
onother thing how to do the relation betwwen this and the functions generated ?
thanks in advance for the help
More information about the AGENTPP
mailing list