LoadMIB

(Engine-Level Function)

Description: Loads a specified MIB or set of MIBs and returns a dictionary describing the hierarchy of the MIBs.
Returns: Dictionary
Usage: Script
Function Groups: File I/O,  Software and Hardware
Related to:
Format: LoadMIB(MIBPath[, SubIDIndexing, LoadDescriptions, ErrorOut])
Parameters:  
MIBPath
Required. A path to any single MIB or a directory containing MIBs (possibly in further subdirectories). The returned MIB dictionary will also include those elements of the base MIBs found in <VTSInstallDir>\MIBS that are referenced in the MIB found in MIBPath. If Invalid, then the returned MIB dictionary will only include the base MIBS.
SubIDIndexing
An optional Boolean expression. If TRUE, then items in the returned MIB dictionary are keyed by numeric portion of the OID for that element. If FALSE, then the items are keyed by the label for the element. Defaults to TRUE.
LoadDescriptions
An optional Boolean expression. If TRUE, then the returned MIB dictionary will contain any description for the element (which may be lengthy). If FALSE, then no description is loaded. The default is TRUE.
ErrorOut
An optional variable into which any errors found in parsing the MIBs will be returned. Will take the form of a linked list of error message structures. The message structure will contain two fields: Error, containing the error text and Next containing the next error message structure, if any.
Comments:

VTScada supports only ASCII-encoded MIB files.

The return value is a Dictionary representing the MIBs specified. Depending on the actual element, the following members may be present

Label

The textual "name" of the element.

SubID

The portion of the OID corresponding to the element.

OID

The full OID for the element.

Desc

The textual description of the element (if the LoadDescriptions parameter is TRUE).

Syntax

The type of the element, e.g. "OCTET STRING" or "INTEGER" etc.

Type

The numeric type of the element, e.g. INTEGER is 3. The full list of possible types is:

OTHER0
OBJID1
OCTETSTR2
INTEGER3
NETADDR4
IPADDR5
COUNTER6
GAUGE7
TIMETICKS8
OPAQUE9
NULL10
COUNTER6411
BITSTRING12
NSAPADDRESS 13
UINTEGER14
UNSIGNED3215
INTEGER3216
SIMPLE_LAST16
TRAPTYPE20
NOTIFTYPE21
OBJGROUP22
NOTIFGROUP23
MODID24
AGENTCAP25
MODCOMP26
OBJIDENTITY 27

Access

The permitted access to the element, One of "NoAccess", "ReadOnly", "WriteOnly", "ReadWrite", "Notify", "Create".

Enums

If the element provides an enumeration of values, then this member will be present and contain a linked list of enumeration structures, each structure has the following elements:

Label - the label for the enumeration.

Value - the value of the enumeration.

Next - the next enumeration structure (if any) in the list.

Indexes

If the element is a table, this member lists the indexes of the items in the table. The member contains a linked list of index structures, each structure has the following elements

Label - the label for the index.

IsImplied .

Next - the next index structure (if any) in the list

Children

If the element is not a leaf element this member will be present and will contain dictionaries for each of the elements child elements keyed by the child's OID SubIndex or Label as specified by the SubIDIndexing parameter.