Up: MIBs & OIDs
SMI defines a fixed number of datatypes which are returned by OIDs. These datatypes include:
- Signed 32bit Integer (values between -2147483648 and 2147483647).
- Same as Integer.
- 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.
- An IP address.
- 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.
- Same as Counter32 but has a maximum value of 64bits-1.
- Represents an unsigned integer, which may increase or decrease, but shall never exceed a maximum value.
- Represents an unsigned integer which represents the time, modulo 232 (4294967296 dec), in hundredths of a second between two epochs.
- Provided solely for backward-compatibility, its no longer used.
- 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.104.22.168
RFC1213-MIB::atPhysAddress.22.214.171.124.1.1 = Hex-STRING: 00 50 73 28 47 A0
RFC1213-MIB::atNetAddress.126.96.36.199.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.
Up: MIBs & OIDs