Q: Traps Problem

manjunath ramaiah manjunath.ramaiah____wipro.com
Sat Oct 14 05:50:41 CEST 2000



Hi ,

I am using snmp++ to send the traps . If snmp v2 trap  was sent it
was not received by HP-NNM  Manager .
In the file snmpmsg.cpp the function
SnmpMessage::load( Pdu pdu,OctetStr community, snmp_version version)
the snmptrap pdu is built . If the trap pdu is V2 then the

first varbind is sysuptime and second is snmptrapid . In the above
function
the sysuptime is correct . But the OID of snmpTrap id is set as
1.3.6.1.6.3.1.1.5  which is wrong as the OID of snmpTrapid is
1.3.6.1.6.3.1.1.4.1.0.

The code is as follows
 // vb #2 is the id
        Oid trapid;
    //  tempvb.set_oid("1.3.6.1.6.3.1.1.5");
        // Manju Changed the OID
        tempvb.set_oid("1.3.6.1.6.3.1.1.4.1.0");
        pdu.get_notify_id( trapid);
        tempvb.set_value( trapid);
        temppdu += tempvb;

After  this fix , i am able to receive the traps in NNM .
Is this fix correct ?

One more observation
---------------------
If snmpv1 traps are sent then agent_address field is added to the
pdu in the above function . To get the agent address first gethostname
call is made and then gethostbyname call is made to resolve the
name to ipaddress . If there is no entry in the /etc/hosts file
for the hostname of the M/c sending the trap then gethostbyname()
call is returning NULL . As a result the agent address field in the
pdu is FF FF FF FF.

Thanks
Manjunath



More information about the AGENTPP mailing list