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
          • Configuration
          • Point Fields
          • Output
          • Features
          • Relation Type
          • Example
        • SNMP Write
        • 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 Read

x/snmpRead component: v0.37.0+ Reads OIDs in batch from 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

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 collect; when msg.Data carries valid points, msg.Data takes precedence None

# Point Fields

Fields of each Point (the read node uses only name/addr):

Field Type Description Default
name string Point name, used to identify the result None
addr string SNMP OID, e.g. 1.3.6.1.2.1.1.5.0; prefix with walk: (case-insensitive, e.g. walk:1.3.6.1.2.1.2.2.1.10) to traverse the subtree, may return multiple records; without the prefix performs a Get None
scale float Optional scale multiplier; conversion formula eng = raw*scale + offset 1
offset float Optional offset 0

All fields support ${msg.xx} / ${metadata.xx} template variables. The type/value fields are write-node only and unused by the read node.

# Output

Read results (the unified Data list) are written back to msg.Data with dataType set to JSON. Format:

[
  {
    "name": "sysName",
    "address": "1.3.6.1.2.1.1.5.0",
    "value": "router-01",
    "type": "OctetString",
    "quality": "good",
    "timestamp": "2026-07-23T10:00:00.123Z"
  }
]
1
2
3
4
5
6
7
8
9
10
Field Type Description
name string Point name (from configuration)
address string The actual returned OID (when addr has a walk: prefix, the specific node under the subtree)
value any Value, type determined by the SNMP PDU type
type string SNMP type string: Integer/OctetString/ObjectIdentifier/IPAddress/Counter32/Gauge32/TimeTicks/Counter64/Null
quality string Data quality: good (success) / bad (failure)
timestamp string Collection timestamp (RFC3339 format)

A point with a walk: prefix may return multiple records; a single point failure does not affect others (marked quality=bad). Only when all points fail (a likely connection-level error) does the node reconnect and retry.

# Features

  • Scheduled collection: use an endpoint/schedule endpoint as a predecessor trigger, with OIDs configured in points.
  • Template variables: point fields (addr, etc.) 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 connection-level failure (all OIDs fail) 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.
  • Failure: On failure, the message is sent to the Failure chain.

# Example

{
  "ruleChain": {
    "name": "snmp read demo",
    "root": true
  },
  "metadata": {
    "nodes": [
      {
        "type": "x/snmpRead",
        "name": "read device info",
        "configuration": {
          "server": "192.168.1.1:161",
          "version": "v2c",
          "community": "public",
          "timeout": 5,
          "points": [
            { "name": "sysName", "addr": "1.3.6.1.2.1.1.5.0" },
            { "name": "ifInOctets", "addr": "walk:1.3.6.1.2.1.2.2.1.10" }
          ]
        }
      }
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

SNMPv3 example configuration fragment:

{
  "server": "192.168.1.1:161",
  "version": "v3",
  "timeout": 5,
  "securityLevel": "authPriv",
  "username": "admin",
  "authProtocol": "SHA",
  "authPassword": "authPass",
  "privProtocol": "AES",
  "privPassword": "privPass",
  "points": [
    { "name": "sysUpTime", "addr": "1.3.6.1.2.1.1.3.0" }
  ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Edit this page on GitHub (opens new window)
Last Updated: 2026/07/29, 07:07:39
EtherNet/IP Write
SNMP Write

← EtherNet/IP Write SNMP Write→

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

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