naparuba/shinken — pull request #971 by geektophe (2013-08-10 11:54:24+00:00)
Title: Added percentage support to Xof: business rules.

This patch adds percentage support to Xof: business rules.

With it, it is possible to write rules that consistently checks that a fixed portion of hosts or services are ok. It is particulary useful combined with hostgroups or regex expansion described in https://github.com/naparuba/shinken/pull/956, as even if the hostgroup or expanded regex content grows, the percentage checked remains the same (no need to manually update the business rule).

Examples:

- A `bp_rule` looking like `25% of: host1,srv1 & host2,srv2 & host3,srv3 & host4,srv4` is exactly equivalent to `1 of: host1,srv1 & host2,srv2 & host3,srv3 & host4,srv4`
- With an hostgroup `hstgrp` containing `host1` and `host2`, a `bp_rule` looking like `50% of: g:hstgrp` is exactly equivalent to `1 of: host1,srv1 & host2,srv2`
- If the same hostgroup grows to contain `host1`, `host2`, `host3` and `host4`, the same `bp_rule` is equivalent to `2 of: host1,srv1 & host2,srv2 & host3,srv3 & host4,srv4`.