Linux Installation

Below are the steps for installing the autodiscovery module for scanning and configuring SNMP devices on the Datadog agent.

How it Works

The Autodiscovery module runs as a stand-alone script, that will take a set of parameters and use them to scan given subnets for SNMP devices. It will then add any known OID's and appropriate tags to the Datadog SNMP conf.yaml so that the Datadog agent can start polling those OID's.

This integration requires the Datadog agent to be installed on the host that will be used as a SNMP poller.

  1. Download the Autodiscovery package

  2. Install it on the server that will be used as a SNMP Poller

  3. Generate a Datadog API and App key

  4. Update the discovery.yaml file to scan the appropriate subnets, Datadog, and RapDev Keys

  5. Start the SNMP scans and use the Metrics Explorer in Datadog to verify the correct metrics

Step 1 - Download and Unzip the Autodiscovery Integration

wget https://files.rapdev.io/dd-snmp-autodiscovery.tar.gz
sudo tar zxvf dd-snmp-autodiscovery.tar.gz

Step 2 - Run the installer

Once downloaded and unzipped, you can run the installer by running the following command.

sudo ./dd-snmp-install.sh

After the installer is run, edit the discovery.example.yaml

Step 3 - Configure your integration

Edit discovery.example.yaml using your editor of choice.

The first block is the SNMP and Subnet configurations:

snmp_subnet_config:
- subnet:
snmp:
- udp_port:
snmp_version: 3
auth_name:
auth_key:
private_key:
auth_protocol:
priv_protocol:
blacklisted_hosts: []
tags: []
- subnet:
snmp:
- udp_port: 161
community_string: public
snmp_version: 2
blacklisted_hosts: []
tags: []
  • subnet: Accepts a list of subnets the format of 10.1.1.0/24, where the IP is following by the Subnet Mask. The list must be delineated using a comma, eg: subnet[10.2.3.0/24,192.168.0.0/16]

  • snmp: Accepts all the SNMP configuration variables. Each Subnet block must have its own SNMP configuration defined.

Subnets can only have 1 SNMP configuration per block. If you have SNMPv2 and SNMPv3 on the same subnet, you must define that subnet twice or narrow down the subnet mask.

  • blacklisted_hosts: Accepts a list of host IPs delineated by a comma, eg: blacklisted_hosts: [10.1.2.18,192.168.1.10]

  • tags: Accepts a list of strings, that will be added as tags to all metrics discovered and created on this subnet. eg: tags: [aws-region-east1, storage-network, cisco-devices]

The next block of configuration is the utility variables defined as follows

snmp_utils_config:
- timeout: 3
retries: 5
discovery_frequency: 1
  • Timeout: This is defined in seconds, and is used as a timeout variable when discovering new OID's

  • Retries: Number of times to retry the same OID before failing that OID

  • Discovery Frequency: The interval in hours for how frequently to auto-discovery the subnets defined. This is not the polling frequency. By default, Datadog has a polling frequency of 15 seconds per metric.

rapdev:
- token:
datadog:
- key:
app:
api_url:
  • RapDev Token: This is the token provided to you by the Sign-Up email. If you have not received one, please click here to generate a new token.

  • Datadog API Key: You can generate this from your Datadog account. Click here for more details

  • Datadog APP Key: You can generate this from your Datadog account. Click here for more details

  • API_URL: This is optional and should be used to point to the datadoghq.eu url only. If left blank, or off the YAML, the integration will default to datadoghq.com

You must provide a Datadog Key in order to auto-generate the Dashboards and Monitors for the discovered device types. If you do not provide a Datadog key, the metrics will be added to the dd-agent conf.yaml, but none of the Dashboards and Monitors will get generated.

Sample discovery.yaml config file

snmp_subnet_config:
- subnet: 10.81.45.102/32
snmp:
- udp_port: 161
snmp_version: 3
auth_name: rapdev
auth_key: shashasha
private_key: aesaesaes
auth_protocol: SHA
priv_protocol: AES
blacklisted_hosts: []
tags: [datacenter:boston, zone:1a]
- subnet: [10.67.36.0/24, 10.10.24.0/24]
snmp:
- udp_port: 161
snmp_version: 2
community_string: public
blacklisted_hosts: []
tags: [datacenter:chicago, zone:1b]
- subnet: 10.121.39.0/24
snmp:
- udp_port: 161
snmp_version: 2
auth_name: rapdev
community_string: public
blacklisted_hosts: []
tags: [datacenter:virginia, zone:1c]
snmp_utils_config:
- timeout: 3
retries: 5
discovery_frequency: 1
rapdev:
- token: d83aba1df7c39ee57135bb958d #sample hash, does not work
datadog:
- key: e34d013b93d5cd4cdf5b50e17e #sample hash, does not work
app: da834e60225b35726ae468deed #sample hash, does not work
api_url: https://api.datadoghq.eu #only set this if you are using the EU Datadog application

Step 4 - Copy the discovery.yaml

After the discovery.example.yaml is configured, copy it to /etc/dd-snmp using the following command

sudo cp discovery.example.yaml /etc/dd-snmp/discovery.yaml

Step 5 - Start the dd-snmp-autodiscovery Service

sudo systemctl start dd-snmp-autodiscovery

Step 6 - Browse Datadog for Metrics & Dashboards

One you have configured and started the poller, you should start seeing the metrics in the Datadog Metrics Explorer. All metrics discovered and polled will have the following naming convention:

snmp.[manufacturer].[model].[metricName]

Once you have verified that the metrics are added and being discovered, you can navigate to the Dashboards and find the auto-generated Dashboards for all discovered hardware. The dashboards will have the following naming conventions:

[Model] - Dashboard

Help

If you're having trouble setting up the integration, please feel free to start a Chat with us or send us an email at info@rapdev.io.