Hi,
      I am new to net snmp. I am trying to get the trap of variable which is 
automatically generated by agent . By mib2c i get a code but i am unable to get 
trap from agent .My code is 

  static const oid snmptrap_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0};
int
send_mySysDown_trap(void)
{
    netsnmp_variable_list *var_list = NULL;
    const oid       mySysDown_oid[] = { 1, 3, 6, 1, 4, 1, xxxxx, 1, 2, 1 };
    const oid       teleSysStatus_oid[] =
        { 1, 3, 6, 1, 4, 1, xxxx, 1, 1, 1, 1, 2, 0 /* insert index here */
        };

    /*
     * Set the snmpTrapOid.0 value
     */
int *teleSysStatus = 1;
snmp_varlist_add_variable(&var_list,
                              snmptrap_oid, OID_LENGTH(snmptrap_oid),
                              ASN_OBJECT_ID,
                              mySysDown_oid, sizeof(mySysDown_oid));
    /*
     * Add any objects from the trap definition
     */
    snmp_varlist_add_variable(&var_list,
                              teleSysStatus_oid,
                              OID_LENGTH(teleSysStatus_oid), ASN_INTEGER,
                              /*
                               * Set an appropriate value for teleSysStatus 
                               */
                              &teleSysStatus,sizeof(teleSysStatus));

send_v2trap(var_list);

    snmp_free_varbind(var_list);

    return SNMP_ERR_NOERROR;
}
i put this code with my .c file of agent
i am unable to get trap...
any help will be appriciated...


      
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to