{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1101,"path":"api-reference/server-api-reference/c_SNMPResponseAPI.md","title":"SNMPResponse - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# SNMPResponse- Global\n\nThe SNMPResponse script include provides methods to wrap an SNMP payload response instance with methods to safely and easily retrieve SNMP singleton fields or tables.\n\nUse this script include to retrieve SNMP singleton fields or tables.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## SNMPResponse - buildIndex\\(Object cur, String name, String extName\\)\n\nBuilds an index to all SNMP entities in the current object.\n\n|Name|Type|Description|\n|----|----|-----------|\n|cur|Object|The current object|\n|name|String|The index name|\n|extName|String|The index extension|\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n## SNMPResponse - buildReferences\\(\\)\n\nBuilds references to actual instances for all identified indexes \\(in the discovery\\_snmp\\_ref table\\) that can be resolved.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n## SNMPResponse - getAmbiguousOIDs\\(String refBase, String refLeaf\\)\n\nReturns an array of OIDs that match the given ref\\_base and which have a defined, non-null ref\\_leaf.\n\nThe 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.\n\n|Name|Type|Description|\n|----|----|-----------|\n|refBase|String|The reference base|\n|refLeaf|String|The reference leaf|\n\n|Type|Description|\n|----|-----------|\n|Array|An array of OIDs that match the given ref\\_base and which have a defined, non-null ref\\_leaf.|\n\n## SNMPResponse - getOIDInt\\(String name\\)\n\nReturns the integer contained in the OID object with the given MIB name.\n\n|Name|Type|Description|\n|----|----|-----------|\n|name|String|The MIB name|\n\n|Type|Description|\n|----|-----------|\n|Number|The integer contained in the OID object, or zero if the object could not be found or is empty.|\n\n## SNMPResponse - getOIDObj\\(String name\\)\n\nRetrieves the OID object with the given MIB name from the response.\n\nThis method does not work with numeric OID strings, only MIB names.\n\n|Name|Type|Description|\n|----|----|-----------|\n|name|String|The MIB name|\n\n|Type|Description|\n|----|-----------|\n|OID object|The 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.|\n\n## SNMPResponse - getOIDTable\\(String parentName, String entryName\\)\n\nReturns a hashmap of table entries under the given parent MIB name, with the given entry MIB names.\n\n|Name|Type|Description|\n|----|----|-----------|\n|parentName|String|The parent MIB name|\n|entryName|String|The entry MIB name|\n\n|Type|Description|\n|----|-----------|\n|Hashmap|A hashmap of table entries under the given parent MIB name, with the given entry MIB names, or null if the parent does not exist.|\n\n## SNMPResponse - getOIDText\\(String name\\)\n\nReturns the text contained in the OID object with the given MIB name.\n\n|Name|Type|Description|\n|----|----|-----------|\n|name|String|The MIB name|\n\n|Type|Description|\n|----|-----------|\n|String|The text contained in the OID object. Returns null if the object could not be found, or if it has no text.|\n\n## SNMPResponse - normalize\\(Object cur\\)\n\nResolves SNMP tables into hashmaps and OID values into primitives.\n\nAll 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.\n\n|Name|Type|Description|\n|----|----|-----------|\n|cur|Object|The SNMP table or OID value.|\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n"}}