Skip to main content
Version: Next

SNMP

SNMPv2c polling source connector

Description

The SNMP source polls an SNMP agent over UDP by sending an SNMPv2c GET request for an explicit list of numeric OIDs. Each returned variable binding becomes one row. This first version does not perform WALK, GETNEXT, or GETBULK.

Batch jobs perform exactly one poll and then finish. Streaming jobs repeat the same GET request after poll_interval_millis. The source uses one split, so its parallelism must be 1.

Support Those Engines

Spark
Flink
SeaTunnel Zeta

Key Features

Supported DataSource Info

The connector uses SNMP4J and supports SNMPv2c agents reachable over UDP.

DatasourceSupported VersionsDependency
SNMP agentSNMPv2cDownload

Source Options

NameTypeRequiredDefaultDescription
hostStringYes-SNMP agent host name or IP address. Do not include a protocol or port.
portIntNo161SNMP agent UDP port.
communityStringYes-SNMPv2c community credential. The connector does not write this value to its logs or errors.
oidsList\<String>Yes-Explicit numeric OIDs sent in the GET request. Leading dots are accepted. Duplicate and symbolic OIDs are rejected.
timeout_millisLongNo5000Timeout in milliseconds for each request attempt.
retriesIntNo1Number of retries after the initial request attempt. A value of 0 sends one attempt.
poll_interval_millisLongNo60000Delay in milliseconds between completed streaming polls. Ignored by batch jobs.

Output Schema

The output schema is fixed and must not be configured with a schema option.

FieldTypeDescription
agentstringPolled agent in host:port form.
oidstringNumeric OID returned by the agent.
valuestringSNMP4J string representation of the returned value.
value_typestringSMI type name, such as Integer32, OctetString, TimeTicks, or noSuchInstance.
poll_timelongEpoch time in milliseconds captured when the poll starts. All rows from one poll share this value.

SNMP values use different SMI types. V1 preserves the type name and exposes SNMP4J's textual representation instead of coercing all values into one numeric type. Binary values may not round-trip byte-for-byte through the value field.

Batch Example

env {
parallelism = 1
job.mode = "BATCH"
}

source {
SNMP {
plugin_output = "snmp_metrics"
host = "192.0.2.10"
port = 161
community = ${SNMP_COMMUNITY}
oids = [
"1.3.6.1.2.1.1.3.0",
"1.3.6.1.2.1.1.5.0"
]
timeout_millis = 3000
retries = 1
}
}

sink {
Console {}
}

Streaming Example

env {
parallelism = 1
job.mode = "STREAMING"
}

source {
SNMP {
plugin_output = "snmp_metrics"
host = "192.0.2.10"
community = ${SNMP_COMMUNITY}
oids = ["1.3.6.1.2.1.1.3.0"]
timeout_millis = 3000
retries = 2
poll_interval_millis = 30000
}
}

sink {
Console {}
}

Failure and Security Behavior

  • A timeout after all configured attempts fails the source task.
  • A non-zero SNMP response error status fails the source task; partial response rows are not emitted.
  • Closing or cancelling the source closes the SNMP transport and stops later polls.
  • Treat community as a credential. Supply it through configuration substitution or another secret-management path, and do not place a real value in job files committed to source control.
Change Log
ChangeCommitVersion
[Feature][Connector-V2] Add SNMPv2c polling source connector-Next