[collectd] Collectd bind plugin patch: timesaving problem

Aurelien ROUGEMONT beorn at binaries.fr
Fri Jun 24 12:10:41 CEST 2011

Hi everyone,

I'm working for a registrar. We use intensively isc-bind, and since a
few month collectd's bind plugin.

We were experiencing a very specific behavior from this plugin only. The
datetime returned was shifted. After some diggin', i figured what was
the problem : the current code was not handling timesavings.

the bind plugin works like this :
 * query to xmlrpc bind webservice
 * process data : bind statistics and datetime
 * returns processed data

Since it's the only plugin returning a datetime not using timesavings i
read [1] and wrote a quick fix that :

1- substracts the constant timezone to the "about to be returned datetime"
2- adds to the result timezone and timesaving ( with *localtime() )
3- returns the result instead of the UTC datetime + timezone

I've been using this patch without a glitch ( in production ) for 2
months now. Our bind statistics are now respecting the collectd's
general behavior.

Please find attached to this email the patch.

Hoping this will help,


[1]  http://www.gnu.org/s/hello/manual/libc/Time-Zone-Functions.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: collectd-bind-timesaving.diff
Type: text/x-patch
Size: 307 bytes
Desc: not available
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20110624/b09d385c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20110624/b09d385c/attachment.pgp>

More information about the collectd mailing list