Hi,

I am trying to send traps from a sub-agent.  I have used the template as
following to do the work, but I did not receive anything at the other
end using snmpdtrapd to monitor.

My question is in the following code, how does net-snmp know the
destination's IP address?  Why the other end doesn't receive anything?

 

static const oid snmptrap_oid[] = {1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0};

 

int

send_demo-notif_trap( void )

{

    netsnmp_variable_list  *var_list = NULL;

    const oid demo-notif_oid[] = { 1,3,6,1,4,1,3231,101,5,1,101,0,37 };

    const oid sysLocation_oid[] = { , /* insert index here */ };

 

    /*

     * Set the snmpTrapOid.0 value

     */

    snmp_varlist_add_variable(&var_list,

        snmptrap_oid, OID_LENGTH(snmptrap_oid),

        ASN_OBJECT_ID,

        demo-notif_oid, sizeof(demo-notif_oid));

    

    snmp_varlist_add_variable(&var_list,

        sysLocation_oid, OID_LENGTH(sysLocation_oid),

        ,

        /* Set an appropriate value for sysLocation */

        NULL, 0);

 

    /*

     * Add any extra (optional) objects here

     */

 

    /*

     * Send the trap to the list of configured destinations

     *  and clean up

     */

    send_v2trap( var_list );

    snmp_free_varbind( var_list );

 

    return SNMP_ERR_NOERROR;

}

 

Thanks

Chi

  

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to