Q: Snmp++ traps

manjunath ramaiah manjunath.ramaiah____wipro.com
Sun Oct 8 20:35:19 CEST 2000


Hi ,
 I am using snmp++ to send the traps( Snmp::trap() function) . I have
this problem .

I am not setting the address of the agent  which is sending the trap in
the pdu  in my code . On Receiving the trap , in the Manager side the
instead of displaying the agent ipaddress it is displaying as 'local
host ' .The source addr  in
the trap pdu is 0. I looked into snmp++ code , SnmpMessage::load()
function is placing the agent addr by making  gethostname function . But
this code is in the
IF condition and it is done for V1 traps only .

How to make the trap pdu to contain the ipaddr of the M/C sending the
trap ?

My code is
 Oid enterprise(ENTERPRISE_OID); //Enterprise oid

    // Build the trap pdu
    Oid Trapid(COLDTRAP_OID );
    pdu.set_notify_id(Trapid) ;
    pdu.set_notify_enterprise(enterprise);
    // Get the time stamp in seconds from sysUptime class and convert
    //  it to timeticks .
    pdu.set_notify_timestamp( ( sysUpTime::get()) * 100 );
  ...

Thanks in advance,
Manjunath






More information about the AGENTPP mailing list