<div dir="ltr">Hi,<div><br></div><div>My memories about the OTP MIB compiler are not very fresh, but back in the days I used it a lot I noticed that it's much more picky than other MIB-handling tools. Errors like the ones you encountered had to be fixed manually in most MIBs we got from equipment vendors. For example the TEXTUAL-CONVENTION macro is defined in SNMPv2-TC, and I guess most other tools simply auto-import all these definitions from the standard MIBs. When working with the OTP MIB compiler, you have to explicitly import it. mib-2 is similarly defined in SNMPv2-SMI, and you have to explicitly import it from there.</div><div><br></div><div>An other common issue was object identifiers defined in reverse order (parent comes after child in the MIB file). You have to simply reverse the order of the definitions to please the compiler.</div><div><br></div><div>Hope it helps,</div><div>Daniel</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 29 Aug 2019 at 18:46, Wolf, Dave <<a href="mailto:dave.wolf@siemens.com">dave.wolf@siemens.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_-5493120601762313757WordSection1">
<p class="MsoNormal">Hi all,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am working on an SNMP application that polls SNMP devices and currently it works fine if I use OIDs, but I’d like to be able to load the MIB file for the device and poll using the name associated with the OID. The issue I am running
into is that for most of my MIB files I downloaded from the manufacturer sites, the MIB compiler in Erlang encounters errors during the compile to .bin format. I am wondering if I need to compile it in a certain directory, but I am not sure why it is failing.
Here are beginning lines of the output from an example (full errors attached in output.txt) of this command: “erlc UPS-MIB.mib”. I have tried this on Windows and Linux hosts with the same results.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">UPS-MIB.mib: 38: Macro 'TEXTUAL-CONVENTION' not imported.<u></u><u></u></p>
<p class="MsoNormal">UPS-MIB.mib: 45: Macro 'TEXTUAL-CONVENTION' not imported.<u></u><u></u></p>
<p class="MsoNormal">UPS-MIB.mib: 18: OBJECT IDENTIFIER [upsMIB] defined in terms of undefined parent object. Parent: ''mib-2''.(Sub-indexes: [33].)<u></u><u></u></p>
<p class="MsoNormal">UPS-MIB.mib: 52: OBJECT IDENTIFIER [upsObjects] defined in terms of undefined parent object. Parent: 'upsMIB'.(Sub-indexes: [1].)<u></u><u></u></p>
<p class="MsoNormal">UPS-MIB.mib: 62: OBJECT IDENTIFIER [upsIdent] defined in terms of undefined parent object. Parent: 'upsObjects'.(Sub-indexes: [1].)<u></u><u></u></p>
<p class="MsoNormal">UPS-MIB.mib: 64: OBJECT IDENTIFIER [upsIdentManufacturer] defined in terms of undefined parent object. Parent: 'upsIdent'.(Sub-indexes: [1].)<u></u><u></u></p>
<p class="MsoNormal">UPS-MIB.mib: 72: OBJECT IDENTIFIER [upsIdentModel] defined in terms of undefined parent object. Parent: 'upsIdent'.(Sub-indexes: [2].)<u></u><u></u></p>
<p class="MsoNormal"><<snip>><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’ve attached the MIB file in case someone wants to give it a shot and tell me the errors of my ways. I have loaded this exact MIB file into a MIB browser and it works just fine, I can browse the device without any issues. Is there another
way I can compile this MIB file? Is it in a common format that other tools might be able to compile?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">If anyone has any suggestions or needs further infomation, please let me know.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks!<u></u><u></u></p>
<p class="MsoNormal">Dave Wolf.<u></u><u></u></p>
</div>
</div>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>