Previous Topic: snmpObjectIDToASCIIString FunctionNext Topic: snmpOctetStringFloat Function


snmpOIDParser Function

This function uses the value of an objectID (OID) and parses out a subset of the OID based on the startIndex and endIndex values. The indexes are 1 based. If the endIndex is -1, then we go to the end of the OID. Use this function to certify devices.

Syntax

This function has the following format:

ObjectID snmpOIDParser( ObjectID OID, Integer startIndex, Integer endIndex )

Parameters

OID

The object ID (OID) value to parse.

startIndex

An integer value of the index at which to begin parsing.

endIndex

An integer value of the index at which to stop parsing.

Return Values

Returns the parsed subset ObjectID (OID).

Examples

The following expression produces the following result for an OID value of 1.2.3.4.5.6.7.8.9.10, a startIndex value of 1, and an endIndex value of 5:

Expression:

snmpOIDParser(oid, startIndex, endIndex )

Result:

1.2.3.4.5

The same expression produces the following result for an OID value of 1.2.3.4.5.6.7.8.9.10, a startIndex value of 6, and an endIndex value of -1:

Result:

6.7.8.9.10

Advanced Example

The following expression is taken from “Cisco CBQos ClassMap” Vendor Certification:

ItemUniqueIDs=snmpOIDParser(cbQosConfigIndex, 2, 2)