pysmi icon indicating copy to clipboard operation
pysmi copied to clipboard

Convert a local mib file to json.

Open Aleksey-Surnov opened this issue 3 years ago • 1 comments

Hello friends. I need to convert a local file MIB to the format json. How can I do this using pysmi? I didn't quite understand the example commands. The file that needs to be translated is attached. The file of MIB is located in the python script folder. The result json file must be in the python script folder. Please give an example of the command for mibdump.py or example of a program that will do this for my MIB file.

IDE Pycharm MIB file you can download here https://www.shtyl.ru/support/download/software/mib-fajl-dlya-ustanovok-ehlektropitaniya/ Just in case, I also attach the MIB Shtyl_MIB_18_v367.zip

Aleksey-Surnov avatar Nov 06 '20 07:11 Aleksey-Surnov

Rename downloaded file to Shtyl-MIB.mib

mv Shtyl_MIB_18_v367.mib Shtyl-MIB.mib

Then let's assume you have it in $HOME/Downloads

cd ~/Downloads
mibdump.py --generate-mib-texts  --destination-format json --mib-source . Shtyl-MIB

This will convert it to json and you will have file Shtyl-MIB.json under your ~/Downloads dir

DmitryZayats avatar Dec 29 '20 16:12 DmitryZayats