[AGENT++] Some MIB questions

Frank Fock fock at agentpp.com
Sun Oct 8 01:46:46 CEST 2006


Hello Johnny,

johnny at navtek.no wrote:
> Hello
> 
> I'm not sure if this is the correct forum so if not please guide me in the
> correct direction.

It is.

> 
> I've been given the task of implementing a MIB but appearently it's not
> syntactically correct. At least MIB Validation/AgenPro complains a lot.
> Most of it is easy to fix INTEGER => Integer32 etc.
> 
> Because of this I figured I could try out MIB Designer and build the MIB
> from scratch. When comparing the two MIB's I have some questions:
> (I've put the old and new MIB file here www.navtek.no/~johnny/snmp)
> 
> 1. I had to manually edit the MIB file in MIB Designer to let it use
> enterprise as the base OID. What's the correct approach to this?
> 
When using the MIB wizard, then choose "Import 'enterprises' from
SNMPv2-SMI" and specify your enterprise number in the corresponding
field. You can do the same manually by importing 'enterprises' from
the SNMPv2-SMI module via "Edit->Imports".

Directly using the enterprise's OID as the OID for your MODULE-IDENTITY
is not a good approach. This should be avoided, because an OID
can be registered only once - which could cause problems when you need
to add other MIB modules etc.

> 2. In the old file I notice that some entries use DisplayString. Am I
> correct that these should be Octet string?

That depends. You can also use DisplayString (and it most likely
what was intended) by importing it from SNMPv2-TC.

However, it is not allowed to use the DisplayString TC (or any other TC)
as base syntax to define another TC.
See http://www.mibdesigner.com/html/mibdesign.html for
more information on most common MIB design issues.

> 
> 3. I also notice that some entries use a SYNTAX of a predefined enumeration.
> eg
> someEnum :: = SEQUENCE { Index INTEGER, Name DisplayString }

You mean:
someEnum ::= INTEGER { value1, value2 }
right?

> someType OBJECT-TYPE
>   SYNTAX someEnum
> 
> When using the MIB Designer I can add the enum directly to the OBJECT-TYPE
> (which is fine by me). Any reason for having two ways of doing this, and
> is one preferred?

You should define a TextualConvention for your enumeration when you
expect to use it for several objects. Otherwise a direct definition
is sufficient.
> 
> 4. In the old file there is one OBJECT-TYPE that has
> SYNTAX SEQUENCE of UnitInformation
> where
> UnitInformation ::= SEQUENCE {....}
> How do I deal with that in MIB Designer?

MIB Designer automatically creates those clauses when
you create a table definition.

> 
> 5. What is the purpose of OBJECT-GROUP/NOTIFICATION-GROUP? The designer
> complains that my OBJECT-TYPEs should be in a group. Why would I want
> that?

(1) Because it is required by the SMIv2 standard.
(2) Because only then you (or other MIB others) will be able
to define a (a) compliance module and/or (b) agent-capabilities module
that defines (a) which objects need to be implemented by the MIB to
be compliant with a certain requirement and (b) which objects are
actually implemented in which way by a certain agent version.

> 
> 6. If you were to recommend one book about SNMP/MIB, which one would you
> go for for the casual agent developer?
> 
Understanding SNMP MIBs by David Perkins. It's the most
correct one although a bit out-dated.

Best regards,
Frank

> I'd appreciate any feedback, even if it is 'This is OT!'
> 
> best regards
> Johnny Ljunggren
> 
> 
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the AGENTPP mailing list