RuleGo RuleGo
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • AI Agent Framework
  • TPCLAW Agent Platform (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • AI Agent Framework
  • TPCLAW Agent Platform (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • Quick Start

  • Rule Chain

  • Standard Components

  • Extension Components

    • Extension Components Overview
    • filter

    • action

    • transform

    • external

    • ai

    • ci

    • IoT

      • IoT Components Overview
      • Input Endpoints

      • Protocol Acquisition

        • OPC_UA Read
        • OPC_UA Write
        • Modbus Node
        • Serial Communication
        • S7 Read
        • S7 Write
        • EtherNet/IP Read
        • EtherNet/IP Write
        • SNMP Read
        • SNMP Write
          • Configuration
          • Point Fields
          • Input
          • Features
          • Relation Type
          • Example
        • Modbus Read Points Node
        • Modbus Write Points Node
        • Universal Acquisition Read
        • IoT Write
        • IEC 104 Read
        • IEC 104 Write
        • FINS Node
        • FINS Read
        • FINS Write
        • MC Node
        • MC Read
        • MC Write
        • DL/T 645 Node
        • DL/T 645 Read
        • DL/T 645 Write
      • Time-Series Database

      • 控制

      • IoT Scenarios
    • Stream Processing

    • Service Discovery

    • file

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • Agent Framework

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

  • StreamSQL

目录

SNMP Write

x/snmpWrite component: v0.37 .0+ Writes (Set) OID values to network/facility devices (switches/routers/UPS/sensors, etc.) over the SNMP protocol (v1/v2c/v3).

Additional extension library required: rulego-components-iot (opens new window)

# Configuration

The connection configuration is identical to x/snmpRead; all fields are listed below:

Field Type Description Default
server string Device address (host or host:port, default port 161) 127.0.0.1:161
version string SNMP version, options: v1/v2c/v3 v2c
community string Community string (used by v1/v2c) public
timeout int Request timeout in seconds 5
v3 Security The following fields are used only when version=v3 (SNMPv3 USM security model)
securityLevel string Security level, options: noAuthNoPriv/authNoPriv/authPriv noAuthNoPriv
username string v3 user name None
authProtocol string Authentication protocol, options: None/MD5/SHA/SHA224/SHA256/SHA384/SHA512 None
authPassword string Authentication password None
privProtocol string Privacy (encryption) protocol, options: None/DES/AES/AES192/AES256 None
privPassword string Privacy password None
points Default point table
points []Point Default point list to write; when msg.Data carries valid points, msg.Data takes precedence None

# Point Fields

Fields of each Point (the write node uses name/addr/type/value):

Field Type Description Default
name string Point name (optional) None
addr string SNMP OID to write, e.g. 1.3.6.1.2.1.1.5.0 None
type string Value type, required, see the table below None
value string Value in string form, supports ${msg.xx} placeholders None
scale float Optional scale multiplier; conversion formula eng = raw*scale + offset 1
offset float Optional offset 0

type options (write value types):

type Description Aliases
Integer Integer integer, int
OctetString Byte string / string octetstring, string
ObjectIdentifier OID objectidentifier, oid
IPAddress IP address ipaddress, ip
Counter32 32-bit counter -
Gauge32 32-bit gauge gauge32, uint32
TimeTicks Time ticks timeticks
Counter64 64-bit counter counter64

# Input

Write points are read from msg.Data (a JSON array). If msg.Data is empty, the configured points are used. Format:

[
  { "addr": "1.3.6.1.2.1.1.5.0", "type": "OctetString", "value": "router-01" },
  { "addr": "1.3.6.1.2.1.1.6.0", "type": "OctetString", "value": "${msg.location}" }
]
1
2
3
4

value supports ${msg.xx} / ${metadata.xx} template variables. If any point fails to write, the node returns an error immediately and does not process subsequent points.

# Features

  • Template variables: the addr/type/value fields support ${msg.xx} / ${metadata.xx} placeholders.
  • Dynamic points: when msg.Data carries a valid point list (JSON array), it takes precedence — handy when points must be decided at runtime.
  • Same-chain connection pool: enables ref:// in-chain connection reuse; other nodes in the chain can borrow the connection by node ID to avoid reconnecting. See Component Connection Reuse.
  • Auto reconnect & retry: on write failure the node reconnects and retries up to 3 times (maxRetries=3).
  • SNMPv3 USM: fully supports the v3 User Security Model (authentication + encryption).

# Relation Type

  • Success: On success, the message is sent to the Success chain (the message payload is unchanged).
  • Failure: On failure, the message is sent to the Failure chain.

# Example

{
  "ruleChain": {
    "name": "snmp write demo",
    "root": true
  },
  "metadata": {
    "nodes": [
      {
        "type": "x/snmpWrite",
        "name": "write device config",
        "configuration": {
          "server": "192.168.1.1:161",
          "version": "v2c",
          "community": "private",
          "timeout": 5,
          "points": [
            { "name": "sysName", "addr": "1.3.6.1.2.1.1.5.0", "type": "OctetString", "value": "core-switch-01" },
            { "name": "sysLocation", "addr": "1.3.6.1.2.1.1.6.0", "type": "OctetString", "value": "${msg.location}" }
          ]
        }
      }
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Edit this page on GitHub (opens new window)
Last Updated: 2026/07/29, 07:07:39
SNMP Read
Modbus Read Points Node

← SNMP Read Modbus Read Points Node→

Theme by Vdoing | Copyright © 2023-2026 RuleGo Team | Apache 2.0 License

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式