Open yboujraf opened 4 years ago
Do you mean MIBs transformed into JSON objects (which is already done) or the entire code base rewritten in some other language (which is unlikely)?
Dear @etingof
Thanks for your quick answer.
Yes I am looking for a Mib parser where all dependencies are included in a folder and with the parser to check if no dependency is missing , if not , need to be transformed into json object into a file in Node.js and typescript or javascript ?
I read your documentation and it 's exactly what I am looking for but can't use because only supporting node.js and typescript.
This tools for us is more to look for parameters to control a device are available. You know most of the time the sale guy sell more than the device can do or could do ;-)
This is the example I have found in github but for example when it is a sequence, it is not clear and missing the all definition of the asn structure :
Could you try if you could parse and create the json file ?
TT1260-MIBS.zip RX1290_MIBs.zip
Thanks in advance if you could help me or share some links ?
Best Regards, Youssef
I am still confused, I am not sure I understand what you need.
If you have MIB in JSON form, can't it be readily consumed by JS code?
PySMI parser will fail on unresolved dependencies between MIB modules. So JSONs it produces are always valid in that regard.
If you are looking for some other structure of JSON document, PySMI is entirely driven by Jinja2 templates - you can create your own and render some other JSON.
Dear @etingof
Sorry to confusing you.
I have only Mib files with dependencies sometime missing and need to google to download it.
Now I need to parse the Mib files with the dependencies and to transform them into json object and look like we have a mib browser.
the picture is just to showing the structure expected but we don't want to create a mib browser.
We have a gateway that needs to exchange data between snmp and proprietary protocol.
Then If I could parse the mibs , generate with success the json object file, I am saved ;-)
Again Best regards Youssef
PySMI's mibdump
tool can generate a JSON like this from any given MIB. The tool will attempt to download dependencies from mibs.snmplabs.com. If the dependency is missing, the whole compilation will fail.
If JSON structure referenced above does not suit your needs, you can probably reshape it with common JSON manipulation tools.
Writing a MIB parser is nothing new than applying lex & yacc to the ASN.1 and SMI based grammar. So, if this project can do it for Python, you can also do the same for JavaScript/TypeScript.
Writing parsers/compilers is not a trivial topic even for computer science students. Therefore, rarely you see an open source one if clearly there is value in it.
Dear
any chance to have your mib parser in nodejs and typescript or javascript?
Best Regards Youssef