[collectd] How to compile my own plugin?

Marco Chiappero marco at absence.it
Tue Dec 9 21:56:38 CET 2008

Florian Forster wrote:

Hi, Florian

> yes, the autotools are somewhat weird to use. I've added some more
> information to the site mentioned above, but it's mostly ``look for a
> line similar to the one you need and copy and edit it.''
> What exactly is your problem?

The *real* problem it's, I suppose, the Macro (AC_PLUGIN).
First of all I added the macro in "configure.in", then I modified the 
"src/Makefile.am" file (is that right? I think you should specify  that 
it's the one in the src dir), finally I ran make. It didn't work. So I 
decided to modify the "configure" script copying from the entropy plugin 
all the stuff needed (I've never used git so I have no idea how to get 
the build.sh script), compiled but still not creating my plugin. After 
that I had a look at "config.h" and no HAVE_PLUGIN_UPTIME was defined. I 
suppose I did everything right but the Macro was not "translated". Any 

>> Well, I'd like to suggest adding a plugin too: an ip6tables plugin. It
>> should be easy being the iptables already implemented but I'm not sure
>> whether it is better to create a new plugin or modify the iptables one
>> adding IPv6 functionality. Does it sound interesting?
> Sure, sounds good :) Not sure whether or not this should be a separate
> plugin. How would you configure the plugin if you added the
> functionality to the existing `iptables' plugin?

Maybe creating <ipv4> and <ipv6> subsections (but I don't know if the 
core can deal with them) or specifying at every single rule whether it 
is referred to ipv4 or ipv6 (BTW, we have to remember that ip6table do 
not provide a nat table and add a check). I'm not an experienced 
developer, I can't say which one is better, from the performance point 
of view probably just a single plugin is best. But certainly different 
plugins it's the easy way, while if some modification are required you 
have to do it twice.

>> About the uptime plugin, I "created" it (well, I had to modify almost
>> nothing :D) because I used to collect uptime on my own home server
>> with rrdcollect (I'm moving to collectd ;), but if you find it
>> interesting please include it in the upstream package.
> To be honest, I don't quite see the point of ``uptime graphs''..
> Wouldn't it be much easier just to add something like
>   date >>/var/log/uptime.log
> to your startup scripts?

Well, it isn't really the same purpose. I know, it's not much useful, 
but I like to have uptime records, for both tracking reboots and uptimes 
  on a long period (think for example to embedded devices/routers/NAS) 
and determine easly the uptime when a certain event occurred (for 
example: when the UPS halted the system it has been up for X days). It 
would be interesting to write in the graph legend the shortest and the 
longest uptime too (not just the last boot time), but at this time it's 
not easy to achive with the current rrdtool CDEFs/VDEFs. But I can 
comprehend your doubts, and I wouldn't expect to be a successful plugin. 
 From my standpoint the plugin doesn't hurt, it's ready, it's small and 
the related rrd archive it's even smaller, why not to use it? :)
So, please, give me a little help with the autoconf/automake hell ;)


More information about the collectd mailing list