On Fri, May 27, 2011 at 4:39 PM, NICOLAS DUPEUX <nicolas.dup...@arkea.com>wrote:

> ----- Mail original -----
>
> Maybe we should enhance operators in bp_rules to express more complex rules
> and results modulation.
> Another solution might be to have several bp_rule to compute the differents
> level. For instance, with your 10 http services :
> bp_rules_ok!(7 of 10:http1,http2,.....)
> bp_rules_degraded!(4 of 10:http1,http2,...)
>
> Regards,
>
> Hi,

I thought about it, and I think you are right, we shoyuld enhanced the "of
:" operator. What I propose is :
* A,B,C of:  foo,foo2,foo3
The A is for : "It's OK if at least A are OK/UP"
The B is for "It's Warning if at least B are Warning or Critical/DOWN"
The C is for "It's Critical is at least C are Critical/Down"

And the classic "A of:" will just be "A,A,Aof:" for keeping the current
behavior.

Here are some examples for 5 services A->E, and states (O = OK, W = waring,
C = critical).
* W O O O O
   * 4 of:   -> Ok (we got 4 OK, and not 4 warn or crit, so it's OK)
   * 5,1,1  -> Warning (at least one warning, and no crit -> warning)
   * 5,2,1 -> OK (we want warning only if we got 2 bad states, so not here)

* W C O O O
   * 4 of: -> Crtitical (not 4 ok, so we take the worse state, the critical)
   * 4,1,1 -> Critical (2 states raise the waring, but on raise critical, so
worse state is critical)

* W C C O O
   * 2 of: OK
   * 4,1,1 -> Critical (same as before)
   * 4,1,3 -> warning (the warning rule is raised, but the critical is not)

And so there are the most used cases (for M elements):
  * ON/OFF indicator, for printing usage : M of:
  * Warning as soon as problem, and critical only if all are critical :
M,1,M
  * "Direct and Real state" (if there is a warning, it's waring, if there is
a critical, it's critical) : M,1,1


I think it will be not so hard to code (the hardest part will be the regexp
for me....:p ), it keep the current simple behavior ( | and & are still pure
boolean, the 2of: is kept).

What do you think of it?


Jean
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Shinken-devel mailing list
Shinken-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shinken-devel

Reply via email to