m |
|||
Line 1: | Line 1: | ||
− | YANG2SMI is an extensible output plugin for pyang. This plugin can be used to generate MIB model from YANG data | + | ==Introduction== |
+ | :YANG2SMI is an extensible output plugin for pyang. This plugin can be used to generate MIB model from YANG model data. | ||
Step to convert YANG to MIB model: | Step to convert YANG to MIB model: | ||
− | + | # You need an installation of pyang: | |
− | + | ## cd <SAFplus-Management-Framework>/3rdparty | |
− | + | ## make pyang | |
− | + | #Add the YANG2SMI plugin to your existing pyang installation. This may be done in one of the following three ways: | |
− | + | ##Add <SAFplus-Management-Framework>/model/src/extras/pyplugin/yang2smi.py to <SAFplus-Management-Framework>/3rdparty/pyang/pyang/plugins, | |
− | + | ##Add the location of <SAFplus-Management-Framework>/model/src/extras/pyplugin/yang2smi.py to the $PYANG_PLUGINPATH environment variable, or | |
− | + | ##Use the --plugindir option of pyang each time you want to use YANG2SMI | |
− | + | #Change directory to <SAFplus-Management-Framework>/3rdparty/pyang and launch pyang with specific yang2smi output format, YANG module file, OID root module and MIB model file. | |
− | + | ||
− | + | ||
− | + | ||
For example, to generate the network.yang to NETWORK.MIB , type: | For example, to generate the network.yang to NETWORK.MIB , type: | ||
− | + | root@desktop:/# source env.sh;./bin/pyang -f yang2smi network.yang --yang2smi-oid=99840 -o NETWORK.MIB | |
− | + |
Latest revision as of 07:13, 23 January 2013
[edit] Introduction
- YANG2SMI is an extensible output plugin for pyang. This plugin can be used to generate MIB model from YANG model data.
Step to convert YANG to MIB model:
- You need an installation of pyang:
- cd <SAFplus-Management-Framework>/3rdparty
- make pyang
- Add the YANG2SMI plugin to your existing pyang installation. This may be done in one of the following three ways:
- Add <SAFplus-Management-Framework>/model/src/extras/pyplugin/yang2smi.py to <SAFplus-Management-Framework>/3rdparty/pyang/pyang/plugins,
- Add the location of <SAFplus-Management-Framework>/model/src/extras/pyplugin/yang2smi.py to the $PYANG_PLUGINPATH environment variable, or
- Use the --plugindir option of pyang each time you want to use YANG2SMI
- Change directory to <SAFplus-Management-Framework>/3rdparty/pyang and launch pyang with specific yang2smi output format, YANG module file, OID root module and MIB model file.
For example, to generate the network.yang to NETWORK.MIB , type:
root@desktop:/# source env.sh;./bin/pyang -f yang2smi network.yang --yang2smi-oid=99840 -o NETWORK.MIB