[AGENT++] How to set agent-addr in traps

Jochen Katz katz at agentpp.com
Fri Aug 14 23:38:48 CEST 2009


Hi,

>  When i am sending traps from my snmp agent then value of agent-addr field
> is going as localhost  so please tell me how i can set  value of this field.

the function is Pdu::set_v1_trap_address().

If you get localhost when not setting the address, the SnmpMessage class
uses the function gethostname() to get it. On your system this function
returns localhost...

Regards,
  Jochen



More information about the AGENTPP mailing list