Ubuntu – Collectd “interface” plugin reporting cumulative value rather than rate

collectdmonitoringUbuntuubuntu-14.04

Collectd's interface plugin is supposed to report octets per second and packets per second, as documented here: https://collectd.org/wiki/index.php/Plugin:Interface, but for me, it reports cumulative octets and packets (as ifconfig does).

I know collectd doesn't actually measure metrics like this itself, but rather collects them from system utilities, so I'm thinking it's not a collectd bug. (But maybe it is!) I've been able to find lots of examples of people setting this up without any hiccups, but no mentions of this particular issue.

There may be a workaround on the analysis side (elasticsearch/kibana, for me), but I'd first like to attempt fixing the reporting before I resort to that.

Any help is much appreciated.

Ubuntu 14.04.1 LTS, collectd 5.4

Best Answer

In a classic setup collectd works with rrdtool. The rrd file to receive the interface data is setup with COUNTER datasource type, so that rrdtool takes care of calculating the rate.

If you are not feeding rrdtool, your alternate receiver may have to take care of keeping the previous reading around and then building the difference and dividing it by the time elappsed.