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:
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
cookbookdirectory provides configuration files for Telegraf that simplify its use for SNMP data collection.
- Devices Directory – The
devicesdirectory contains pre-built SNMP plugin configurations for a variety of SNMP-compatible devices.
- OIDs Directory – The files in the
oidsdirectory 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
2. Set the global polling frequency
telegraf/telegraf.conf to set a global polling frequency:
interval = "60s"
3. Copy the relevant configuration files to
For each device that you want to poll, copy the relevant plugin configuration file from
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:
5. Edit the configuration file as required.
- Set the IP address of the device to be polled:
agents = [ "192.0.2.1:161" ]
- 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