The Debian Wiki4 describes the required steps to install snmp and enable OID lookup.
You don’t have to configure InfluxDB and Grafana as the default configurations work for us now.
As for now you can replace /etc/telegraf/telegraf.conf with this minimal configuration we will extend later:
Find SNMP properties
For the following example I assume that your SNMP device has the IP 192.168.1.250 and that we want to monitor the network interfaces (in/out traffic).
First of all we need to find out, where to find those propertiey. Snmpwalk is a quite handy tool for this task.
In the output you can see, that all network related metrics can be found in the IF-MIB:: object. A quick look into the documentation reveals, that the table we are interested in is called ifXTable and the relevant fields are ifHCInOctets and ifHCOutOctets
You can verify the output by running the snmptable command.
Add SNMP to Telegraf
There are two plugins for Telegraf that can be used for SNMP:
So you can add the following configuration to your telegraf.conf:
You can now test the configuration using the --test switch of telegraf.
Configure Grafana to show data
The fields ifHCInOctets and ifHCOutOctets count, how many Octects are received/send on the interfaces. To get a bit/sec value, we need to do some calculations in Grafana but thats rather straight forward.
If everything works as expected, you should now see a graph as output.