[collectd] Generalized ignorelist functionality

Luboš Staněk lubek at users.sourceforge.net
Mon Nov 20 19:51:34 CET 2006


Hi Florian,

Motto: What would you collectd today? :)


Florian Forster napsal(a):
> 
> I've removed the function. Plugins need to set a reasonable default
> themselves and can change their mind whenever they chose to..
> 

OK

> I've kept the `#if HAVE_REGEX_H' stuff, but removed the argument from
> the configure script. The configure script now checks for `regex.h' in
> any case.
> 

OK

> No. Yes. Well, just _don't_ use string-matching and always use regexes.
> If you provide a simple string like `foobar' the regex stuff does the
> same without much overhead, but you have the power right there if you
> need it. Thoughts and other opinions are welcome :)
> 

It is, of course, possible.
Using regexes even for simple string compare simplifies things.


> Apart from these additional notices: I've merged your code into the
> master branch and to have used the interface at least once myself I
> implemented some selection stuff for the `df' plugin. You can now
> select/ignore partitions depending on (fs-)type, mountpoint and device.
> If you want to use the regex-stuff for matching mountpoints, you will
> need to use stuff like this:
>   Device /^/(media|proc|sys)/
> Since the code right now simple removes a leading and a trailing slash,
> you don't need to escape internal slashes. That's confusing. Also, the
> way to use the string-matching code is like this:
>   Device /media/cdrom
> This is _not_ parsed as a regular expression, because it's _not_
> followed by a slash. That's confusing, too.
> 

I will check it.


I know the author. He did not write this code for sure. :)


Best regards,
Lubos



More information about the collectd mailing list