---
title: SNMP Metrics
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > Network Monitoring > Network Device Monitoring > SNMP Metrics
---

# SNMP Metrics

## Installation{% #installation %}

Network Device Monitoring relies on the SNMP Integration included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package, and supports all three versions of SNMP: `SNMPv1`, `SNMPv2`, and `SNMPv3`. During discovery, the SNMP port (default 161) is polled. A device is considered discovered if there is a response and a matching profile.

## Pre-requisites{% #pre-requisites %}

Agent v7.32+

## How it works{% #how-it-works %}

The following diagram illustrates the default ports and protocols between the Datadog Agent and the device being monitored. For SNMP metrics, the Datadog Agent polls the devices with Autodiscovery, or based on manual device IP configuration. The Datadog Agent, configured with NDM and deployed on-premises or in the cloud, consolidates all collected device and network data from your network and sends it to Datadog over HTTPS on port `443`. This provides unified, full-stack observability of metrics, logs, traces, monitors, and dashboards.

{% image
   source="https://datadog-docs.imgix.net/images/network_device_monitoring/snmp/snmp_device_polling.3266cd75a1dcae76710170b9107f2067.png?auto=format"
   alt="NDM Diagram showing the flow for SNMP device polling." /%}

## Next steps{% #next-steps %}

Follow the instructions below to configure Datadog to collect SNMP metrics from your network devices.

## Configuration{% #configuration %}

Datadog Network Device Monitoring supports collecting metrics from individual devices, or auto-discovering devices (unique IP addresses) on entire subnets.

Choose your collection strategy based on the number of devices present on your network, and how dynamic your network is (meaning frequency of adding or removing devices):

{% dl %}

{% dt %}
Monitoring individual devices
{% /dt %}

{% dd %}
For small and mostly static networks.
{% /dd %}

{% dt %}
Autodiscovery
{% /dt %}

{% dd %}
For larger or dynamic networks.
{% /dd %}

{% /dl %}

Regardless of the collection strategy, leverage Datadog's [sysObjectID mapped device profiles](https://docs.datadoghq.com/network_monitoring/devices/profiles#sysoid-mapped-devices) to automatically collect relevant metrics from your devices.

### Monitoring individual devices{% #monitoring-individual-devices %}

To monitor individual devices:

- Include the IP address and any additional devices metadata (as tags) in the `snmp.d/conf.yaml` file in the `conf.d/` folder at the root of your [Agent's configuration directory](https://docs.datadoghq.com/agent/configuration/agent-configuration-files/#agent-configuration-directory). See the [sample snmp.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/snmp/datadog_checks/snmp/data/conf.yaml.example) for all available configuration options.

{% tab title="SNMPv2" %}

- For SNMPv2, configure an instance specifying the IP address and *community string* of the device:

  ```yaml
  init_config:
    loader: core  # use core check implementation of SNMP integration. recommended
    use_device_id_as_hostname: true  # recommended
  instances:
  - ip_address: '1.2.3.4'
    community_string: 'sample-string'  # enclose with single quote
    tags:
      - 'key1:val1'
      - 'key2:val2'
  ```

{% /tab %}

{% tab title="SNMPv3" %}

- For SNMPv3, configure an instance specifying the IP address and SNMPv3 credentials of the device (as appropriate), for example: `user`, `authProtocol`, `authKey`, `privProtocol`, and `privKey`:

  ```yaml
  init_config:
    loader: core  # use core check implementation of SNMP integration. recommended
    use_device_id_as_hostname: true  # recommended
  instances:
  - ip_address: '1.2.3.4'
    snmp_version: 3  # optional, if omitted which version of SNMP you are using is auto-detected
    user: 'user'
    authProtocol: 'SHA256'  # choices: MD5, SHA, SHA224, SHA256, SHA384, SHA512
    authKey: 'fakeKey'  # enclose with single quote
    privProtocol: 'AES256'  # choices: DES, AES, AES192, AES192C, AES256, AES256C
    privKey: 'fakePrivKey'  # enclose with single quote
    tags:
      - 'key1:val1'
      - 'key2:val2'
  ```

{% /tab %}

- [Restart the Agent](https://docs.datadoghq.com/agent/configuration/agent-commands/?tab=agentv6v7#start-stop-and-restart-the-agent).

After setup, the Agent collects relevant metrics by matching your devices to one of [Datadog's supported device profiles](https://docs.datadoghq.com/network_monitoring/devices/supported_devices).

To expand your setup:

- Add more instances to collect metrics from more devices on your network.
- Use Autodiscovery if you need to collect metrics from lots of devices across a dynamic network.

### Autodiscovery{% #autodiscovery %}

An alternative to specifying individual devices is to use Autodiscovery to automatically discover all the devices on your network.

Autodiscovery polls each IP on the configured subnet, and checks for a response from the device. Then, the Datadog Agent looks up the `sysObjectID` of the discovered device and maps it to one of [Datadog's supported device profiles](https://docs.datadoghq.com/network_monitoring/devices/supported_devices). The profiles contain lists of predefined metrics to collect for various types of devices.

To use Autodiscovery with Network Device Monitoring:

1. Install or upgrade the Datadog Agent to v7.27+. For platform specific instructions, see the [Datadog Agent](https://docs.datadoghq.com/agent) documentation.

1. Edit the [`datadog.yaml`](https://docs.datadoghq.com/agent/configuration/agent-configuration-files/?tab=agentv6v7#agent-main-configuration-file) Agent configuration file to include all the subnets for Datadog to scan. The following sample config provides required parameters, default values, and examples for Autodiscovery.

1. Optionally, enable [de-duplication](https://github.com/DataDog/datadog-agent/blob/main/pkg/config/config_template.yaml#L4036) of devices during Autodiscovery of the Agent. This feature is disabled by default and requires Agent version `7.67+`.

   ```yaml
   network_devices:
     autodiscovery:
       use_deduplication: true
   ```

{% tab title="SNMPv2" %}

```yaml
network_devices:
  autodiscovery:
    ## use_deduplication - boolean - optional - default: false
    workers: 100  # number of workers used to discover devices concurrently
    discovery_interval: 3600  # interval between each autodiscovery in seconds
    loader: core  # use core check implementation of SNMP integration. recommended
    use_device_id_as_hostname: true  # recommended
    configs:
      - network_address: 10.10.0.0/24  # CIDR subnet
        loader: core
        snmp_version: 2
        port: 161
        community_string: '***'  # enclose with single quote
        tags:
          - "key1:val1"
          - "key2:val2"
      - network_address: 10.20.0.0/24
        loader: core
        snmp_version: 2
        port: 161
        community_string: '***'
        tags:
          - "key1:val1"
          - "key2:val2"
```

{% /tab %}

{% tab title="SNMPv3" %}

```yaml
network_devices:
  autodiscovery:
    ## use_deduplication - boolean - optional - default: false
    workers: 100  # number of workers used to discover devices concurrently
    discovery_interval: 3600  # interval between each autodiscovery in seconds
    loader: core  # use core check implementation of SNMP integration. recommended
    use_device_id_as_hostname: true  # recommended
    configs:
      - network_address: 10.10.0.0/24  # CIDR subnet
        snmp_version: 3
        user: 'user'
        authProtocol: 'SHA256'  # choices: MD5, SHA, SHA224, SHA256, SHA384, SHA512
        authKey: 'fakeKey'  # enclose with single quote
        privProtocol: 'AES256'  # choices: DES, AES, AES192, AES192C, AES256, AES256C
        privKey: 'fakePrivKey'  # enclose with single quote
        tags:
          - 'key1:val1'
          - 'key2:val2'
      - network_address: 10.20.0.0/24
        snmp_version: 3
        user: 'user'
        authProtocol: 'SHA256'
        authKey: 'fakeKey'
        privProtocol: 'AES256'
        privKey: 'fakePrivKey'
        tags:
          - 'key1:val1'
          - 'key2:val2'
```

{% /tab %}

**Note**: The Datadog Agent automatically configures the SNMP check with each of the IPs that are discovered. A discovered device is an IP that responds successfully when being polled using SNMP.

**Note**: Make sure you are on Agent 7.54+ for this syntax. For previous versions, see the [previous config_template.yaml](https://github.com/DataDog/datadog-agent/blob/51dd4482466cc052d301666628b7c8f97a07662b/pkg/config/config_template.yaml#L855)

### Override interface speed{% #override-interface-speed %}

By default, the SNMP check reports interface speed as detected from the device. If the physical port speed differs from the actual circuit bandwidth, for example, a 1 Gbps physical port provisioned for a 50 Mbps circuit, you can override the inbound and outbound speed for specific interfaces using `interface_configs`.

Add `interface_configs` to your instance configuration in `snmp.d/conf.yaml`:

```yaml
instances:
  - ip_address: '1.2.3.4'
    community_string: 'sample-string'
    interface_configs:
      - match_field: name      # match by interface name or ifIndex
        match_value: eth0      # case-sensitive
        in_speed: 50000000     # inbound speed in bytes per second (50 Mbps)
        out_speed: 50000000    # outbound speed in bytes per second (50 Mbps)
```

For all available `interface_configs` options, see the [sample snmp.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/snmp/datadog_checks/snmp/data/conf.yaml.example).

## Validation{% #validation %}

[Run the Agent's status subcommand](https://docs.datadoghq.com/agent/configuration/agent-commands/#agent-status-and-information) and look for `snmp` under the Checks section.

## Further Reading{% #further-reading %}

- [Using Profiles with Network Device Monitoring](https://docs.datadoghq.com/network_monitoring/devices/profiles)
- [SNMP Monitoring Overview](https://www.datadoghq.com/knowledge-center/network-monitoring/snmp-monitoring/)
- [Monitor SNMP with Datadog](https://www.datadoghq.com/blog/monitor-snmp-with-datadog/)
