SNMP integration

SNMP (Simple Network Management Protocol) is commonly used for bandwidth monitoring by collecting and organizing information about devices on IP networks. An SNMP agent is shipped with practically any network equipment, providing an out-of-the-box way to monitor devices such as workstations, routers, switches, servers, modems, printers, etc.

Telegraf input plugin: SNMP

The SNMP Telegraf plugin gathers metrics from SNMP agents. It provides a solution for SNMP data collection and analytics using InfluxData’s TICK Stack – Telegraf, InfluxDB, Chronograf and Kapacitor.

Telegraf is the collection module of InfluxData’s TICK Stack time series platform (see diagram below) with its own project Telegraf in the open source community. One of the main use-cases for adopting a times series platform is network monitoring, often to deploy a centralized network monitoring platform. Gathering the data of interest is a key part of any monitoring solution. This can be done in multiple ways.

In order to facilitate the process, Telegraf was designed as a lightweight, plugin-driven collection that can run on your hosts, collecting data about your systems and applications, or it can operate remotely, scraping data via endpoints exposed by your applications.

See below TICK Stack architecture:

InfluxDB’s TICK stack architecture, including Telegraf, Chronograf, and Kapacitor

Telegraf SNMP Plugin configuration

In order to monitor specific devices, the set of desired OIDs for these devices must be configured in the plugin. As a starting point, you can use influx_snmp plugin.

The plugin is configured for HYTERA-REPEATER MIBs and EtherLike-MIBs. However, configuring Telegraf to monitor other devices and specific MIBs is a simple process.

The directories below can assist you in plugin configuration:

  • Cookbook Directory – The cookbook directory provides configuration files for Telegraf that simplify its use for SNMP data collection.
  • Devices Directory – The devices directory contains pre-built SNMP plugin configurations for a variety of SNMP-compatible devices.
  • OIDs Directory – The files in the oids directory contain configuration blocks for a variety of SNMP MIB objects and tables. These configuration blocks can be used to build a device-specific SNMP plugin configuration.

Configuring Telegraf for SNMP collection

To configure Telegraf for SNMP collection, complete the following steps:

1. Setup the configuration directory

Copy the provided telegraf directory to /etc/telegraf.

2. Set the global polling frequency

Edit telegraf/telegraf.conf to set a global polling frequency: interval = "60s"

3. Copy the relevant configuration files to telegraf.d

For each device that you want to poll, copy the relevant plugin configuration file from cookbook/devices to telegraf.d.

4. Add the device hostname to the configuration filename

It is likely that you will have more than one of a given device type. In this scenario it is recommended that a plugin configuration be setup for each device. To accomplish this each plugin configuration file will need to be uniquely named. To keep things well organized, add the device name to the file name using this convention: input_juniper_srx.<device_hostname>.toml.conf. For example: input_juniper_srx.core-fw-1.toml.conf

5. Edit the configuration file as required.

  • Set the IP address of the device to be polled: agents = [ "" ]
  • Optionally configure a device-specific polling frequency: interval = "60s"
  • Set the community string or other SNMP credentials: community = "public"

Configure the community string globally per device type.

Alternatively, community strings can be configured globally per device type. This is achieved via an environment variable, e.g. community = "$TELEGRAF_ENGENIUS_WIFI_COMMUNITY". A systemd configuration file is provided, telegraf.service.d/telegraf.conf, which allows the environment variable values to be easily set.

6. Start Telegraf

Start Telegraf by running the following commands:

$ systemctl daemon-reload$ systemctl start telegraf.service

To ensure Telegraf is started automatically at system boot, run:

$ systemctl enable telegraf.service

Additional resources:

SNMP Data Collection and Analytics with the TICK Stack (Telegraf, InfluxDB, Chronograf and Kapacitor):

Webinar: Write your own Telegraf Plugin

Blog: How to Write a Telegraf Plugin for Beginners

Contribution guidelines: Contribute to Telegraf

Guidelines for specific plugin types:

Contact Sales