Monitoring SNMP Devices with Datadog - Polling and Traps
To watch your company's routers and switches in Datadog, you set up polling, where the Agent goes to the device to fetch values, separately from traps, where the device notifies you of problems. Polling needs a path from the Agent to the device, traps need a path from the device to the Agent, and the authentication fields you write change with the SNMP version.
SNMP monitoring runs in two directions: fetching and receiving
When you watch routers and switches that cannot run an Agent in Datadog, data flows in two directions. One is polling, where the Agent queries the device's SNMP port to collect values; the default port is 161. The other is traps, where the device notifies the Agent of sudden changes in state, and only Agent v7.37 or later can act as the receiver (as of October 2026; source: SNMP Metrics / SNMP Traps). The official documentation gives the example of an interface that goes down and back up every 15 seconds, which polling every 60 seconds cannot fully capture. The division of roles is that traps pick up fluctuations shorter than the collection interval.
| Item | Polling | Traps |
|---|---|---|
| Direction | The Agent queries the device | The device sends to the Agent |
| Where to configure | snmp.d/conf.yaml (one device at a time) or network_devices.autodiscovery in datadog.yaml | network_devices.snmp_traps in datadog.yaml |
| Port | Port 161 on the device side (default) | A UDP port opened on the Agent side (the official example is port 9162) |
| How it appears in Datadog | Metrics and the device list in Network Devices | Logs (source:snmp-traps) |
| Changes it catches well | Trends in bandwidth utilization and traffic sent and received | Sudden changes in state, and faults in components such as batteries and chassis |
In either direction, the values the Agent collects are sent to Datadog over HTTPS on port 443. The overall picture of NDM and how billing counts per device are covered in the Network Monitoring explanation, and you can find how to read the pricing from the pricing guide.
List devices one by one, or have it scan whole subnets
There are two ways to write the polling configuration. The official documentation recommends specifying devices one by one for networks with few devices that rarely change, and Autodiscovery for networks that are large or where devices come and go often. To specify them one by one, list ip_address entries under instances in snmp.d/conf.yaml in the conf.d/ folder of the Agent's configuration directory. With Autodiscovery, you write subnets in CIDR notation in datadog.yaml, and the Agent queries each IP in that range one at a time (as of October 2026; source: SNMP Metrics). With either approach, place the Agent on a host that can reach port 161 on the devices and get out to port 443 at Datadog. For installing it on a Linux host, the steps in installing the Agent on Linux are enough.
- Query the IPs in the subnets written in datadog.yaml in order
- Read the sysObjectID of each IP that responds
- Apply the device profile that matches the sysObjectID
- Automatically configure an SNMP check for each IP found
Here is an example for one subnet.
network_devices:
autodiscovery:
workers: 100
discovery_interval: 3600
loader: core
use_device_id_as_hostname: true
configs:
- network_address: 10.10.0.0/24
snmp_version: 2
port: 161
community_string: '<community-name>'discovery_interval sets the interval between rescans, in seconds. This format requires Agent 7.54 or later. use_deduplication, which removes duplicates, is disabled by default and requires Agent 7.67 or later. Despite the shared name, it targets something different from Autodiscovery, which builds configuration from container labels.
How authentication is written differs by SNMP version
When the SNMP version changes, the authentication values you write in the configuration change too. The official documentation states that all three versions, SNMPv1 / v2 / v3, are supported. For v2 you write a single community name in community_string; for v3, in addition to the user name, you write a protocol and a key for both authentication (auth) and privacy (priv). When specifying devices one by one, omitting snmp_version makes the version detected automatically, and the official examples enclose every value in single quotes (as of October 2026; source: SNMP Metrics). The trap receiver takes the same kinds of values, but the field names differ slightly.
| Value to write | Polling (conf.yaml / autodiscovery) | Traps (snmp_traps) |
|---|---|---|
| v2 community name | One in community_string | A list of allowed names in community_strings |
| v3 user name | user | user in each element of users |
| v3 authentication | authProtocol and authKey (MD5 / SHA / SHA224 / SHA256 / SHA384 / SHA512) | Same field names |
| v3 privacy | privProtocol and privKey (DES / AES / AES192 / AES192C / AES256 / AES256C) | Same field names |
| Multiple v3 users | Write them in separate configurations per device or subnet (the author's interpretation) | Agent 7.51 or later lets you list several under users |
The polling side uses the singular community_string and the trap side the plural community_strings, names that differ by a single letter. The polling-side entry for "multiple v3 users" in the table is not stated in the official documentation; it is the author's interpretation based on the configuration format, which takes one user. Here, we recommend gathering the community names and v3 users configured on your devices into a single table and copying from that same table into both the polling and trap configurations. This avoids mismatches where an old value remains on only one side.
Profiles decide which values are collected
You do not need to pick the metrics to collect for each device by hand. The Agent reads the device's sysObjectID, matches it to a vendor-specific profile provided by Datadog, and decides which values to collect for that type of device. Under the conditions in the official documentation, a device is treated as discovered when its IP responds on the SNMP port and has a matching profile. Devices without a vendor-specific profile get the generic profile. The generic profile collects TCP / UDP / IP values and basic interface values such as bandwidth utilization and traffic sent and received (as of October 2026; source: Supported Devices).
| Device situation | Values collected | What to do when something is missing |
|---|---|---|
| The vendor and model are in a profile | The values defined in that profile | Use it as is |
| The vendor is there but the model is not | The basic values of the generic profile | Create a new profile, or add the sysobjectid to an existing profile |
| The vendor itself is not on the list | The basic values of the generic profile | If you need values from the vendor's MIB, send a request to support with snmpwalk output attached |
If you do not know a device's sysObjectID, you can find it by reading OID 1.3.6.1.2.1.1.2 with snmpwalk from a host that can reach the device. Where the physical port speed differs from the contracted line speed (the official example is a 50 Mbps line on a 1 Gbps port), by default utilization is calculated from the speed the device reports. You can override the inbound and outbound speeds per interface with interface_configs in snmp.d/conf.yaml (source: SNMP Metrics).
Receiving traps on port 162 means reapplying permissions after every Agent update
You open the receiver by writing enabled: true and the port to listen on under network_devices.snmp_traps in datadog.yaml. The official example is port 9162. Listening on a port below 1024 requires elevated privileges, so if you want to receive on 162, the default port for SNMP traps, grant CAP_NET_BIND_SERVICE to the Agent binary with setcap. The official documentation notes that this setcap must be rerun every time the Agent is updated, so it is worth adding a line to your update runbook. Allow inbound UDP to the listening port in your firewall (as of October 2026; source: SNMP Traps).
network_devices:
snmp_traps:
enabled: true
port: 9162
community_strings:
- <community-name>- The device sends the source IP, an OID representing the trap type, and pairs of OIDs and values
- The Agent converts the OIDs to readable names using the TrapsDB mapping (Resolution)
- They arrive in Datadog as logs (source:snmp-traps)
- View them in Log Explorer and in the Events tab of Network Devices
The mapping used for name conversion is in snmp.d/traps_db/dd_traps_db.json.gz, and Datadog supports more than 10,000 MIBs (as of October 2026). For in-house custom MIBs, create a TrapsDB file with ddev meta snmp generate-traps-db and place it in the same traps_db/ directory so it can be read. Traps arrive as logs, but you do not need to set logs_enabled to true. Once you have searched for source:snmp-traps in Log Explorer and seen how they arrive, you can set up a monitor that catches specific types of traps.
If you run it alongside Zabbix, decide on namespaces first
For sites that already monitor SNMP with Zabbix or similar tools, the author recommends not switching over all at once but allowing a period where both run side by side. How to set up running them together is covered in the comparison of Datadog and Zabbix. What you want to decide first on the Datadog side is the namespace. If each site reuses the same private IPs, devices cannot be told apart by IP alone. The official documentation shows an example where an Agent is placed at each site and each sends data with a different namespace (as of October 2026; source: SNMP Traps).
| Site | Device IP | Namespace of that site's Agent |
|---|---|---|
| Tokyo data center | 10.0.0.1 | tokyo |
| Osaka data center | 10.0.0.1 | osaka |
If you omit the namespace it becomes default, and the official documentation advises against configurations where only some Agents have one. The same network_devices.namespace is also used when receiving NetFlow to tell apart devices with reused IPs (source: NetFlow Monitoring). Even when you get to the stage of looking at flow volume, you can keep using the same site names. The order is to decide how to name sites before adding the first subnet.
Check the device count in Network Devices against your device inventory
After adding the configuration and restarting the Agent, check the output of the Agent's status subcommand to see whether snmp appears in the Checks section (source: SNMP Metrics). Next, open Infrastructure > Network Devices in Datadog and check whether the devices in the first subnet you added are listed. Only IPs that both respond and match a profile become discovered devices, so for devices that are missing, suspect the SNMP port response and the community name first. Extract one subnet's worth from your device inventory and count whether it matches the number listed on screen. For the IPs of devices that do not add up, run snmpwalk from the Agent's host to confirm they respond. For traps, once you have pointed the destination on the device side at the Agent's IP and port, you can conclude that traffic reaches the receiver when the first event arrives in the Events tab.