Banner
HomeTOCPrevNextGlossSearchHelp

Table of Contents

MIB Files and Objects


MIB Files and Objects

MIB Files and Objects

This appendix contains information on how to modify existing MIB files and establish new MIB files, as well as a brief example of MIB objects and their usage with CiscoWorks polling capabilities.

For more detailed information on MIB objects, refer to the Cisco Management Information Base (MIB) User Quick Reference. For a list of MIB reference sources relating to building MIB object structure, refer to Appendix D, "References and Recommended Reading."

For purposes of consistency, this manual uses the term object as a replacement for such terms as MIB objects, MIB object instances, and so on. Other Cisco publications may use different terms, but they can be used interchangeably.


MIB Objects: A Brief Overview

There are many MIB objects that can help you to manage your network. All objects are documented in either the RFC standard or a vendor specific MIB (for example, the Cisco MIB). Here are a few to consider:


MIB Source Files

The textual MIB files must be written in the ASN.1 subset format described in RFC 1212. This guide does not describe all of the aspects of the ASN.1 language.

A MIB is organized into a tree structure consisting of labeled nodes. A complete object identifier is built by traversing the tree from the root node, collecting labels as each node is passed. The root of the MIB tree is iso(1).

Except for the MIB tree root iso(1), all nodes in the tree must have the parent node defined before a child node may be defined. Upper level nodes (those above mib(1)) may be most conveniently defined with the statement:

MIBName { iso org(3) dod(6) internet(1) mgmt(2) 1 }

nm199.gif

MibName is an arbitrary name. The numbers in parentheses are preassigned node numbers. The above statement is interpreted as: mgmt is the beginning of a subtree (called MIBName) under internet which is under dod which is under org which is under iso.

Additional subtrees below mgmt can be defined using OBJECT IDENTIFIER statements as follows:

        Child Node OBJECT IDENTIFIER

::= { ParentNode ChildNodeNumber }


For example, to define mib (an object type) as a child of mgmt and assign a node number of 1 do the following:

mib OBJECT IDENTIFIER ::= { mgmt 1 }        


Most object types in a MIB should be defined using the OBJECT-TYPE macro. The following are the basic structure elements and format of an object type using the OBJECTTYPE macro:

ObjectDescriptor OBJECT-TYPE

  SYNTAX         ASN1_Type

  ACCESS AccessType

  STATUS StatusType

  ::= ObjectIdentifier


An example of defining an OBJECT-TYPE macro with the name atNetAddress would be:

atNetAddress OBJECT-TYPE        
  SYNTAX NetworkAddress
  ACCESS read-write
  STATUS mandatory
:= { atEntry 3 }

Note: For a complete discussion of the structure of a MIB file. Refer to RFC 1212 and RFC 1213. ISO document 8824 describes ASN.1 in detail.

MIB trees must define the parentage of every branch from terminal object IDs to the iso(1) tree root. All trees must have the same root (iso(1) is the recommended root) in order to determine how one MIB tree relates to another.


CiscoWorks MIB Files

The MIB object set read by CiscoWorks at the time it is started defines the objects that can be monitored and collected in the database for future analysis. At startup, CiscoWorks looks for the files mib.bin and mib.alias in the CiscoWorks directory $NMSROOT/etc/mibs. These files define the MIB object set and the aliases that will be used for polling and data collection. These two files and alias.gen, alias.master, and the mib source files (*.mib) comprise the set of MIB-related files necessary for the operation of CiscoWorks.

Several MIB source files are shipped with CiscoWorks:

The alias.master file contains the list of aliases upon which CiscoWorks depends. It is located in $NMSROOT/etc/mibs.


Cisco's Private MIB Objects

The Cisco private MIB object file, cisco.mib, is located in the CiscoWorks directory $NMSROOT/etc/mibs. This section lists the Cisco private MIB objects that have been introduced after Software Release 8.0.


Software Release 8.1

The following list describes the objects introduced with Software Release 8.1:

actAge
ipCkAccountingTable
ipckactSrc
ipckactDst
ipkactPkts
ipckactByts
ckactAge


Software Release 8.2

The following list describes the objects introduced with Software Release 8.2:

writeMem
writeNet
busyPer
avgBusy1
avgBusy5
idleCount
idleWired
locIfCarTrans
locIfReliab
locIfDelay
locIfLoad
locIfCollisions
tsLineNoise
dnAreaTable
dnACost
dnAHop
dnAIfIndex
dnANextHop
dnAAge
dnAPrio
vinesInput
vinesOutput
vinesLocaldest
vinesForwarded
vinesBcastin
vinesBcastout
vinesBcastfwd
vinesNotlan
vinesNotgt4800
vinesNocharges
vinesFormaterror
vinesCksumerr
vinesHopcout
vinesNoroute
vinesEncapsfailed
vinesUnkown
vinesIcpIn
vinesIcpOut
vinesMetricOut
vinesMacEchoIn
vinesMacEchoOut
vinesEchoIn
vinesEchoOut


Software Release 8.3

The following list describes the objects introduced with Software Release 8.3:

bufferHgsize
bufferHgTotal
bufferHgFree
bufferHgMax
bufferHgHit
bufferHgMiss
bufferHgTrim
bufferHgCreate
locIfInputQueueDrops
locIfOutputQueueDrops
ipNoaccess
actCheckPoint
tsMsgTtyLine
tsMsgIntervaltim
tsMsgDuration
tsMsgTest
tsMsgTmpBanner
tsMsgSend
dnIfTable
dnIfCost


Software Release 9.0

The following list describes the objects introduced with Software Release 9.0:

netConfigProto
hostConfigProto
sysConfigAddr
sysConfigName
sysConfigProto
sysClearARP
sysClearInt
envPresent
envTestPt1Descr
envTestPt1Measure
envTestPt2Descr
envTestPt2Measure
envTestPt3Descr
envTestPt3Measure
envTestPt4Descr
envTestPt4Measure
envTestPt5Descr
envTestPt5Measure
envTestPt6Descr
envTestPt6Measure
locIfDescr
locIfPakmon


Software Release 9.1

The following list describes the objects introduced with Software Release 9.1:

envTestPt4MarginPercent
envTestPt5MarginPercent
envTestPt6MarginPercent
envTestPt1last
envTestPt2last
envTestPt3last
envTestPt4last
envTestPt5last
envTestPt6last
envTestPt1MarginVal
envTestPt2MarginVal
envTestPt3MarginVal
envTestPt4MarginVal
envTestPt5MarginVal
envTestPt6MarginVal
envTestPt1warn
envTestPt2warn
envTestPt3warn
envTestPt4warn
envTestPt5warn
envTestPt6warn
envFirmVersion
envTechnicianID
envType
envBurnDate
envSerialNumber
locIfSlowInPkts
locIfSlowOutPkts
locIfSlowInOctets
locIfSlowOutOctets

locIfFastInPkts

locIfFastOutPkts

locIfFastInOctets

locIfFastOutOctets

locIfotherInPkts

locIfotherOutPkts

locIfotherInOctets

locIfotherOutOctets

locIfipInPkts

locIfipOutPkts

locIfipInOctets

locIfipOutOctets

locIfdecnetInPkts

locIfdecnetOutPkts

locIfdecnetInOctets

locIfdecnetOutOctets

locIfxnsInPkts

locIfxnsOutPkts
locIfxnsInOctets

locIfxnsOutOctets

locIfclnsInPkts

locIfclnsOutPkts

locIfclnsInOctets

locIfclnsOutOctets

locIfappletalkInPkts

locIfappletalkOutPkts

locIfappletalkInOctets

locIfappletalkOutOctets

locIfnovellInPkts

locIfnovellOutPkts

locIfnovellInOctets

locIfnovellOutOctets

locIfapolloInPkts

locIfapolloOutPkts

locIfapolloInOctets

locIfapolloOutOctets

locIfvinesInPkts

locIfvinesOutPkts

locIfvinesInOctets

locIfvinesOutOctets

locIfbridgedInPkts

locIfbridgedOutPkts

locIfbridgedInOctets

locIfbridgedOutOctets

locIfsrbInPkts

locIfsrbOutPkts

locIfsrbInOctets

locIfsrbOutOctets

locIfchaosInPkts

locIfchaosOutPkts

locIfchaosInOctets

locIfchaosOutOctets

locIfpupInPkts

locIfpupOutPkts

locIfpupInOctets

locIfpupOutOctets

locIfmopInPkts

locIfmopOutPkts

locIfmopInOctets

locIfmopOutOctets

locIflanmanInPkts

locIflanmanOutPkts

locIflanmanInOctets

locIflanmanOutOctets

locIfstunInPkts

locIfstunOutPkts

locIfstunInOctets

locIfstunOutOctets

locIfspanInPkts

locIfspanOutPkts

locIfspanInOctets

locIfspanOutOctets

locIfarpInPkts

locIfarpOutPkts

locIfarpInOctets

locIfarpOutOctets

locIfprobeInPkts

locIfprobeOutPkts

locIfprobeInOctets

locIfprobeOutOctets

flashSize

flashFree

flashcontoller

flashcard

flashVPP

flashErase

flashEraseTime

flashEraseStatus

flashToNet

flashToNetTime

flashToNetStatus

netToFlash

netToFlashTime

netToFlashStatus

flashStatus

flashEntries

flashDirName

flashDirSize

flashDirStatus


Modifying the MIB Files

Since many networks are built with equipment from various vendors, and there are custom objects that you as a network manager may want to monitor; you can add these non-Cisco custom MIBs to the standard object set.

Note: If you have only Cisco devices on your network or you only want to collect standard MIB object information from non-Cisco devices, you do not have to modify the mib.bin or alias.mib files.

CiscoWorks uses two files to define how it accesses MIB object information from devices. The first, mib.bin, is a database of all the objects currently defined in the MIB source files. The second file is the mib.alias file. This file allows Cisco Systems to define a protocol independent application environment.

The mib.alias file also allows you to assign your own names to existing MIB objects. For instance, you could assign the name UpTimeInterval to the MIB object sysUptime. You could also assign several names to the same MIB object. The mib.alias file provides the translation matrix for the object information you want to collect.


Makemib Command

If you want to collect custom MIB information from non-Cisco SNMP devices in your network, follow the steps below to use the makemib command to create new mib.bin and mib.alias files for your installation:

Step 1: Assemble all the additional MIB source files relevant to your application into $NMSROOT/etc/mibs directory.

Step 2: Delete any of those supplied by Cisco that are not needed.

Step 3: Be sure that any MIB files you added to the $NMSROOT/etc/mibs directory end in .mib.

Step 4: Invoke the following command:
hostname% makemib        

Note: $NMSROOT/etc must be in the user's path.

When the makemib process finishes, you are ready to start CiscoWorks.

Makemib first invokes mibbld to generate the mib.bin file and the alias.gen file, and then invokes the aliaschk program to check the alias.gen file. It then combines the alias.gen and alias.master files to form the mib.alias file. See Figure A-1.

nm198.gif

Figure A-1 CiscoWorks MIB Build Process

The process of expanding the MIB object set starts with a series of files supplied by the vendors of the various network products. These files define the MIB objects and can be edited with any standard text editor as long as you conform to the concise MIB format. You can collect as many files as you like. The file specification must end in .mib.

Note: Building or modifying existing MIB tables requires a working knowledge of the ASN.1 language, the Concise MIB Notation, and the Structure of Management Information (SMI) specification.

Use the following command to start makemib:

makemib --m MasterAlias --A FinalAlias options

MasterAlias is the master alias file (default: alias.master).

FinalAlias is the final alias file (default: mib.alias).

Options are described in Table A-1.

Table A-1 Makemib Command Options

Option Description
--f MibFile The MIB file to be processed is specified by filename MibFile (default *.mib).
--o OutMib The name of the output file for the MIB binary file (default mib.bin).
--p PathToMibs Process all MIB files found in the directory specified by the path name PathToMibs (default $NMSROOT/$MIBDIR)
--a AliasFile The name of output file for the aliases (default alias.gen)
--w WarnLevel Set the warning message level at the level specified by WarnLevel. A level of 0 suppresses all warning messages (including "unknown variable type," which are desirable). The default setting is 1. Mibbld will issue warning and error messages regarding syntax errors, bad keywords, etc. For this reason it is wise to run with the warning level set to 1 or greater.
--t Display MIB table after processing (on stdout).
--n Disable alias generation.
--v Display copyright and version information (on stdout).
--h Display help information (on stderr).

Invoking makemib completes the process in a single command step. You can, however, invoke the mibbld and aliaschk programs individually instead of invoking the makemib command. These programs are described later in this chapter under their individual headings.

Cisco Systems recommends that you use the makemib command.


MIB Aliases Description

MIB aliases are used by CiscoWorks to create protocol independent MIB objects. The mib.alias file defines a name in terms of a MIB object name and a protocol. Aliases also allow one or more protocol specific object identifiers to be associated with a single MIB object. Currently, only SNMP is supported.

The mib.alias file is an ASCII file. Each alias entry takes the following general format:

Alias { Protocol::ObjectID [ Protocol::ObjectID [ ...]] }

The ObjectID may be in either numeric or textual form, but must be fully qualified. MIB trees must define the parentage of every branch from terminal object IDs to the iso(1) tree root. All trees must have the same root. Iso(1) is the recommended root. As a side effect of ASN.1 object identifier encoding, the first two subidentifiers are compressed into a single numeric value. Thus, iso(l) -- org(3) becomes 43. rather than 1.3. This convention is followed when specifying a numeric object identifier within an alias entry.

For uniformity, iso(l) -- org(3) is also compressed to isoorg in a textual object identifier. Note that in actual application, each textual subidentifier must be introduced with the underbar delimiter (_), even the first subidentifiers (such as _isoorg).

An example of a portion of a mib.alias file appears below:

UpTime { SNMP::43.6.1.2.1.1.3 }        
ItsTime { 

SNMP::_isoorg_dod_internet_mgmt_mib_system_sysUpTime }
EgpNeighbor { SNMP::43.6.1.2.1.8.5.1.1, 

SNMP::43.6.1.2.1.8.5.1.2 }
RouteMetric {
   SNMP::43.6.1.2.1.4.21.1.3,
   SNMP::43.6.1.2.1.4.21.1.4,
   SNMP::43.6.1.2.1.4.21.1.5,
   SNMP::43.6.1.2.1.4.21.1.6
}


If more than one object identifier is listed for a given alias, the order in which the IDs are listed implies the order in which CiscoWorks will search for the ID.

Comments can be included in the MIB alias file by introducing the comment with two dashes (--). For example:

-- This is a comment.        


Modifying the mib.alias File

The makemib command builds the alias entries in alias.gen and then concatenates alias.gen and alias.master into mib.alias. It generates a name that is unique for each object by prefixing the mib file identifier (defined within the mib file) to the object name with a dash (-). If the MIB file name were new.mib, the file name identifier in this file were NEW-MIB and the object name were newMibVar, the alias name generated would be:

NEW-MIB-newMibVar

The protocol and object identifier as defined in the file follow. For example:

NEW-MIB-newMibVar {SNMP::43.6.1.2.4.33.2.5}

However if the filename identifier is already part of the object name, it is not prefixed to the object name. For example, if the MIB filename were new.mib, the filename identifier in this file was new and the object name was newMibVar, the alias name generated would be as follows:

newMibVar

The alias name woud not be as follows:

new-newMibVar


One-to-One Name Definition

You can also modify the mib.alias file with any text editor. This is the most convenient way to add a name definition to an already existing MIB object. For instance, if you wanted to define the name UpTimeInterval as the standard MIB object sysUptime, make the following entry in the mib.alias file:

UpTimeInterval{SNMP::_isoorg_dod_internet_mgmt_mib_system_sysUpTime }        


Many-to-One Name Definition

At times, you might want to have several names for the same MIB object For instance, if you want to define the names Myhost, Ciscohost, and Routername as the Cisco Systems private MIB object CISCO-MIB-hostName, make the following entries in the mib.alias file:

Myhost{SNMP::_isoorg_dod_internet_private_enterprises_cisco_local_lsystem_hostName}        
CiscoHost{SNMP::_isoorg_dod_internet_private_enterprises_cisco_local_lsystem_hostName}
Routername{SNMP::_isoorg_dod_internet_private_enterprises_cisco_local_lsystem_hostName}

Note: The easiest way to construct these many-to-one name entries is to find the appropriate MIB object definition in the mib.alias file, copy it, and modify it.


One-to-Many Name Definition

At times, you might want to have a single name for the several MIB objects. For instance, if you want to define the name Routemetric to include the four objects SNMP::43.6.1.2.1.4.21.1.3, SNMP::43.6.1.2.1.4.21.1.4, SNMP::43.6.1.2.1.4.21.1.5, and SNMP::43.6.1.2.1.4.21.1.6, make the following entries in the mib.alias file:

Routemetric {        
  SNMP::43.6.1.2.1.4.21.1.3
  SNMP::43.6.1.2.1.4.21.1.4
  SNMP::43.6.1.2.1.4.21.1.5
  SNMP::43.6.1.2.1.4.21.1.6
}


When you start CiscoWorks, the changes you made to the mib.alias file are used when you ask CiscoWorks to poll for that object.


MIB Directory Pathing

There are two forms of directory pathing:

NMSROOT/$MIBDIR/mib.alias

$NMSROOT/etc/mibs/mib.alias

CiscoWorks requires the mib.alias file to appear in the same directory as the mib.bin file. CiscoWorks software looks for the MIB alias file in the directory $NMSROOT/etc/mibs or $NMSROOT/MIBDIR. NMSROOT defines the root directory for all Network Management System (NMS) software. MIBDIR is a relative path name that defines the directory below the NMS root directory which contains one or more MlB files and the mib.alias file.

If MIBDIR is not defined, the MIB directory defaults to $NMSROOT/etc/mibs. If a full path to the MIB directory or a MIB filename is specified using the --p or --f options, NMSROOT and MIBDIR are ignored.

The base name of the output MIB file will default to mib.bin unless a specific binary output file is defined. The directory in which the output file appears is determined as follows:


Mibbld Description

The program used to build the binary MIB file is mibbld. The program checks the contents of all the .mib files in the specified directory for syntax errors and creates a binary format mib.bin and alias.gen files usable by CiscoWorks.

The format of the statement used to invoke mibbld is:

mibbld [--f MibFile ] [ --o OutMib ] [ --P PathToMibs ] [ --a AliasFile ]
[ --w WarnLevel ] [ --t ] [ --n ] [ --v ] [ --h ]

The mibbld command options are described in Table A-2.

Table A-2 Mibbld Command Options

Optionef Descriptionefault *.mib)
--f MibFile The MIB file to be processed is specified by filename MibFile (default *.mib).
--o OutMib The name of the output file for the MIB binary file (default mib.bin).
--p PathToMibs Process all MIB files found in the directory specified by the path name PathToMibs (default $NMSROOT/$MIBDIR). The environment objects, NMSROOT and MIBDIR, are ignored.
--a AliasFile The name of output file for the aliases (default alias.gen).
--w WarnLevel Set the warning message level at the level specified by WarnLevel. A level of 0 suppresses all warning messages (including "unknown variable type," which are desirable). The default setting is 1. Mibbld will issue warning and error messages regarding syntax errors, bad keywords, etc. For this reason it is wise to run with the warning level set to 1 or greater.
--t Display MIB table after processing (on stdout).
--n Disable alias generation.
--v Display copyright and version information (on stdout).
--h Display help information (on stderr).

If you run mibbld with out specifying full path names, mibbld looks for the environment objects NMSROOT and MIBDIR.


Showmib Description

The showmib utility is used to display the contents of the binary MIB file in a tree structure. The utility also checks the contents of the MIB alias file against the MIB tree. The form of the showmib command is:

showmib [ --a AliasFile ] [ --f MibFile | --p PathToMibs ] [ --s m | a ] [ --h ]

The showmib command processes the contents of a binary format MIB file and displays the contents in a hierarchical tree structure starting from the tree's root. The MIB alias file is then processed. Aliases are displayed with corresponding fully qualified object IDs.

The showmib command options are described in Table A-3.

Table A-3 Showmib Command Options

Showmib Option Description
-a AliasFile Name of MIB alias file.
-f MibFile Processes the single MIB file specified by filename (path name) MibFile.
--pPathToMibs Processes all MIB files found in the directory specified by path name PathToMibs. The Environment objects NMSROOT and MIBDIR are ignored.
--sSuppressO Suppress output. If SuppressO is set to m, the output of the MIB tree is suppressed.If SuppressO is set to a, the output of the output of aliases is suppressed.If set to -h, displays the showmib options list.

If you run showmib with no arguments, it looks for the environment objects NMSROOT and MIBDIR.


Aliaschk Program

The aliaschk program ensures that alias names defined in alias.gen do not conflict with alias names in alias.master.

The last step in the makemib process is to concatenate the alias.master and alias.gen files together as mib.alias. Enter the following the following UNIX command:

hostname% cat alias.master alias.gen > mib.alias        

HomeTOCPrevNextGlossSearchHelp
-

Copyright 1988-1995 © Cisco Systems Inc.