lzdt
lzdt

Reputation: 499

snmp MIB error: scalar's parent node must be simple node

I'm trying to create a MIB and have this error, trying to add a "child node" to a parent:

scalar's parent node must be simple node

from simpleweb mib validation

What I'm trying to do is to create parents/childs/elements according to this OID: 1.3.6.1.4.1.1234.1.2.3, I marked the problematic part bold.

Elements "1, 2 and 3" after "1234" have this structure:

myParent1 OBJECT-TYPE
    SYNTAX         Integer32
    UNITS          "test"
    MAX-ACCESS     read-write
    STATUS         current
    DESCRIPTION
        "myParent1"
    DEFVAL { 42 }
::= { myNameOfEnterprise 1 }

myChild2 OBJECT-TYPE
    SYNTAX         Integer32
    UNITS          "test"
    MAX-ACCESS     read-write
    STATUS         current
    DESCRIPTION
        "myChild2"
    DEFVAL { 42 }
::= { myParent1 2 }

But it looks like I can't nest this types, what is simple node and how do I nest it? The elements I try to nest don't have to be of any specific type, its about to understand how the nesting actually works.

Upvotes: 1

Views: 1372

Answers (2)

Jolta
Jolta

Reputation: 2725

The validation error is meant to point out the two types of nodes in a MIB tree, as you've discovered. Think of them as "branches" and "leaves".

  • A branch can hold no value, but may have leaves growing from it. It must be connected to another branch. These are OBJECT IDENTIFIERs.
  • A leaf holds a value, but cannot have any more leaves under it, and must be connected to a branch. These are OBJECT-TYPE.

Upvotes: 1

lzdt
lzdt

Reputation: 499

I guess, I've found a way. Namely to use "OBJECT IDENTIFIER" to group/do nesting.

myParent1    OBJECT IDENTIFIER ::= { myNameOfEnterprise 1 }
myChild2 OBJECT-TYPE
    SYNTAX         Integer32
    UNITS          "test"
    MAX-ACCESS     read-write
    STATUS         current
    DESCRIPTION
        "myChild2"
    DEFVAL { 42 }
::= { myParent1 2 }

Upvotes: 1

Related Questions