Snmp Receiver
contrib
Maintainers: @tamir-michaeli
Source: opentelemetry-collector-contrib
Supported Telemetry
Overview
Purpose
The purpose of this receiver is to allow users to generically monitor metrics using SNMP. If one of the specified SNMP data values cannot be loaded on startup, a warning will be printed, but the application will not fail fast.Prerequisites
This receiver supports SNMP versions:- v1
- v2c
- v3
Configuration
Connection Configuration
These configuration options are for connecting to a SNMP host.collection_interval: (default =10s): This receiver collects metrics on an interval. This value must be a string readable by Golang’s time.ParseDuration. Valid time units arens,us(orµs),ms,s,m,h.timeout: (default:5s): Timeout for each SNMP request. This value must be a string readable by Golang’s time.ParseDuration. Valid time units arens,us(orµs),ms,s,m,h.endpoint(default:udp://localhost:161): SNMP endpoint to connect to in the form of[udp|tcp][://]{host}[:{port}]- If no scheme is supplied, a default of
udpis assumed - If no port is supplied, a default of
161is assumed
- If no scheme is supplied, a default of
version: (default =v2c): SNMP version options arev1: SNMP version 1v2c: SNMP version 2cv3: SNMP version 3
community: (default =public): The community string for the SNMP connection. This is not available for SNMP versionv3.user: The user for the SNMP connection. This is only available for SNMP versionv3.security_level: (default =no_auth_no_priv): The security requirements of the SNMP connection. This is only available for SNMP versionv3. SNMPsecurity_leveloptions areno_auth_no_priv: No authentication protocol and no privacy protocol usedauth_no_priv: Authentication protocol is used but no privacy protocol usedauth_priv: Both authentication and privacy protocols are used
auth_type: (default =MD5): The authentication protocol used for the SNMP connection. This is only available ifsecurity_levelis not set tono_auth_no_priv. SNMPauth_typeoptions areMD5SHASHA224SHA256SHA384SHA512
auth_password: The authentication password used for the SNMP connection. This is only available ifsecurity_levelis not set tono_auth_no_priv.privacy_type: (default =DES): The privacy protocol used for the SNMP connection. This is only available ifsecurity_levelis set toauth_priv. SNMPprivacy_typeoptions areDESAESAES192AES256AES192cAES256c
privacy_password: The privacy password used for the SNMP connection. This is only available ifsecurity_levelis set toauth_priv.
Metric/Attribute Configuration
These configuration options are for determining what metrics and attributes will be created with what SNMP dataresource_attributes: This may be configured with one or more key value pairs of resource attribute names and resource attribute configurations.attributesThis may be configured with one or more key value pairs of attribute names and attribute configurationsmetrics: This is the only required parameter. The must be configured with one or more key value pairs of metric names and metric configuration.
Resource Attribute Configuration
Resource attribute configurations are used to define what resource attributes will be used in a collection.| Field Name | Description | Value |
|---|---|---|
oid | Required if no scalar_oid or indexed_value_prefix. This is the column OID in a SNMP table which will use the returned indexed SNMP data to create resource attribute values for unique resources. Metric configurations will reference these resource attribute configurations in order to assign metrics data to resources | string |
scalar_oid | Required if no oid or indexed_value_prefix. This is the scalar OID which will return non-indexed SNMP data to create resource attribute values for unique resources. Metric configurations will reference these resource attribute configurations in order to assign metrics data to resources | string |
indexed_value_prefix | Required if no scalar_oid or oid. This is a string prefix which will be added to the indices of returned metric indexed SNMP data to create resource attribute values for unique resources. Metric configurations will reference these resource attribute configurations in order to assign metrics data to resources | string |
description | Definition of what the resource attribute represents | string |
Attribute Configuration
Attribute configurations are used to define what resource attributes will be used in a collection.| Field Name | Description | Value |
|---|---|---|
oid | Required if no indexed_value_prefix or enum. This is the column OID in a SNMP table which will use the returned indexed SNMP data to create attribute values for the attribute. Metric configurations will reference these attribute configurations in order to assign these attributes and indexed data values to metrics and their datapoints | string |
indexed_value_prefix | Required if no oid or enum. This is a string prefix which will be added to the indices of returned metric indexed SNMP data to create attribute values the attribute. Metric configurations will reference these attribute configurations in order to assign these attributes and index based value to metrics and their datapoints | string |
enum | Required if no oid or indexed_value_prefix. This should be a list of values that are possible for this attribute. Metric configurations will reference these attribute configurations in order to assign these attributes and values to metrics and their datapoints | string[] |
description | Definition of what the attribute represents | string |
Metric Configuration
| Field Name | Description | Value | Default |
|---|---|---|---|
unit | Required. To display what is actually being measured for this metric | string | 1 |
gauge | Required if no sum. Details that this metric is of the gauge type | GaugeMetric | |
sum | Required if no gauge. Details that this metric is of the sum type | SumMetric | |
column_oids | Required if no scalar_oids. Details that this metric is made from one or more columns in an SNMP table. The returned indexed SNMP data for these OIDs might either be datapoints on a single metrics, or datapoints across multiple metrics attached to different resources depending on the column OID configurations | ColumnOID[] | |
scalar_oids | Required if no column_oids. Details that this metric is made from one or more scalard SNMP values (multiple scalar OIDs would represent multiple datapoints within the same metric) | ScalarOID[] | |
description | Definition of what the metric represents | string |
GaugeMetric Configuration
| Field Name | Description | Value | Default |
|---|---|---|---|
value_type | The value type of this metric’s data. Can be either int or double | string | double |
SumMetric Configuration
| Field Name | Description | Value | Default |
|---|---|---|---|
value_type | The value type of this metric’s data. Can be either int or double | string | double |
monotonic | Whether this is a monotonic sum or not | bool | false |
aggregation | The aggregation type of this metric’s data. Can be either cumulative or delta | string | cumulative |
ScalarOID Configuration
| Field Name | Description | Value | Default |
|---|---|---|---|
oid | The SNMP scalar OID value to grab data from (must end in .0). | string | |
resource_attributes | The names of the related resource attribute configurations, allowing scalar oid metrics to be added to resources that have one or more scalar oid resource attributes. Cannot have indexed resource attributes as values. | string[] | |
attributes | The names of the related attribute enum configurations as well as the values to attach to this returned SNMP scalar data. This can be used to have a metric config with multiple ScalarOIDs as different datapoints with different attribute values within the same metric | Attribute |
ColumnOID Configuration
| Field Name | Description | Value | Default |
|---|---|---|---|
oid | The SNMP scalar OID value to grab data from (must end in .0). | string | |
attributes | The names of the related attribute configurations as well as the enum values to attach to this returned SNMP indexed data if the attribute configuration has enum data. This can be used to attach a specific metric SNMP column OID to an attribute. In doing so, multiple datapoints for a single metric will be created for each returned SNMP indexed data value for the metric along with different attribute values to differentiate them. This also can be used to have a metric config with multiple ColumnOIDs as different datapoints with different attribute values within the same metric | Attribute[] | |
resource_attributes | The names of the related resource attribute configurations. This is used to attach a specific metric SNMP column OID to a resource attribute. In doing so, multiple resources will be created for each returned SNMP indexed data value for the metric | string[] |
Attribute
| Field Name | Description | Value | Default |
|---|---|---|---|
name | The name of the attribute configuration that this data refers to | string | |
value | If the referred to attribute configuration is of enum type, the specific enum value that should be used for this specific attribute | string |
Example Configuration
Configuration
Example Configuration
Last generated: 2026-04-13