Skip to content

Latest commit

 

History

History
127 lines (92 loc) · 2.89 KB

snmptransport.adoc

File metadata and controls

127 lines (92 loc) · 2.89 KB

SNMPTransport

Represents SNMP Transport functionality. Objects of this class are typically obtained from nodes that support SNMP. Objects of this class used to access SNMP data form node.

Instance attributes

snmpVersion ⇒ String

SNMP version used by the transport. Can be "1", "2c" or "3"

Instance methods

get(oid) ⇒ [class-snmpvarbind]

Get the object value from specific node with SNMP GET request. The node and all SNMP communication details defined by SNMP transport. Returns [class-snmpvarbind] object. Will return null on failure.

Table 1. Parameters

oid

String

SNMP object id. Can be given with or without leading dot.

getValue(oid) ⇒ String

Get the object value from specific node with SNMP GET request. The node and all SNMP communication details defined by SNMP transport. This function is similar to SNMPGet but returns string instead of an SNMPVarBind object. Will return null on failure.

Table 2. Parameters

oid

String

SNMP object id. Can be given with or without leading dot.

Example
println($node.createSNMPTransport()?.getValue("1.3.6.1.2.1.1.2.0")); // Will print e.g. 1.3.6.1.4.1.14988.1
getValues(array) ⇒ String

Get object values from specific node with SNMP GET request. Request will contain all values that are provided in array. The node and all SNMP communication details defined by SNMP transport.

Table 3. Parameters

array

Array

Array with SNMP object ids to get

Return

Array with resulting strings for each array

set(oid, value, dataType) ⇒ Boolean

Assign a specific value to the given SNMP object for the node. The node and all SNMP communication details defined by SNMP transport. Will return TRUE on success, FALSE in case of failure.

Table 4. Parameters

oid

String

SNMP object id. Can be given with or without leading dot.

value

String

Value to assign to oid.

dataType

String

SNMP data type (optional).

walk(oid) ⇒ Array

Get an array of the [class-snmpvarbind] from specific node with SNMP WALK request. The node and all SNMP communication details defined by SNMP transport. Will return null on failure.

Table 5. Parameters

oid

String

SNMP object id. Can be given with or without leading dot.

Constants

Table 6. SNMP data types
Description Value

Integer.

INTEGER

Same as INTEGER.

INT

Octet string.

STRING

Object id.

OID

IP address.

IPADDR

Same as IPADDR.

IP ADDRESS

32-bit counter.

COUNTER32

32-bit unsigned integer.

GAUGE32

Timeticks.

TIMETICKS

64-bit counter.

COUNTER64

32-bit unsigned integer.

UINTEGER32

Same as UINTEGER32.

UINT32