Skip to content
Stand with Ukraine flag

SNMP API

ThingsBoard Edge acts as an SNMP manager — it polls SNMP-enabled devices on the local network on a configurable schedule. Devices do not initiate connections to Edge; Edge reaches out to them.

Default port: 161 UDP (Edge polls devices on this port)

SNMP devices require a device profile configured with:

  • Transport type: SNMP
  • SNMP version: v1, v2c, or v3
  • Host: IP address or hostname of the SNMP device
  • Port: SNMP port on the device (default 161)

To configure a SNMP device profile: go to Profiles → Device profiles → Add device profile, select SNMP as the transport type.

SNMP versionCredential fields
v1 / v2cCommunity string (e.g., public)
v3Username, security name, context name, engine ID, authentication protocol (MD5, SHA-1, SHA-224/256/384/512), auth passphrase, privacy protocol (DES, AES-128/192/256), privacy passphrase

Set credentials on the Device credentials tab of the device or in the device profile.

Map SNMP OIDs to ThingsBoard attribute and telemetry keys in the SNMP section of the device profile:

FieldDescription
OIDFull OID string (e.g., 1.3.6.1.2.1.1.3.0)
KeyThingsBoard attribute or telemetry key name
Data typeInteger, string, long, boolean, double
ScopeTELEMETRY or CLIENT_SCOPE (attribute)

Edge reads the mapped OIDs at each polling interval and publishes the values as telemetry or attributes. Values are stored locally and synced to the ThingsBoard server over gRPC.

The polling interval is configured per device profile in the SNMP transport configuration section. The minimum polling interval is one second.

Send SNMP GET and SET commands to devices via the ThingsBoard RPC API:

RPC methodSNMP operationDescription
getSNMP GETRead the value of one or more OIDs
setSNMP SETWrite a value to an OID

RPC commands reference an OID mapping key configured in the device profile. For a GET command:

{
"method": "GET",
"params": {
"key": "systemInfo"
}
}

Response is routed to the next rule node as:

{"systemInfo": "SNMP device"}

For a SET command, include the value to write:

{
"method": "SET",
"params": {
"key": "lastUpdateTime",
"value": "12901200312"
}
}

The value is sent as OCTET STRING for all data types except LONG, which uses INTEGER — a signed 32-bit integer.