[collectd] [PATCH] make traffic plugin only create rrds for
selected interfaces
Florian Forster
octo at verplant.org
Thu Jun 29 14:37:49 CEST 2006
Hi,
I've bouned your mail to the mailinglist, too. Maybe someone else has an
opinion on this ;)
On Thu, Jun 29, 2006 at 06:09:33PM +0800, Zhuang Yuyao wrote:
> > I'd suggest using `Include <if>', `Exclude <if>' and `ByDefault
> > {include|exclude}'. That should be quite obvious how to use.
> No, I do not think it's a good idea. Since you can not control how
> people write the config, imaging some users typed the configs like
> the following by mistake:
In my opinion the goal should be to make it easy for the user to tell
the program what he wants, not make it hard for him to write down
nonsense.
You can still complain about nonsense, if you detect it, but as I see it
it's one of the most normal things to check your config if the program
doesn't do what you want it to do.
> Include eth0
> Include eth1
> ByDefault include
Well, `include everything' is what the user tells us, so it's what the
user expects. I don't think there's anything wrong with this; the user
gets what he wants.
> Include eth0
> exclude eth1
> #no bydefault key
By default we behave the same way we behave if no config is given at
all, i.e. ``ByDefault include'' is the default. Of course you might say
the the ``ByDefault include'' option is redundant in the first place,
but some people (like me) prefer explicit rules over implicit rules and
might want to write that down just so it's absolutely clear what's
happening.
> Include eth0
> exclude eth1
> ByDefault include
> ByDefault exclude
Hm, I'm temped to say ``If the user doesn't know what he wants, the
program doesn't need to know either.''. But throwing some error in this
case isn't hard either.
> Include eth0
> exclude eth1
> ByDefault include (or ByDefault exclude)
Again: Just because it's redundant doesn't make it wrong.
I'm much more worried about cases like this:
Include eth0
Exclude eth0
But I'd print out a warning and continue at most..
A possible alternative might be along the lines of Apache's `Allow',
`Deny' and `Order' statements: Use `Include' and `Exclude' to
explicitely state the included and excluded interfaces and use
`ByDefault' to specify the order in which statements are evaluated. We
can even allow an asterisk at the end of the interface name to do some
very simple wildcard thingy:
# Collectd only ethernet interfaces, except `eth0:1' for some reason
Exclude eth0:1
Include eth*
ByDefault exclude
That's not very intuitive either, I have to admit, but quite flexible..
Actually, thinking about it I may have misunderstood what you said: I
though you meant to ignore all interfaces that are given with
`Dev' and if `InvertSelection true' is given ignore those interfaces.
However, the other way around makes much more sense: Only select
interfaces given with `Interface <if>' ignore everything else by
default. And if `IgnoreSelected true' is given we collect everything
except the ones listed. That actually doesn't sound too bad..
Okay, I think I have too many options now and can't decide.. Anyone up
for suggestions?
Regards,
-octo
P.S.: Everybody, please Cc Zhuang Yuyao or the list on replies. Thank
you :)
--
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- 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/20060629/6e01c5e4/attachment.pgp
More information about the collectd
mailing list