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.
snmpVersion ⇒ String
-
SNMP version used by the transport. Can be "1", "2c" or "3"
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.
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.
oid |
String |
SNMP object id. Can be given with or without leading dot. |
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.
array |
Array |
Array with SNMP object ids to get |
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.
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.
oid |
String |
SNMP object id. Can be given with or without leading dot. |
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 |