This project has moved and is read-only. For the latest updates, please go here.

How to Create a Mib by myself?

Topics: bug report (break and fix), feature request (I want ...), usage (how to ...)
Nov 4, 2008 at 7:32 AM
How to Create a Mib by myself? Other Tools?
Nov 8, 2008 at 9:57 AM
Hi,

The case is just like HTML, where you can author an HTML page in Notepad or in a professional editor such as Dreamweaver. So come to MIB, you can also use Notepad, or use a MIB builder. But right now #SNMP does not yet have such an editor.

-Lex
Marked as answer by lextm on 10/6/2013 at 9:08 PM
Dec 15, 2008 at 7:38 AM
I create a testMib,but I can't use #SNMP get and set any value? How can I load myMib ?  I use MibEditor get a  testMib.txt

======================================================================================

-- File Name : TestModule1
-- Date      : Wed Nov 05 11:16:40 CST 2008
-- Author    : AdventNet Agent Toolkit C Edition - MibEditor 6

 

testMib DEFINITIONS ::= BEGIN
 IMPORTS
  DisplayString
   FROM SNMPv2-TC
  enterprises, MODULE-IDENTITY, OBJECT-TYPE
   FROM SNMPv2-SMI;

 moduleIdentity MODULE-IDENTITY
  LAST-UPDATED "200811041712Z"
  ORGANIZATION "Organization "
  CONTACT-INFO "Contact-info"
  DESCRIPTION  "Description"
  REVISION  "200811041712Z"
  DESCRIPTION  ""
  ::=  {  enterprises  1  }

 org OBJECT IDENTIFIER
  ::=  {  iso  3  }
  
 dod OBJECT IDENTIFIER
  ::=  {  org  6  }

 internet OBJECT IDENTIFIER
  ::=  {  dod  1  }

 private OBJECT IDENTIFIER
  ::=  {  internet  4  }

 enterprises OBJECT IDENTIFIER
  ::=  {  private  1  }

 soooner OBJECT IDENTIFIER
  ::=  {  enterprises  50000  }

 test1 OBJECT-TYPE 
  SYNTAX   DisplayString
  MAX-ACCESS  read-write
  STATUS   current
  DESCRIPTION  "Description"
  DEFVAL   { "0" }
  ::=  {  soooner  1  }

END

=====================================================================================================
Code:

ObjectRegistry.Instance.LoadFile("testMib.txt");
 Variable test = new Variable(new ObjectIdentifier("1.3.6.1.4.1.50000.1"),
                                                             new OctetString("ssssssssssssss"));
                IList<Variable> ls = new List<Variable>();
                ls.Add(test);
                Manager.Set(VersionCode.V2, new IPEndPoint(IPAddress.Parse(this.textBox2.Text), 161), new OctetString("private"), ls, 5000);

result is wrong ,not 50000 node

Dec 21, 2008 at 10:07 AM
Never forget to understand SNMP protocol at first, because without such knowledge no SNMP library can help you achieve your goal.

In your case, you created an MIB module, and load it in #SNMP. However, the SNMP agent you used does not understand this new MIB, so it cannot provide you any object for the new OID. Therefore, you must get an error (:) Otherwise, it would be a bug of #SNMP for never telling you it's wrong).

Please first implement this MIB in the agent and then test against it in #SNMP.

Regards,

-Lex