[collectd] Support for DERIVED rrd-type

Florian Forster octo at verplant.org
Fri Sep 26 17:29:35 CEST 2008


Hi Ulf,

On Thu, Sep 25, 2008 at 05:24:01PM +0200, Ulf Kreutzberg wrote:
> I have noticed collectd only has support for GAUGE and COUNTER
> RRD-DS-types. Especially if you count network-interfaces and reset
> them counters to zero, rrdtool will probably create a full-rate spike
> as it assumes that a counter overflow (32 or 64bit) has happened.

right.

> So I would like to use the DERIVED type (with the perl-plugin) which
> can be used as a counter without wraps. Is there any chance to
> accomplish that?

Interesting way to fix this issue, haven't thought of that yet ;)
Anyway, adding support for another data type to collectd is not that
hard, but requires changes in *lots* of places. You would need to touch
all those files:
-- 8< --
 octo at huhu:~/collectd $ egrep -rlI '\<DS_TYPE_(COUNTER|GAUGE)\>' src/ | sort
 src/collectd.conf.5
 src/collectd-perl.pod
 src/common.c
 src/csv.c
 src/network.c
 src/perl.c
 src/plugin.h
 src/postgresql.c
 src/powerdns.c
 src/rrdcached.c
 src/rrdtool.c
 src/snmp.c
 src/types_list.c
 src/utils_cache.c
 src/utils_cmd_putval.c
 src/utils_rrdcreate.c
-- >8 --

Anyway, the usual way to cope with this problem is to set a reasonable
maximum value in the RRD file:
 $ rrdtool tune <file> -a rx:123 -a tx:123

The RRD update routine will then consider all computed rates that exceed
123 bytes per second as invalid and insert NaN instead.

The default maximum value set by collectd is 2^32-1, which is roughly
32 GBit/s. You could, for example, set the default maximum value to
`1.1 * 10^9' (1 GBit/s plus some safety margin) if you only have gigabit
ethernet but no faster interfaces. How to do that is documented in the
types.db(5) manual page.

Hope this helps.

Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080926/bf1c25e1/attachment.pgp 


More information about the collectd mailing list