https://net-snmp.sourceforge.io/wiki/index.php?title=TUT:mib2c_General_Overview&feed=atom&action=history TUT:mib2c General Overview - Revision history 2024-03-28T15:37:40Z Revision history for this page on the wiki MediaWiki 1.26.3 https://net-snmp.sourceforge.io/wiki/index.php?title=TUT:mib2c_General_Overview&diff=5536&oldid=prev Rstory at 13:18, 19 April 2012 2012-04-19T13:18:44Z <p></p> <table class='diff diff-contentalign-left'> <col class='diff-marker' /> <col class='diff-content' /> <col class='diff-marker' /> <col class='diff-content' /> <tr style='vertical-align: top;' lang='en'> <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:18, 19 April 2012</td> </tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l29" >Line 29:</td> <td colspan="2" class="diff-lineno">Line 29:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.array-user.conf &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.array-user.conf &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.create-dataset.conf &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.create-dataset.conf &#160;</div></td></tr> <tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.int_watch.conf &#160;</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; <ins class="diffchange diffchange-inline">[[TUT:mib2c_int_watch|</ins>mib2c.int_watch.conf<ins class="diffchange diffchange-inline">]]</ins></div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.iterate.conf &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.iterate.conf &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.iterate_access.conf &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.iterate_access.conf &#160;</div></td></tr> <tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l35" >Line 35:</td> <td colspan="2" class="diff-lineno">Line 35:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.notify.conf &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.notify.conf &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.old-api.conf &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.old-api.conf &#160;</div></td></tr> <tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; mib2c.scalar.conf &#160;</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; <ins class="diffchange diffchange-inline">[[TUT:mib2c_scalar|</ins>mib2c.scalar.conf<ins class="diffchange diffchange-inline">]]</ins></div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>&#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Running mib2c without specifying a configuration file will prompt you with some questions to help determine which one might be appropriate for your situation. &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Running mib2c without specifying a configuration file will prompt you with some questions to help determine which one might be appropriate for your situation. &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr> </table> Rstory https://net-snmp.sourceforge.io/wiki/index.php?title=TUT:mib2c_General_Overview&diff=2645&oldid=prev Sigi at 10:40, 1 June 2007 2007-06-01T10:40:31Z <p></p> <table class='diff diff-contentalign-left'> <col class='diff-marker' /> <col class='diff-content' /> <col class='diff-marker' /> <col class='diff-content' /> <tr style='vertical-align: top;' lang='en'> <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 10:40, 1 June 2007</td> </tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l16" >Line 16:</td> <td colspan="2" class="diff-lineno">Line 16:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; And making sure you can get snmptranslate to display information about</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>&#160;&#160; And making sure you can get snmptranslate to display information about</div></td></tr> <tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>your MIB node.&#160; Once snmptranslate works, then come back and try mib2c</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">&#160; </ins>your MIB node.&#160; Once snmptranslate works, then come back and try mib2c</div></td></tr> <tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>again.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">&#160; </ins>again.</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>So, if you are interested in generating code for your table XYZTable, make sure that &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>So, if you are interested in generating code for your table XYZTable, make sure that &#160;</div></td></tr> </table> Sigi https://net-snmp.sourceforge.io/wiki/index.php?title=TUT:mib2c_General_Overview&diff=2398&oldid=prev Wes at 17:12, 8 February 2007 2007-02-08T17:12:43Z <p></p> <table class='diff diff-contentalign-left'> <col class='diff-marker' /> <col class='diff-content' /> <col class='diff-marker' /> <col class='diff-content' /> <tr style='vertical-align: top;' lang='en'> <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 17:12, 8 February 2007</td> </tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l49" >Line 49:</td> <td colspan="2" class="diff-lineno">Line 49:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>So once you&#039;ve generated the template (aka skeleton) code for your mib, you need to edit the code and implement the portions of the code specific to your module. As more elaborate configuration files are developed, it should become simpler to identify the what/when/where portions of the code (the MFD configuration file is the latest step towards this goal - see the MFD tutorial [http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/ here]). &#160;</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>So once you&#039;ve generated the template (aka skeleton) code for your mib, you need to edit the code and implement the portions of the code specific to your module. As more elaborate configuration files are developed, it should become simpler to identify the what/when/where portions of the code (the MFD configuration file is the latest step towards this goal - see the MFD tutorial [http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/ here]). &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr> <tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The next section covers the shell script mib2c-update, which is a wrapper around mib2c to help you take advantage of updates to the configuration file you chose for your mib module.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The next section covers the shell script <ins class="diffchange diffchange-inline">[[TUT:</ins>mib2c-update <ins class="diffchange diffchange-inline">| mib2c-update]]</ins>, which is a wrapper around mib2c to help you take advantage of updates to the configuration file you chose for your mib module.</div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>&#160;</div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">{{TUT:LIST}}</ins></div></td></tr> </table> Wes https://net-snmp.sourceforge.io/wiki/index.php?title=TUT:mib2c_General_Overview&diff=2397&oldid=prev Wes at 17:09, 8 February 2007 2007-02-08T17:09:22Z <p></p> <p><b>New page</b></p><div>This brief tutorial presents an overview of generating skeleton C code for a SNMP MIB using the mib2c utility. <br /> <br /> For mib2c to work, it needs to be able to find the MIB file that defines the MIB for which it will be generating code. Running mib2c without arguments informs you of this: <br /> <br /> You didn&#039;t give mib2c a valid OID to start with. IE, I could not find<br /> any information about the mib node &quot;&quot;. This could be caused<br /> because you supplied an incorrectly node, or by the MIB that you&#039;re<br /> trying to generate code from isn&#039;t loaded. To make sure your mib is<br /> loaded, run mib2c using this as an example:<br /> <br /> env MIBS=&quot;+MY-PERSONAL-MIB&quot; mib2c<br /> <br /> You might wish to start by reading the MIB loading tutorial at:<br /> <br /> http://www.net-snmp.org/wiki/index.php/TUT:Using_and_loading_MIBS<br /> <br /> And making sure you can get snmptranslate to display information about<br /> your MIB node. Once snmptranslate works, then come back and try mib2c<br /> again.<br /> <br /> So, if you are interested in generating code for your table XYZTable, make sure that <br /> <br /> snmptranslate -IR XYZTable<br /> <br /> works first. <br /> <br /> When you run mib2c, you must specify a MIB node for it to process. You can also specify which configuration file you would like it to use to generate the code. The available options are: <br /> <br /> mib2c.array-user.conf <br /> mib2c.create-dataset.conf <br /> mib2c.int_watch.conf <br /> mib2c.iterate.conf <br /> mib2c.iterate_access.conf <br /> mib2c.mfd.conf <br /> mib2c.notify.conf <br /> mib2c.old-api.conf <br /> mib2c.scalar.conf <br /> Running mib2c without specifying a configuration file will prompt you with some questions to help determine which one might be appropriate for your situation. <br /> <br /> One thing many people get confuse about is what to do after running mib2c. Contrary to popular belief, simply running mib2c on a MIB does not generate a complete implementation for the module, as indicated by this warning printed after running mib2c without specifying a configuration file: <br /> <br /> **********************************************************************<br /> * NOTE WELL: The code generated by mib2c is only a template. *YOU* *<br /> * must fill in the code before it&#039;ll work most of the time. In many *<br /> * cases, spots that MUST be edited within the files are marked with *<br /> * /* XXX */ or /* TODO */ comments. *<br /> **********************************************************************<br /> <br /> So once you&#039;ve generated the template (aka skeleton) code for your mib, you need to edit the code and implement the portions of the code specific to your module. As more elaborate configuration files are developed, it should become simpler to identify the what/when/where portions of the code (the MFD configuration file is the latest step towards this goal - see the MFD tutorial [http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/ here]). <br /> <br /> The next section covers the shell script mib2c-update, which is a wrapper around mib2c to help you take advantage of updates to the configuration file you chose for your mib module.</div> Wes