SNMP: Write Node
The SNMP: Write Node allows you to write values to one or more OIDs on your SNMP device. This node is available in edge workflows.
Node Properties
There are three categories to the configuration for the SNMP: Write Node: the connection, the write instructions, and optionally the result.
Connection Configuration
First, configure the information to establish a connection to the device.
- Host Template: (Required) A string template for the destination address. This can be either an IPv4 or IPv6 address, or a hostname that resolves to an address.
- Port Template: (Optional) A string template or integer for the UDP port at the target address. If not given defaults to port 161.
- Source Port Template: (Optional) A string template or integer for the UDP port from which the message should be sent on the edge device. If not provided, a random port is selected at runtime.
- SNMP Version: (Required) The version of SNMP with which to establish a connection. Options are
Version1
,Version2c
, orVersion3
. Defaults toVersion2c
.
Depending on the version selected, additional input is required.
Version1 and Version2c Configuration
- Community Template: (Required) A string template for the community credential delivered with the request. Defaults to
public
.
Version3 Configuration
- Username Template: (Required) A string template for the username.
- Security Level: (Required) The amount of security to use when establishing the SNMP connection. Options are
No Authentication or Encryption
,Authenticate, No Encryption
, andAuthenticate and Encrypt
. - Authentication Method: The protocol to use for authentication. Required if the selected security level requires authentication. Options are
SHA
orMD5
. Defaults toSHA
. - Authentication Key: A string template for the authentication key. Required if the selected security level requires authentication.
- Encryption Method: The method to use to encrypt the requested data. Options are
DES
orAES
. Defaults toDES
. Required if the selected security level requires encryption. - Private Key: A string template for the key to use when encrypting the requested data. Required if the selected security level requires encryption.
Write Instructions
Next, indicate the instructions to write values. Write Instructions can either be specified with an array of template strings or by pointing to a payload path with the required instructions. At least one instruction is required.
-
Array of Template Strings: For each instruction, the following configuration fields are available:
- OID Template: (Required) Template for the OID to which to write.
- Value Type: (Required) The SNMP data type to write. Defaults to
Integer
. - Write Value Template: Template for the value to write to the OID. This value must correspond to the specified value type. Required unless Value Type is
Null
. - Result Key: (Optional) The key at which to store the result of the write operation. This key exists at the Result Path.
-
Payload Path: Enter a payload path that resolves to an array of Write Instructions to be run on this node. The following are the object properties that each object in the array should contain for successful writes:
- oid: (Required) Template for the OID to which to write.
- type: The SNMP data type to write. Defaults to
Integer
if not provided. Valid types areBoolean
,Integer
,OctetString
,Null
,OID
,IpAddress
,Counter
,Gauge
,TimeTicks
,Opaque
. - value: Template for the value to write to the OID. This value must correspond to the specified value type. Required unless type is
Null
. - resultKey: (Optional) The key at which to store the result of the write operation. This key and its corresponding value will be placed on the Result Path.
Result (Optional)
Finally, you may optionally indicate the payload path at which the result should be placed. The result path defines where on the payload to store the result of the write(s). If values are successfully written, this represents an object with values at the given keys for each write. If there are any errors, the result includes an object with details about the error.
Node Example
The following is an example of data from a successful write:
{
"result": {
"first": "New Name",
"second": 75
}
}
Node Errors
The following is an example of a failed write due to timeout:
{
"error": {
"message": "Request timed out",
"type": "SnmpWriteError"
}
}
Related Nodes
Was this page helpful?
Still looking for help? You can also search the WEGnology Forums or submit your question there.