This is a discussion on vp->magic and OID passed by snmpd within the SNMP Coders forums, part of the Networking and Network Related category; --===============2061593929== Content-Type: multipart/alternative; boundary="----=_Part_88742_31190690.1182423907177" ------=_Part_88742_31190690.1182423907177 Content-Type: text/plain; charset=ISO-8859-1; ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
--===============2061593929==
Content-Type: multipart/alternative; boundary="----=_Part_88742_31190690.1182423907177" ------=_Part_88742_31190690.1182423907177 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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_88742_31190690.1182423907177 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline <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_88742_31190690.1182423907177-- --===============2061593929== 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/ --===============2061593929== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============2061593929== 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/ --===============2061593929== 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 --===============2061593929==-- |