This is a discussion on Fwd: vp->magic and OID passed by snmpd within the SNMP Coders forums, part of the Networking and Network Related category; --===============1659773563== Content-Type: multipart/alternative; boundary="----=_Part_88750_7742493.1182424037960" ------=_Part_88750_7742493.1182424037960 Content-Type: text/plain; charset=ISO-8859-1; ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
--===============1659773563==
Content-Type: multipart/alternative; boundary="----=_Part_88750_7742493.1182424037960" ------=_Part_88750_7742493.1182424037960 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Sincere Apologies.. I copied the wrong error in my last mail.. I error I get is: RFC1155-SMI::enterprises.6305.1.10.1.2.1.2.18.1.1.1 = No Such Instance currently exists at this OID ---------- Forwarded message ---------- From: Shivani Garg <shivanigarg02@gmail.com> Date: Jun 21, 2007 4:35 PM Subject: vp->magic and OID passed by snmpd To: net-snmp-coders@lists.sourceforge.net, net-snmp-users@lists.sourceforge.net Greetings to all. I am using the code generated by mib2c for my MIB file. It contains an array like this.. : *oid systemInfo_variables_oid[] = { 1, 3, 6, 1, 4, 1, 6305, 1, 10, 1, 2, 1 };* *struct variable7 systemInfo_variables[] = {* *.* *.* *.* */* Out of all the elements of array, one is below, pasting only relevant code here */* *#define OVERALLDISKOCCUPANCYINKB 276* * {OVERALLDISKOCCUPANCYINKB, ASN_UNSIGNED, RONLY, var_systemDiskStatsNotfyAttrTable, 4, {2, 18, 1, 1}},* *.* *.* *.* *}* When I fire a snmpget for OID 1.3.6.1.4.1.6305.1.10.1.2.1.2.18.1.1.1, I get an error like this: RFC1155-SMI::enterprises.6305.1.10.1.2.1.2.18.1.2.1 = No Such Instance currently exists at this OID In my function, when I print OID and vp->magic, OID passed is correct whereas vp->magic is not 276 and hence the relevant case for the switch statement is not hit. snmpd calls var_systemDiskStatsNotfyAttrTable with incorrect vp->magic. Any anyone give me some pointers on this... I have copied the relevant code below: */* * var_systemDiskStatsNotfyAttrTable(): * Handle this table separately from the scalar value case. * The workings of this are basically the same as for var_systemInfo above. */ unsigned char * var_systemDiskStatsNotfyAttrTable (struct variable *vp, oid * name, size_t * length, int exact, size_t * var_len, WriteMethod ** write_method) { ..* *.* *switch (vp->magic) { case OVERALLDISKOCCUPANCYINKB: VAR = (int*)&p_resp->overall_disk_occupancy; /* XXX ** * default:* * ERROR_MSG(" ");* * }* *.* *.* *}* Thanks a lot in advance for your help. Shivani ------=_Part_88750_7742493.1182424037960 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline <div>Sincere Apologies..</div> <div>I copied the wrong error in my last mail..</div> <div> </div> <div>I error I get is:</div> <div>RFC1155-SMI::enterprises.6305.1.10.1.2.1.2.18.1.1.1 = No Such Instance currently exists at this OID<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Shivani Garg </b> <<a href="mailto:shivanigarg02@gmail.com">shivanigarg0 2@gmail.com</a>><br>Date: Jun 21, 2007 4:35 PM<br>Subject: vp->magic and OID passed by snmpd<br>To: <a href="mailto:net-snmp-coders@lists.sourceforge.net"> net-snmp-coders@lists.sourceforge.net</a>, <a href="mailto:net-snmp-users@lists.sourceforge.net">net-snmp-users@lists.sourceforge.net</a><br><br> </span></div> <div>Greetings to all.</div> <div> </div> <div>I am using the code generated by mib2c for my MIB file. It contains an array like this.. :</div> <div> <p><strong>oid systemInfo_variables_oid[] = { 1, 3, 6, 1, 4, 1, 6305, 1, 10, 1, 2, 1 };</strong></p></div> <div><strong>struct variable7 systemInfo_variables[] = {</strong></div> <div><strong>.</strong></div> <div><strong>.</strong></div> <div><strong>.</strong></div> <div><strong>/* Out of all the elements of array, one is below, pasting only relevant code here */</strong></div> <div> <p><strong><font color="#ff6666">#define OVERALLDISKOCCUPANCYINKB 276</font></strong></p> <p><strong> {OVERALLDISKOCCUPANCYINKB, ASN_UNSIGNED, RONLY,<br> var_systemDiskStatsNotfyAttrTable, 4, {2, 18, 1, 1}},</strong></p> <p><strong>.</strong></p> <p><strong>.</strong></p> <p><strong>.</strong></p> <p><strong>}</strong></p> <p> </p> <p>When I fire a snmpget for OID 1.3.6.1.4.1.6305.1.10.1.2.1.2.18.1.1.1, I get an error like this:</p><font face="Helv" size="2"> <p>RFC1155-SMI::enterprises.6305.1.10.1.2.1.2.18.1.2.1 = No Such Instance currently exists at this OID</p></font> <p>In my function, when I print OID and vp->magic, OID passed is correct whereas vp->magic is not 276 and hence the relevant case for the switch statement is not hit. snmpd calls var_systemDiskStatsNotfyAttrTable with incorrect vp->magic. Any anyone give me some pointers on this... I have copied the relevant code below: </p> <p><strong>/*<br> * var_systemDiskStatsNotfyAttrTable():<br> *&nb sp; Handle this table separately from the scalar value case.<br> * The workings of this are basically the same as for var_systemInfo above.<br> */<br>unsigned char * <br>var_systemDiskStatsNotfyAttrTable (struct variable *vp,<br> oid * name,<br> size_t * length,<br> int exact,<br> size_t * var_len,<br> WriteMethod ** write_method)<br>{<br>.</strong></p> <p><strong>.</strong></p> <p><strong>switch (vp->magic)<br> {<br><font color="#ff0000"> case OVERALLDISKOCCUPANCYINKB:<br> &nb sp; VAR = (int*)&p_resp->overall_disk_occupancy; /* XXX *</font></strong></p> <p><strong> default:</strong></p> <p><strong> &nb sp; ERROR_MSG(" ");</strong></p> <p><strong> }</strong></p> <p><strong>.</strong></p> <p><strong>.</strong></p> <p><strong>}</strong></p> <p>Thanks a lot in advance for your help.</p> <p>Shivani</p></div> ------=_Part_88750_7742493.1182424037960-- --===============1659773563== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ --===============1659773563== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/...et-snmp-coders --===============1659773563==-- |
![]() |
| Thread Tools | |
| Display Modes | |
|
|