next up previous contents
Next: MIB-II Up: MIBs & OIDs Previous: MIBs   Contents

OID DataTypes

SMI defines a fixed number of datatypes which are returned by OIDs. These datatypes include:

Integer
Signed 32bit Integer (values between -2147483648 and 2147483647).
Integer32
Same as Integer.
UInteger32
Unsigned 32bit Integer (values between 0 and 4294967295).
Octet String
Arbitrary binary or textual data, typically limited to 255 characters in length.
Object Identifier
An OID.
Bit String
Represents an enumeration of named bits. This is an unsigned datatype.
IpAddress
An IP address.
Counter32
Represents a non-negative integer which monotonically increases until it reaches a maximum value of 32bits-1 (4294967295 dec), when it wraps around and starts increasing again from zero.
Counter64
Same as Counter32 but has a maximum value of 64bits-1.
Gauge32
Represents an unsigned integer, which may increase or decrease, but shall never exceed a maximum value.
TimeTicks
Represents an unsigned integer which represents the time, modulo 232 (4294967296 dec), in hundredths of a second between two epochs.
Opaque
Provided solely for backward-compatibility, its no longer used.
NsapAddress
Represents an OSI address as a variable-length OCTET STRING.

Net-SNMP tools will report the datatype when returning an OID unless you otherwise disregard it. As an example of that you'll see:

SNMPv2-MIB::sysContact.0 = STRING: Ben Rockwood
IF-MIB::ifPhysAddress.1 = STRING: 0:c0:b7:63:ca:4c
SNMPv2-MIB::sysUpTime.0 = Timeticks: (47372422) 5 days, 11:35:24.22
IF-MIB::ifAdminStatus.1 = INTEGER: up(1)
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.318.1.3.7
RFC1213-MIB::atPhysAddress.1.1.10.10.1.1 = Hex-STRING: 00 50 73 28 47 A0 
RFC1213-MIB::atNetAddress.1.1.10.10.1.1 = Network Address: 0A:0A:01:01
IF-MIB::ifSpeed.1 = Gauge32: 10000000
SNMPv2-MIB::snmpInPkts.0 = Counter32: 316
SNMPv2-MIB::snmpOutPkts.0 = Counter32: 314

This is a fairly typical spread of datatypes returned by Net-SNMP tools. Notice that some values are being automatically interpreted by Net-SNMP, such as the sysUpTime and ifAdminStatus. The MIB was used when these values were returned and Net-SNMP was nice enough to find the return value in the MIB and give us the textual representation of the value.


next up previous contents
Next: MIB-II Up: MIBs & OIDs Previous: MIBs   Contents
2004-11-23