[collectd] Hit counter in threshold
octo at verplant.org
Wed Jul 15 15:00:10 CEST 2009
On Wed, Jul 15, 2009 at 11:35:06AM +0200, Andrés J. Díaz wrote:
> IMHO filtering is not enough flexible to replace thresholds for now,
> some motnhs ago I tried to replace all my thresholds with filtering
> rules and also developed some patches to add some functionalities to
> filtering (someday i might post the patches, i think :D) but at the
> end I decided to rollback again.
yeah, currently some details are missing, but ultimately that's where I
want to get to.
*The* main problem currently is that *matches* can have state, but
values can't have state. This means that to implement something like
`match if previous state was ERROR and current state is OKAY' (e. g. to
dispatch okay notifications), you'd need to create one match for each
value. This does not scale, of course.
My idea is to add `meta data' to the global cache, which should solve
precisely this problem. A match or target (or any other piece of code)
could then do something similar to this:
if (meta_data_get_unsigned_int (md, "state", &state) == 0)
/* do something that depends on and updates `state' */
meta_data_set_unsigned_int (md, "state", state);
> 2) There are no a single way to concatenate thresholds, that is if
> raise threshold A and threshold B, then do C, in this case we need to
> add a rule and jump in target to rule B which target notification.
Doesn't this do the trick?:
# Executed if both matches are ``successful''.
By the way, the value_list_t that are handed around can already have
this meta data I've talked about, so we could actually do something like
AddInteger "threshold check" 1
AddInteger "threshold check" 2
IntegerEquals "threshold check" 3
This is very powerful, but maybe a bit troublesome to use. Maybe
providing a simpler interface, such as the MARK target and mark match of
iptables, will do the trick just as well.
> I had the crazy idea to add a PreQueue and a PostQueue chains to
> increase the flexibility of thresholds. In a ASCII art:
Interesting idea. What do you intend to do in those filters?
Florian octo Forster
Hacker in training
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090715/fa98c239/attachment.pgp
More information about the collectd