State of local MIB -> JSON support?
See original GitHub issueHi, wondering about the state of JSON support. Noticed it’s not in v0.0.7, so pulling off of master branch. Trying to generate JSON files from local MIBs but am not having success. The index gets generated but there’s no content in it. Using the following code:
def transform_mibs_to_json(self, specific_mibs=None, exclude_mibs=['test-mib.my']):
mib_names = []
if specific_mibs is None:
for filename in os.listdir(self.local_mib_dir):
try: filename.rindex('.my', -3)
except: continue
mib_names.append(filename)
else:
mib_names = specific_mibs.copy()
try:
mib_compiler = MibCompiler(
SmiV1CompatParser(),
JsonCodeGen(),
FileWriter(self.local_json_dir).setOptions(suffix='.json')
)
mib_compiler.addSources(FileReader(self.local_mib_dir, recursive=True))
mib_stubs = JsonCodeGen.baseMibs
searchers = [AnyFileSearcher(self.local_json_dir).setOptions(exts=['.json']), StubSearcher(*mib_stubs)]
mib_compiler.addSearchers(*searchers)
if not os.path.isdir(self.local_json_dir):
os.makedirs(self.local_json_dir)
processed = mib_compiler.compile(
*mib_names,
**dict(
noDeps=False,
rebuild=True,
genTexts=True,
writeMibs=True,
ignoreErrors=False
)
)
mib_compiler.buildIndex(
processed,
ignoreErrors=False
)
except error.PySmiError:
sys.stderr.write('ERROR: %s\n' % sys.exc_info()[1])
sys.exit(-1)
See anything wrong in usage? Will try and submit a fix if it’s a bug. Any pointers or thoughts?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Network Management Interfaces - NVIDIA Networking Docs
Mellanox private MIBs. Standard MIBs. The following table presents the supported textual conventions and conformance MIBs: MIB, Standard.
Read more >python-pysmi(1) - Arch manual pages
The PySMI library and tools are designed to parse, verify and transform SNMP SMI MIB modules from their original ASN.1 form into JSON...
Read more >SNMP MIBs and Traps Supported by Junos OS
Standard MIB Exceptions Platforms
IEEE, 802.1ag, Connectivity Fault Management EX Series, MX Series...
RFC 1901, Introduction to Community‑based SNMPv2 No exceptions All platforms
RFC 3621, Power...
Read more >K13322: Overview of BIG-IP MIB files - AskF5
F5-BIGIP-LOCAL-MIB.txt, Defines LTM objects, such as virtual servers, pools, nodes, profiles, SNATs, health monitors, and iRules.
Read more >MIB File ePMP 1000 - Cambium Support Center
Trap catches JSON configuration export state. This state is indicated by the included value of cambiumJSONCfgExportError. Device Allocation: AP, SM.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My guess is that pysmi compiler can’t find dependent MIBs. To figure that out you should look into the
processed
dictionary – it carries status and indicates missing dependencies.My other suggestion would be to enable debugging:
so it will show you (on stderr) which MIBs it wants to load, where it tries to look them up and ultimately failed.
Once you give it access to all MIBs your MIB depends on, it should be able to compile everything into JSON. Let me know if you need help with this.
Closing as conversion of MIBs to JSON is supported and continuing issue is tangential.