Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

SNMPResponse- Global

The SNMPResponse script include provides methods to wrap an SNMP payload response instance with methods to safely and easily retrieve SNMP singleton fields or tables.

Use this script include to retrieve SNMP singleton fields or tables.

Parent Topic:Server API reference

SNMPResponse - buildIndex(Object cur, String name, String extName)

Builds an index to all SNMP entities in the current object.

NameTypeDescription
curObjectThe current object
nameStringThe index name
extNameStringThe index extension
TypeDescription
void 

SNMPResponse - buildReferences()

Builds references to actual instances for all identified indexes (in the discovery_snmp_ref table) that can be resolved.

NameTypeDescription
None  
TypeDescription
void 

SNMPResponse - getAmbiguousOIDs(String refBase, String refLeaf)

Returns an array of OIDs that match the given ref_base and which have a defined, non-null ref_leaf.

The last character of ref_base may be a question mark; in that case, if the parent node is a table then all table entries are returned.

NameTypeDescription
refBaseStringThe reference base
refLeafStringThe reference leaf
TypeDescription
ArrayAn array of OIDs that match the given ref_base and which have a defined, non-null ref_leaf.

SNMPResponse - getOIDInt(String name)

Returns the integer contained in the OID object with the given MIB name.

NameTypeDescription
nameStringThe MIB name
TypeDescription
NumberThe integer contained in the OID object, or zero if the object could not be found or is empty.

SNMPResponse - getOIDObj(String name)

Retrieves the OID object with the given MIB name from the response.

This method does not work with numeric OID strings, only MIB names.

NameTypeDescription
nameStringThe MIB name
TypeDescription
OID objectThe OID object with the given MIB name, or null if the object could not be found or if any table entries are encountered while walking down the named elements.

SNMPResponse - getOIDTable(String parentName, String entryName)

Returns a hashmap of table entries under the given parent MIB name, with the given entry MIB names.

NameTypeDescription
parentNameStringThe parent MIB name
entryNameStringThe entry MIB name
TypeDescription
HashmapA hashmap of table entries under the given parent MIB name, with the given entry MIB names, or null if the parent does not exist.

SNMPResponse - getOIDText(String name)

Returns the text contained in the OID object with the given MIB name.

NameTypeDescription
nameStringThe MIB name
TypeDescription
StringThe text contained in the OID object. Returns null if the object could not be found, or if it has no text.

SNMPResponse - normalize(Object cur)

Resolves SNMP tables into hashmaps and OID values into primitives.

All SNMP numeric types convert to a JavaScript number. An SNMP null type converts to a JavaScript null. An SNMP IP Address value converts to a Java IPAddressV4 instance. All other values convert to a JavaScript string.

NameTypeDescription
curObjectThe SNMP table or OID value.
TypeDescription
void