SNMP Trap Query - Any thoughts?

This is a discussion on SNMP Trap Query - Any thoughts? within the SNMP Users forums, part of the Networking and Network Related category; --0-1767663316-1129023666=:95200 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit I will like to ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-11-2005
BHARATKUMAR GERA
 
Posts: n/a
Default SNMP Trap Query - Any thoughts?

--0-1767663316-1129023666=:95200
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit


I will like to know regarding SNMP Trap OIDS issue I;m facing below -



- On RedHat 3 , my subagent code is able to send custom trap OID ( defined in custom mib ).

- On RedHat 4 / SUSE , with similar configuration , the subagent fails to send custom trap OID reporting "Var Bind Failure".

On Changing the code to send "{ 1,3,6,1,6,3,1,1,4,1,0}; /* snmpTrapOID.0 */" with my custom trap information - it works ! Ofcourse the trap is sent as snmpTrapOID.0 as depcited in trap log file.





I;m wondering if this is a configuration issue OR their is only provision to send snmpTrapOID.0 traps?



On both RH4 and SUSE 9 - there are additional snmp files files

- /usr/share/snmp/mib2c.notify.conf - with entry static oid snmptrap_oid[] = {1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0};



This file is NOT present in RH3. Though mib2c is only used for custom code generation - wondering?



My code change is as below ----




/* trap definition objects */
memset(&var_trap, 0, sizeof(struct variable_list));

/#if 0 // workaround to fix the problem of not showing event OID
var_trap.name = objid_snmptrap; /* snmpTrapOID.0 */
var_trap.name_length = sizeof(objid_snmptrap)/sizeof(oid); /* number of sub-ids */
//#endif

// workaround to fix the problem of not showing event OID
//var_trap.name = eventOID;
//var_trap.name_length = OIDLEN_14;
//var_trap.val.objid = eventOID;
var_trap.val.objid = objid_snmptrap;
var_trap.val_len = OIDLEN_14;
var_trap.type = ASN_OBJECT_ID;
var_trap.next_variable = &var_obj; /* next variable */

/#if 0
fprintf(stderr, "systemManagement Event-----------: \n");
printOID(var_trap.name, var_trap.name_length, "var_trap.name");
printOID(var_trap.val.objid, var_trap.val_len, "var_trap.val");
printOID(eventOID, OIDLEN_14, "eventOID");
/#endif

/* additional objects */












Send instant messages to your online friends http://uk.messenger.yahoo.com
--0-1767663316-1129023666=:95200
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<P>I will like to know regarding SNMP Trap OIDS issue I;m facing below - </P>
<P>&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - On RedHat 3 , my subagent code is able to send custom trap OID ( defined in custom mib ). </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - On RedHat 4 / SUSE , with similar configuration , the subagent fails to send custom trap OID reporting "Var Bind Failure".</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; On Changing the code to send "{ 1,3,6,1,6,3,1,1,4,1,0}; /* snmpTrapOID.0 */"&nbsp; with my custom trap information&nbsp; - it works ! Ofcourse the trap is sent as snmpTrapOID.0 as depcited in trap log file. </P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>I;m wondering if this is a configuration issue OR their is only provision to&nbsp;send snmpTrapOID.0 traps?&nbsp; </P>
<P>&nbsp;</P>
<P>On both RH4 and SUSE 9 - there are additional snmp files &nbsp;files </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; - /usr/share/snmp/mib2c.notify.conf&nbsp;&nbsp; - with entry static oid snmptrap_oid[] = {1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0};&nbsp; </P>
<P>&nbsp;</P>
<P>This file is NOT present in RH3. Though mib2c is only used for custom code generation - wondering? </P>
<P>&nbsp;</P>
<P>My code change is as below ----</P>
<P>&nbsp;</P>
<P><BR>&nbsp;/* trap definition objects */<BR>&nbsp;memset(&amp;var_trap, 0, sizeof(struct variable_list));</P>
<P>/#if 0&nbsp;&nbsp; //&nbsp; workaround to fix the problem of not showing event OID<BR>&nbsp;var_trap.name = objid_snmptrap; /* snmpTrapOID.0 */<BR>&nbsp;var_trap.name_length = sizeof(objid_snmptrap)/sizeof(oid); /* number of sub-ids */<BR>//#endif</P>
<P>&nbsp;//&nbsp; workaround to fix the problem of not showing event OID<BR>&nbsp;//var_trap.name = eventOID;<BR>&nbsp;//var_trap.name_length = OIDLEN_14;<BR>&nbsp;//var_trap.val.objid = eventOID;<BR>&nbsp;var_trap.val.objid =&nbsp; objid_snmptrap;<BR>&nbsp;var_trap.val_len = OIDLEN_14;<BR>&nbsp;var_trap.type = ASN_OBJECT_ID;<BR>&nbsp;var_trap.next_variable = &amp;var_obj; /* next variable */</P>
<P>/#if 0<BR>&nbsp;fprintf(stderr, "systemManagement Event-----------:&nbsp; \n");<BR>&nbsp;printOID(var_trap.name, var_trap.name_length, "var_trap.name");<BR>&nbsp;printOID(var_trap.val.o bjid, var_trap.val_len, "var_trap.val");<BR>&nbsp;printOID(eventOID, OIDLEN_14, "eventOID");<BR>/#endif</P>
<P>&nbsp;/* additional objects */</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </P></BLOCKQUOTE></DIV><BR><BR><p>Send instant messages to your online friends http://uk.messenger.yahoo.com
--0-1767663316-1129023666=:95200--


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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/...net-snmp-users
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:05 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0