Overview

 

WebNMS SNMP API provides separate classes for all the base data types, such as Integer, Counter, and so on. SNMP API supports the standard RFC's SMIv1. The various data types for management information are as follows.

 

SMIv1 Data types

SMIv1 MIB Data Types

 

Data Type Name Description

INTEGER

Specifies a value whose range may include both positive and negative numbers.
Range = -2e31 to 2e31 - 1 (SMIv1 does not specify minimum or maximum values for the range).

 

Examples:

  • INTEGER (0..127) -- corresponds to an unsigned 8-bit integer

  • INTEGER (0..40 | 50 | 65 | 90..100)

  • INTEGER (-2147483648..2147483647) -- corresponds to a signed 32-bit integer

INTEGER (Enumerated)

Specifies a list of labeled integer values. In SMIv1, the values should be greater than 0, whereas SMIv2 allows any values in the range (-2e31 to 2e31- 1)

 

Example:

  • INTEGER { true(1), false(2) }

Gauge

Represents a non-negative integer, which holds at the maximum or minimum value specified in the range when the actual value goes over or below the range, respectively.

Counter

Specifies a value which represents a count. The range is 0 to 4294967295.

TimeTicks

Specifies the elapsed time between two events, in units of hundredth of a second. The range is 0 to 2e32 - 1.

OCTET STRING

Specifies octets of binary or textual information. While SMIv1 doesn't limit the number of octets, SMIv2 specifies a limit of 65535 octets. A size may be specified which can be fixed, varying, or of multiple ranges.

 

Examples:

  • OCTET STRING -- length can vary from 0 to 65535 bytes

  • OCTET STRING (SIZE(0..255))

  • OCTET STRING (SIZE(4)) -- fixed length of 4 bytes.

  • OCTET STRING (SIZE(0 | 4 | 6)) -- varying with 0, 4, or 6 bytes

OBJECT IDENTIFIER

Identifies a type that has an assigned Object Identifier value

IpAddress

Specifies an IPv4 address as a string of 4 octets.

NetworkAddress

Allows a network address of any type to be specified. However, it is now obsolete. A value of this type is an IPv4 address. SMIv2 supports this type through the IpAddress type.

Opaque

Specifies octets of binary information. SMIv2 specifies a limit of 65535 octets while there is no limit in SMIv1. A size may be specified which can be fixed, varying, or of multiple ranges. A value of this type must be an encapsulation of ASN.1 BER encoded value.

 

Examples:

  • Opaque -- length can vary from 0 to 65535 bytes

  • Opaque (SIZE(0..255))

  • Opaque (SIZE(4)) -- fixed length of 4 bytes.

  • Opaque (SIZE(0 | 4 | 6)) -- varying with 0, 4, or 6 bytes

 

The following table lists all the various syntax supported in our SNMP API and their equivalent data type in Java.

 

S.No. MIB Syntax Equivalent Data Type in Java

1

INTEGER

Integer

2

Gauge

Long

3

Counter

Long

4

TimeTicks

Long

5

OCTET STRING

byte[]

6

OBJECT IDENTIFIER

int[]

7

NULL

Null

8

IpAddress

byte[4]

9

Opaque

byte[]



Copyright © 2012, ZOHO Corp. All Rights Reserved.