[AGENT++] Changing the source IP (agent-addr) of the Traps. (Newbie)

Gianandrea Gobbo gobbo at solari.it
Wed Sep 28 09:50:46 CEST 2011


Hello all.
I'm new to agent++, and building my first service.
I notice that the trap I've set up has agent-addr set as the localhost
Ip (127.0.0.1).
I'd like to change that to the proper IP, also because my device has
multiple interfaces.
Even better would be to set that to a host name to be possibly
resolved by the receiver's DNS.

I'm using a subclass of NotificationType (created automatically bu
AgenPro) which, as example, I invoke as follows:

Vbx* vbs = 0;
coldStartOid coldOid;
NotificationOriginator no;
UdpAddress dest("172.26.0.98/162"); // dest IP
no.add_v1_trap_destination(dest, "defaultV1Trap", "v1trap", "public");
no.add_v1_trap_destination(dest, "testV1Trap", "test", "public");

// send custom notification
mib->notify("", coldOid, vbs, 0);
serviceStatusChange myTrap; // my subclass of NotificationType
myTrap.notify("",vbs,0);

Any help, hint or critic is greatly appreciated.

Gianandrea.



More information about the AGENTPP mailing list