# Moogsoft Docs

## MIBs

To enable the Trapd LAM to read and use MIB (management information base) files, they should be placed in the  $MOOGSOFT_HOME/etc/mibs  directory. The Trapd LAM is shipped with a base set of MIBs which contain all the basic imports that complex MIBs require. If custom MIBs are referenced in the  IMPORTS  definition, then these are also required to successfully read in the MIB. The base set of MIBs that are shipped with the Trapd LAM are listed below . ## MIB Loading Sanity Checks The Trapd LAM is strict with OID definitions in MIBs; it performs the following sanity checks on the them: ### MIB name already in use If there are two or more MIBs with the same name, the last read in MIB will be used and the previous versions will be ignored. It is important to ensure that there are no discrepancies like this as you could have undesired behaviour in trap resolution. ### Imported MIB not found: If a MIB imports and references another MIB, and this referenced MIB cannot be found in $MOOGSOFT_HOME/etc/mibs  then any definitions using that reference are not resolvable.

A warning message is logged:

WARN: Import [SNMPv2-SMI] not found for Mib [NET-SNMP-MIB]

### Conflicting names in MIB:

If the same name is used to identify two or more different OIDs, then the first entry is accepted only.

Example:

internet OBJECT IDENTIFIER ::= { dod 1 }
internet OBJECT IDENTIFIER ::= { dod 2 }
directory OBJECT IDENTIFIER ::= { internet 1 }

In this example,  internet  is defined twice with two different OIDs, only the first is considered to be part of the MIB, therefore directory is considered to be {dod 1 internet  1}.

### Conflicting OIDs in MIB:

If the same OID is mapped to two or more different names, only the first definition is accepted, any subsequent definitions are logged with a warning message:

netSnmpModuleIDs OBJECT IDENTIFIER ::= { netSnmpEnumerations 1 }
snmpDomainsConflict OBJECT IDENTIFIER ::= { netSnmpEnumerations 1 }

In this example,  { netSnmpEnumerations 1 }  is defined twice under two different names, only the latest occurrence of { netSnmpEnumerations } will be considered part of the MIB.

Warning log message:

WARN : OID Conflict: Full OID [1.3.6.1.4.1.8072.3.1] has conflicting names, Mib [NET-SNMP-MIB -> snmpDomainsConflict] & Mib [NET-SNMP-MIB -> netSnmpModuleIDs]

### Conflicting names between two or more MIBs:

If the same OID is mapped to two or more different names between two or more MIBs, only the first definition is accepted, any subsequent definitions are logged with a warning message:

Example:

MIB1:

deviceTemperature OBJECT IDENTIFIER ::= { device 1 }

MIB2:

deviceTemp OBJECT IDENTIFIER ::= { device 1 }

Warning log message:

WARN: OID Conflict: Full OID [1.3.6.1.4.1.42.1.1] has conflicting names, Mib [MIB-1 -> deviceTemperature] & Mib [MIB-2 -> deviceTemp]

### Object extends unknown parent:

If an Object definition references a parent which is not defined or imported in the MIB, then that object is not resolvable. A warning message is logged:

Example:

snmpDomainsConflict OBJECT IDENTIFIER ::= { snmpv3 1 }

In this example,  snmpv3  has not been defined or imported, therefore snmpDomainsConflict cannot be resolved.

Warning log message:

WARN: Mib [NET-SNMP-MIB]:Unable to resolve and find SINGLE parent for Mib Object [snmpDomainsConflict ::= { snmpv3 1 }]

## Output values in Hex string

MIBs are used to define SNMP OIDs (Object identifiers) and their attributes, so that when a trap message is received, the agent knows how to interpret it. When an Object is defined in the MIBs, it can be given optional attributes like  DISPLAY-HINT  and  DEFVAL  .

•  DISPLAY-HINT  can be used to indicate to the agent how to display a value of this Object
•  DEFVAL  tells the agent the default value for the Object and type (String, Hex, Number, etc.).

The Trapd LAM uses  DISPLAY-HINT  &  DEFVAL  definitions in MIBs to determine when a value should be outputted as a Hex String.

If the Trapd LAM isn't instructed to output the value as Hex, it will attempt to output the value in human-readable ASCII format, which may not be as intended. For example, if a Hex format is not specified, an Object with the value  4D4F4F47  will be outputted as the ASCII string  MOOG  when the intended output is  4D4F4F47  .

 DISPLAY-HINT  s defined in the format of  [digits]x[delimiter]  tell the Trapd LAM how to display the Hex String.

•  [digits]  represent the number of bytes to group before delimiting
•  [delimiter]  is a single character which is used as the delimiter.

Examples:
•  DISPLAY-HINT "1x_" 
A format of  "1x_"  for a value of  9e3f4242  outputs as a String:  9E_3F_42_42 
•  DISPLAY-HINT "2x-" 
A format of  "2x-"  for a value of  9e3f4242  outputs as a String:  9E3F-4242 
•  DISPLAY-HINT "1x:" 
A varbind in the trap with a value of  5cf9388e7dd4  would output  5C:F9:38:8E:7D:D4  which is the expected output for a MAC addres s

Only  DISPLAY-HINT  definitions in the format of  [digits]x[delimiter]  output values as Hex Strings.

 DEFVAL  definitions which specify a Hex type also result in values being outputted as Hex Strings, the default format of  1x.  is used. A  DEFVAL  Hex type is zero or more characters between a single or double quote, followed by an upper or lower case  h  , for example:

DEFVAL { '0000-ffff'h }
DEFVAL { ''H }

If both  DISPLAY-HINT  and  DEFVAL  define recognisable Hex formats, then the  DISPLAY-HINT  format is used.

If neither  DISPLAY-HINT  or  DEFVAL  definition is correctly specified, then the Octet String values use the following logic:

• If the value contains only printable ASCII characters (a range of  0x20  to  0x7E  , and  \t \n \v \f \r  ) then the value is outputted as a human readable ASCII String.
• If the value does not contain the above specified printable characters then the value is outputted as a Hex String in the default format of  1x  .

Note

If a Hex  DISPLAY-HINT  or a Hex type  DEFVAL  is supplied for a MIB Object then the Trapd LAM outputs these values as Hex Strings, regardless of any SYNTAX definitions. The Trapd LAM does not resolve or associate SYNTAX definitions

## Base Set of MIBs:

AGENTX-MIB.txt
BRIDGE-MIB.txt
DISMAN-EVENT-MIB.txt
DISMAN-SCHEDULE-MIB.txt
DISMAN-SCRIPT-MIB.txt
EtherLike-MIB.txt
HCNUM-TC.txt
HOST-RESOURCES-MIB.txt
HOST-RESOURCES-TYPES.txt
IANA-LANGUAGE-MIB.txt
IANA-RTPROTO-MIB.txt
IANAifType-MIB.txt
IF-INVERTED-STACK-MIB.txt
IF-MIB.txt
IP-FORWARD-MIB.txt
IP-MIB.txt
IPV6-ICMP-MIB.txt
IPV6-MIB.txt
IPV6-TC.txt
IPV6-TCP-MIB.txt
IPV6-UDP-MIB.txt
LM-SENSORS-MIB.txt
MTA-MIB.txt
Makefile
MoogTraps.txt
NET-SNMP-AGENT-MIB.txt
NET-SNMP-EXAMPLES-MIB.txt
NET-SNMP-EXTEND-MIB.txt
NET-SNMP-MIB.txt
NET-SNMP-PASS-MIB.txt
NET-SNMP-TC.txt
NET-SNMP-VACM-MIB.txt
NETWORK-SERVICES-MIB.txt
RFC-1212.txt
RFC-1215.txt
RFC1155-SMI.txt
RFC1213-MIB.txt
RMON-MIB.txt
SCTP-MIB.txt
SMUX-MIB.txt
SNMP-COMMUNITY-MIB.txt
SNMP-FRAMEWORK-MIB.txt
SNMP-MPD-MIB.txt
SNMP-PROXY-MIB.txt
SNMP-TARGET-MIB.txt
SNMP-USER-BASED-SM-MIB.txt
SNMP-USM-AES-MIB.txt
SNMP-USM-DH-OBJECTS-MIB.txt
SNMP-VIEW-BASED-ACM-MIB.txt
SNMPv2-CONF.txt
SNMPv2-MIB.txt
SNMPv2-SMI.txt
SNMPv2-TC.txt
SNMPv2-TM.txt
TCP-MIB.txt
UDP-MIB.txt