Telegraf: input.snmp - octet counters with negative difference


I was trying to implement an internet traffic monitoring via Telegraf.

I used input plugin [[inputs.snmp]]. Since monitored device reports just snmp1, I have to set
version = 1. This brings the limitation of use just 32-bit Octets counters (e.g. IF-MIB::ifInOctets.2 = Counter32)

Since these counters ‘flip-over’ to zero once the data type size limit is reached (maximum value for a 32 bit unsigned integer is 4,294,967,295), further use, monitoring and analysis of these data is very limited.
Subsequent data points with a negative difference of counters’ values (in the time when 32-bit limit of the counter is reached) make whole metric inapplicable.

It forced me to write down a separate script which gathers non-negative difference between octet counters and writes it into InfluxDb.

It would be nice to have such functionality implemented into Telegraf snmp input plugin.

You should be able to simply store the raw counter value in InfluxDB, and in your query use either non_negative_difference() or non_negative_derivative() depending on your exact need.