[collectd] What are "interesting results" mentioned in FAQ?

Florian Forster octo at verplant.org
Thu Jan 1 13:31:14 CET 2009

Hi Piotr,

On Wed, Dec 24, 2008 at 03:22:04PM +0100, Piotr Hosowicz wrote:
> I am running a Python script that checks some stats and sends them to
> stdout and further to the collectd server via exec plugin. I watched
> the graphs and I saw very strange results. When I dumped collected RRD
> files to XML i saw that data was not normal at all, I expectd it to be
> numerial thousends / tens of thousands. Instead in the dumpo I saw a
> lot of NaN's , fractional "almost zeroes" and very hight numbers in
> the order of millions. Is this said interesting result? - I foubnd in
> the FAQ:

sounds weird, right enough ;) Can you be a bit more specific what you're
feeding the exec plugin? Some lines printed by your script, for

> #
> Can I adjust the interval in which data is collected?
> Yes, since version 3.9.0 this can be set at compile-time. Keep in mind, 
> though, that this will change the layout of the generated RRD-files. 
> Also, clients and servers should have the same setting here to avoid 
> interesting results.
> Version 4.0 allows this setting to be adjusted in the configfile.

If you let collectd create RRD files and then change the interval in
which data is collected, the already generated RRD files are not
changed. So the RRD files will be fed with data at a different rate than
they'd expect. This may work if you changed the interval in the
``right'' direction, i. e. if you're adding values more often than the
file expects. If you do it the other way around, if may still work,
depending on your XFF and heartbeat settings. What really happens is
hard to tell without going deep into the details of RRDtool, so it's
left unspecified here so that the point comes across: If you change the
interval, you have to delete and re-create the RRD files! (or know what
you're doing ;)

> Server: FreeBSD, as far as I cansee in the /usr/ports/... subdirs it
> is collectd 4.1.2 and I bet it was built with default settings, I see
> in the collectd.conf Interval is set to 60 (seconds, I suppose).

Please note, that we have fixed quite some bugs since 4.1.2, so
upgrading to a newer version would be a good idea - if only to 4.1.6.

> Clients: Linux, collectd 4.5.1, built without any interval settings, I
> even do not see them in ./configure --help . There's a commented out,
> I suppose the default setting of the interval set at 10. It might be
> that the problem is that my script passes data to collectd specifying
> interval=60 , but I had started running it with intervals of 5 or 10
> seconds, specified in the stdout output.

That's okay - the interval in which data is collected is included in the
data structure, sent over the network and used by the rrdtool plugin and
so forth. The problem is when you let the client run for a while and
then decide that maybe an interval of 20 seconds would be more
appropriate. If you do that, the server will already have created files
that expect data every 10 seconds. You will have to delete those files
then (collectd will automatically recreate them with the now-right

> 1. Is this interesting result mentioned in the FAQ?

Possibly, if you played around with the interval and never deleted the
files. You can check the `step' of the RRD files using
 rrdtool info $FILE | grep step
What value does that print?

> 2. Is deleting the wrong databases the only way to straighten things?

Yes and no: The RRD files and the interval in which data is added must
match. You can either delete the RRD files, then appropriate files will
be recreated. Or you can check what interval the files expect and
configure collectd or your script accordingly. Changing the RRD files to
fit your configuration is serious voodoo and best thought of as `not

> And how to set the things up avoiding such corruption in the future?

If you don't change the interval setting, nothing will (/should) break.

> I am in a bit of a hurry. We wanted to collect and graph the data just
> now, because of specifics of our business and the Holidays - Christmas
> and New Year. For the time being we must do with stats collected
> locally on the server as CSV. But then comes the New Year and I'd be
> very happy if the data would be collected properly as RRD files.

Sorry my answer took a few days - Sebastian and I were at a conference
the last few days..

> PS: Merry Christmas to all of you and  Happy New Year

To you too, of course :)

Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
-------------- 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/20090101/5de5bc20/attachment.pgp 

More information about the collectd mailing list