[collectd] Thought about exec and types.db

Sebastian Harl sh at tokkee.org
Fri Jan 18 12:25:26 CET 2008

Hi Jeff,

On Sun, Jan 13, 2008 at 12:31:06AM +1100, Jeff Waugh wrote:
> I've just found collectd today -- it rocks! Way cool to see et.redhat.com
> folks contributing here. :-)

Thanks! :-)

> I wrote a custom exec script, which didn't work until I read about types.db
> in the mailing list archives. A note about that on the website/manpage might
> save the next person some hair. :-)

You're right. Please see my next e-mail for a patch addressing this. Comments
are very welcome.

> A thought though: I don't really like modifying package-provided data files
> such as types.db. Although I can customise where that file resides, it would
> be very helpful to have, for instance, /etc/collectd/types.db as well. Then,
> an administrator can add custom types to their heart's content. :-)

I kinda agree. Originally, the plugin_register_data_set() function has been
used to register data-sets with collectd. C and Perl plugins can still use
this function to register custom data-sets, so there is no need to modify
types.db in this case.

On the other hand, the snmp, exec and unixsock plugins do not (yet) support
this feature. While we try to encourage people to send in new plugins (and the
respective changes to types.db) so we can include it in the official
distribution, I can see that there might be cases where this is not
appropriate (e.g. a plugin very specific to a custom use-case). So, I agree
that there should be means to provide custom data-set definitions no matter
which plugin is used to pass the values to collectd. Currently, I can think of
the following ways to implement this:

 i) Provide some kind of interface to plugin_register_data_set() from all
    plugins that may dispatch values to collectd (i.e. network, snmp, exec and

 ii) Update the "TypesDB" configuration option to accept multiple files which
    are then parsed in the specified order. You could then use something like
    "TypesDB /usr/lib/collectd/types.db /etc/collectd/types.db" and define
    custom data-sets in "/etc/collectd/types.db" (as you suggested in your

While I think that i) is more appropriate for the network plugin (so clients
may use custom data-sets without the need to change the configuration on the
server), I'd prefer ii) for all other plugins as it is more powerful and
requires less code duplication. (In the later case a manpage for types.db
should imho be added as well.)

Comments? Thoughts?


Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- 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/20080118/f6998b38/attachment.pgp 

More information about the collectd mailing list