Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 997 Bytes

snmpgetvalue.adoc

File metadata and controls

48 lines (39 loc) · 997 Bytes

SNMPGetValue()

Important

Deprecated in 3.0.

Please use getValue method of [class-snmptransport] class.

SNMPGetValue(transport, oid) => String

Perform SNMP GET request for oid over provided transport and return single string value instead of varbind.

This function is a wrapper for [func-snmpget].

Table 1. Parameters

transport

Transport created by [func-createsnmptransport].

oid

SNMP OID string.

Return

String value of the result or null on failure.

Example
>>> transport = CreateSNMPTransport(FindObject("Server1"));
>>> if (transport != null) {
>>> oid = ".1.3.6.1.2.1.25.1.6.0"; // number of running processes
>>> value = SNMPGetValue(transport, oid);
>>> if (value != null) {
>>>     trace(1, value);
>>> }
>>> else {
>>>     trace(0, "SNMPGetValue() failed");
>>> }
>>> }