BLOG     |     FORUM
MIB Browser

MIB Browser Reference


MIB Browser Reference diagram


The "MIB Browser" scripting interface provides access to compiled MIB objects, and their definitions. You can also compile MIBs from the command line using the methods of this interface.

Links


MIBBrowser (top level object)

The top level object used to navigate SNMP MIB definitions and to compile raw MIB files in ASN.1 format into Unbrowse SNMP. When you compile SNMP MIBs into they are converted into a compact fast loading format called the *.VOSMI.  These VOSMI files are loaded by this interface.



Creating the top level object

VBScript

Set Mibbrowser = CreateObject("UnbrowseSNMP.MIBBrowser")

Ruby

browser = WIN32OLE.New("UnbrowseSNMP.MIBBrowser")

Events

None

Properties and Methods

Name Parameters Access Description
CompileASN String - full path to the MIB file

MIBModule Object - Return value
NA Compiles the specified MIB file and return a MIBModule object containing all the information about the objects in the MIB
SaveAs String - file name NA Save the compiled file into this file name. Usually this is the file "modulename".vosmi
GetErrorResult Numeric - Result NA 0 - if the MIB compilation was a success
1 - if failure due to errors
2 - if warnings present, but success
GetErrorSummary Numeric - Return number of errors

Numeric - Return number of warnings
NA Returns the number of errors and warnings that resulted from a CompileASN method
SetPath String - path NA Add a semicolon separated list of paths to search from IMPORTED MIBs while compiling
GetModule MIBModule object - return NA Returns the MIB module object
GetModuleIndex
Collection of Nodes NA All the SNMP objects defined in this module
ErrorText String Read Error text that resulted from a CompileASN or Compile operation
ErrorMessageSeverity
Numeric Read
Write
A number from 0 to 9.
This controls the granularity of the error messages
Strictness Numeric Read
Write
A number from 0 to 9.
This controls how strict the MIB compiler is
AddPath String - path to add NA Adds a path to the list of paths to search for IMPORTed MIB definition files
EnableDeepSearch Bool Read Deep Searching is an advanced feature of Unbrowse SNMP.
When set to true: Unbrowse SNMP does not assume any naming convention for MIB files. So, as while searching for IMPORTed modules, it scans the the module definition ASN.1 block looking for a match.
Open String - path of compiled file

MIB Module object - Return value
NA Open a pre-compiled MIB Module stored in the given VOSMI file.

 

A typical session might look like this.

' Create the MIB Browser Object
Set MIBBrowser = CreateObject("UnbrowseSNMP.MIBBrowser")

' Get the Module after opening the VOSMI file
Set MIBModule = MIBBrowser.Open("MYMIB-DEF.VOSMI") For Each Child in MIBModule.ChildNodes ... Next
 

MIBModule

Corresponds to a single SNMP MIB module.

Events

None

Properties and Methods

Name Parameters Access Description
Name String Read
Write
The name of the MIB module
DatabasePath String Read The full path of the compiled MIB module file.

The compiled MIB module files are typically stored in the Unbrowse MIB repository with the extension *.VOSMI
Path String Read
Write
The full path of the plain MIB file.

Plain MIB files are the normal ASN.1 MIB definition files.
Organization String Read
Write
Organization name
ContactInfo String Read
Write
Contact information
Description String Read
Write
Description section from the MIB definition
Reference String Read
Write
Reference
FindNodeByName String - Node name

MIBNode object - Return value
NA This method searches the MIB module for a given node by name (eg, sysUpTime).
FindBestOIDMatch String - OID

MIB Node object - Return value
NA Search the MIB module for a node with an OID with the longest match of the input OID.

If an exact match is found, that node is returned.
ChildNodes Collection of MIBNode objects NA A collection of all the node defined in this MIB module



MIBNode

Corresponds to a single node defined in the MIB module

Events

None

Properties and Methods

Name Parameters Access Description
Name String Read
Write
The name of the node.

Example : "sysUpTime"
OID String Read
Write
The OID of the node.
Description String Read
Write
The description of the node as specified in the MIB definition.
NodeType Numeric -

see NodeTypeEnum
Read The node type. See the NodeTypeEnum for a list of valid NodeTypes.
OIDName String Read The full name of the node

Example: ".iso.dod.internet.mgmt"
ShortOID Numeric Read
Write
The last digit of the OID
FindNodeByName String - node name

MIBNode object - return value
NA Search all the children of this node for a given name
Type
MIBNodeType object - return value Read You can use the MIBNodeType object for more information about the type of the node.
Children Collection of MIBNode objects Read All the immediate children of this node

 


MIBNodeType

An SNMP Type object.

Events

None

Properties and Methods

Name Parameters Access Description
Name String Read
Write
Name of the type
Description
String Read
Write
Description
FindNameForNumber Numeric - a numeric enum value

String - the name for the enum
NA This method is used to lookup enumerated name value pairs in the type definition.

Example :

Set MyType = Mod.FindNodeByName("ifType").Type
TypeStr = MyType.FindNameForNumber (6)

Will return "Ethernet/CSMA-CD"
BaseType Numeric - see the BaseType enumeration NA The base type.

See the basetype enum for a list of all valid basetypes.

 


Enumerations

BaseType enumeration

typedef enum VSmiBaseType {
    VSMI_BASETYPE_UNKNOWN                = 0,  
    VSMI_BASETYPE_INTEGER32              = 1,  
    VSMI_BASETYPE_OCTETSTRING            = 2,
    VSMI_BASETYPE_OBJECTIDENTIFIER       = 3,
    VSMI_BASETYPE_UNSIGNED32             = 4,
    VSMI_BASETYPE_INTEGER64              = 5,  
    VSMI_BASETYPE_UNSIGNED64             = 6,  
    VSMI_BASETYPE_FLOAT32                = 7,  
    VSMI_BASETYPE_FLOAT64                = 8,  
    VSMI_BASETYPE_FLOAT128               = 9,  
    VSMI_BASETYPE_ENUM                   = 10,
    VSMI_BASETYPE_BITS                   = 11 
} VSmiBaseType;

NodeType enumeration

typedef enum VSmiNodeType {
        VSMI_NODETYPE_UNKNOWN                   = 0,
        VSMI_NODETYPE_LEAF                      = 1,
        VSMI_NODETYPE_COMPLIANCE                = 2,
        VSMI_NODETYPE_CONFORMANCE               = 3,
        VSMI_NODETYPE_OBJECT                    = 4,
        VSMI_NODETYPE_NOTIFICATION              = 5,
        VSMI_NODETYPE_TABLE                     = 6,
        VSMI_NODETYPE_TABLEENTRY                = 7,
        VSMI_NODETYPE_OBJECTGROUP               = 8,
        VSMI_NODETYPE_NOTIFICATIONGROUP         = 9,
        VSMI_NODETYPE_MODULEIDENTITY            = 10,
        VSMI_NODETYPE_OBJECTIDENTITY            = 11,
        VSMI_NODETYPE_INDEXLEAF                 = 12,
        VSMI_NODETYPE_INDEXLEAF_EXT             = 13
} VSmiNodeType;