5  Creating MIB Instrumentation

To convert a MIB module to a YANG module and add Server Instrumentation Library (SIL) code the following steps should be followed. The example below uses the IF-MIB. An example version of the IF-MIB SIL is provided with YumaPro SDK.

 

  1. Convert the selected MIB module to a YANG module using the smidump tool from: https://www.ibr.cs.tu-bs.de/projects/libsmi/download.html?lang=de

     

     

 

smidump -f yang --yang-smi-extensions IF-MIB > IF-MIB.yang

 

 

  1.  You should validate the conversion using yangdump-pro. If you want to supply additional parameters to yangdump-pro for your environment see the user manual yumapro-yangdump-manual.pdf or man pages.

     

 

 

yangdump-pro IF-MIB > ~/yangdump_output.log

 

 

  1. Copy the yang files into your work folder.

  2. Run make_sil_dir_pro to generates the instrumentation source code.

     

 

 

make_sil_dir_pro --split IF-MIB

 

 

  1. Modify the instrumentation code as needed. You will see the tag that say “insert xxx code”. The process of converting the MIB to YANG creates smi:oid "x.y.z" tags in the YANG module for leaf instrumentation. Only the leafs with the smi:oid tag will be seen from an SNMP client. See the following section “SNMP to YANG mapping”

 

  1. Once you’ve finished with the instrumentation code compile the code using

 

 

make DEBUG=1

 

  1.  

  2. install the code using

 

 

sudo make DEBUG=1 install

 

 

NOTE: "DEBUG=1" is an optional and used to enable debug logging.

 

This will install the generated library in the system path for netconfd-pro to load.

 

5.1  SNMP to YANG mapping

Only YANG leaf objects that have the smi:oid "x.y.z" tags will be visible for netconfd-pro SNMP engine. All other objects will be ignored, and the server will report that there is no such an object or will jump into the next object in case of snmpgetnext.

YANG data model cannot be utilized in full if it needs to represent MIB module. After the MIB to YANG conversion the YANG module will have several limitations and some of the regular YANG features and properties will be either ignored by the netconfd-pro server or even invalid. The following list illustrates the limitations:

 

NOTE:

The netconfd-pro SNMP server only fully supports YANG modules that were converted from MIB using smidump tool. Even though, it is possible to make an existing module to be SNMP server compatible but it may take a lot effort and may not be even possible since the data model will have to be adjusted. It is not recommended to manually convert YANG module to be SNMP compatible and the netconfd-pro server problems related to this module will not be supported.