3

I am new to MIB-Management information base. I am confuse, What is called MIB modules?

here it is defined as: An adapted subset of ASN.1, Structure of Management Information (SMI), is specified in SNMP to define sets of related MIB objects; these sets are termed MIB modules.

But its not clear to me!

Is complete MIB file called a MIB-module? or an object is a MIB-Module eg. OBJECT-TYPE?

Ilmari Karonen
  • 49,047
  • 9
  • 93
  • 153
Grijesh Chauhan
  • 57,103
  • 20
  • 141
  • 208
  • `Why down-voted?` comment please..It was just my first day question and its really a question..But now I have been developed a MIB-Parser. – Grijesh Chauhan Jan 11 '13 at 07:57
  • @IlmariKaronen Why edited? I mean `MIBS` is terminology from any where else? – Grijesh Chauhan Jan 11 '13 at 08:04
  • [tag:mib] and [tag:mibs] are duplicate tags: they mean the exact same thing. They ought to be merged, but since there aren't _that_ many questions tagged with [tag:mibs], I figured I'd just do it by hand and not bother the mods with it. While retagging, I'm also upvoting any good questions I come across and downvoting any poor or unclear ones. I may have been hasty in downvoting yours -- alas, I can't undo the downvote unless it's edited again, but if were to clean it up and clarify it a little, I'd be happy to do that. – Ilmari Karonen Jan 11 '13 at 08:14
  • @IlmariKaronen Good!... I have got answer.And Ahaa!! you are P.hd. guy.. – Grijesh Chauhan Jan 11 '13 at 08:20
  • Not quite yet, but I'm working on it... :) – Ilmari Karonen Jan 11 '13 at 08:21
  • @IlmariKaronen Lots of good luck to you for Ph.d... – Grijesh Chauhan Jan 11 '13 at 08:24

1 Answers1

4

Usually, a MIB document contains only one MIB module. For example,

https://github.com/lextm/sharpsnmplib/blob/master/Tests/Resources/SNMPv2-MIB.txt

This file contains only one module, which is the best practice you should follow,

SNMPv2-MIB DEFINITIONS ::= BEGIN
...
END

However, the SMI rules do not prevent you from defining several modules in the same files. You can try it out by merging several files together, and most MIB compilers are happy to compile the merged result.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • Thanks... What is the need to several modules in the same MIB file? – Grijesh Chauhan Oct 06 '12 at 12:41
  • 1
    Nothing special. Just repeat: DEFINITIONS ::= BEGIN .. END. As the enter your MIB, just like SNMPv2-MIB as shown in Lex's example. Remember to avoid mib module name duplications. – lucassm Oct 06 '12 at 12:53
  • 1
    There is no need to keep several modules in the same MIB file, *but the standard does not prevent you*. – Lex Li Oct 06 '12 at 13:14
  • @lucassm and Lex Li :Can we have 2 different MIB files but having same MIB-module name. – Grijesh Chauhan Oct 06 '12 at 17:35
  • @LexLi : Hi, I am assigned to design an MIB-Parser! And i found two open-source tool: libsmi & net-snmp. libsmi has some bug (i found). I decided to work with net-snmp but code is too length and complex to understand ...can you suggest me some other links and references on this. – Grijesh Chauhan Oct 07 '12 at 04:59
  • If you are required to build the parser using C, I am not familiar with that area. But what are the bugs you found abuot libsmi? Sometimes when it fails to compile a MIB document, the MIB document itself can be the culprit. So many of them out there do not match the standard. – Lex Li Oct 08 '12 at 06:44
  • 1
    @Grijesh: The MIB module name shall uniquely identify the group of defined OIDs within. In other words, having two MIB modules with the same MIB name is ambiguous and when read together into the same MIB browser may produce errors, undefined behavior or even merge both into one OID tree - depends on a browser. Remember that MIB module name is associated with Module Identity which is a sub-OID defining the MIB module position in the enterprise specific OID tree. This should be unique. My question is what do you want to achieve by making two different MIB files with the same MIB module names? – lucassm Oct 09 '12 at 07:42
  • @lucassm It was just an question, my lack of concept...I am quite clear about this now. – Grijesh Chauhan Oct 09 '12 at 07:52
  • @Grijesh: Ok. Let me know if you have any additional questions. Cheers. – lucassm Oct 09 '12 at 07:55
  • @lucassm : Fist of all thanks. Can tell me what are 'compliance statements for MIB modules' And Why Object Groups are used? Why there nomenclature is to hard in MIB theory... Presently I am exploring code of net-snmp's 'parse.c'. I have questions on that also.... – Grijesh Chauhan Oct 09 '12 at 08:57
  • @LexLi : Yes, its true! Problem is with my MIBs(from vihaan).Its not libsmi. Libsmi do stick formate check on input MIB before parse. – Grijesh Chauhan Oct 09 '12 at 09:09
  • @lucassm : I have a question here: http://stackoverflow.com/questions/12798871/net-snmp-parse-code-unknown-hash-funtion – Grijesh Chauhan Oct 09 '12 at 11:30
  • 1
    @GrijeshChauhan, you will have to spend time on both IETF RFC documents and net-snmp source code. Missing either of them will lead you to doubts. Good books such as *Understanding SNMP MIBs* is also recommended. You should not expect posting questions on SO can answer all your questions. – Lex Li Oct 09 '12 at 12:41