[collectd] lua plugin

Schmurfy schmurfy at gmail.com
Mon Nov 22 23:03:14 CET 2010


Hello everyone,

I started working on a lua plugin for collectd and I already have some
problems in the first step, this discussion started with octo as private
messages on github but he wisely asked me to post it on the mailing list so
anyone can take part in it so here I am !

Before going anywhere I first started with a test host application  where I
got much of what I needed for the plugin working, after that I started the
plugin and now have something which does compile but the problem comes from
the fact that the official lua distribution is a static library which cannot
be embedded in the shared library built for collectd (I tried but failed
miserably), so here are the current options:

The first one is to link to a shared library release of lua which is
available on some system like debian but since they are not "official"
releases it all depends on your operating system (also on the good will of
those who build them) and I do not have one easily available for my system
as an example (Macbook pro with Mac OS X 10.6), taking this road will means
it can be quite hard to get the required shared library and as a
consequence: hard to have lua in your collectd build.

The second one is to include the lua sources themselves into the collectd
plugin, lua is released under the MIT license so that is a nice thing and
the code is not that big considering what it is (560KB), this solution could
mean that lua will nearly always be available on any collectd build (except
if specifically disable) but that the sources of collectd will include the
lua files and be a little bigger.
Another point toward this solution is that the plugin code will necessarily
be tied to the current lua release and may break if linked with a later
release without it being properly tested, but it cannot happen since we
control the lua version.

I was also thinking about something else but linked to lua: have anyone
thought about using a higher level language to configure filters ?
I used them twice until now and seriously while the system itself is
really powerful the configuration interface isn't really that great, it may
be hard to do exactly what you want at first (There is a post in this
mailing from me struggling on a filter problem which took me some days to
figure out ;) ). When lua support is available it could be an option to
allow filters to be defined in lua, I have absolutely no idea on the form it
could take but I really want some feedback on this idea.

Julien Ammous
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20101122/3730545a/attachment.htm>


More information about the collectd mailing list