On 20-Dec-2017 8:55 PM, "Michael Friedrich" <michael.friedr...@icinga.com>
wrote:



> On 20. Dec 2017, at 15:57, Jayapandian Ponraj <pandian...@gmail.com>
wrote:
>
> Is it possible to assing an array of host objects to a service object ?
>
> In icinga1 we could add multiple hosts separated by commas. Is it still
possible in icinga2? If not are there any alternatives ?


Look into the rich possibilities of apply rules. Static objects are the old
world.

https://www.icinga.com/docs/icinga2/latest/doc/03-
monitoring-basics/#apply-rules

Hint: Don’t use static lists. Rely on pattern and common attributes.


Thanks for the reply

We do heavily use apply rules based on host variables and for hostgroup
definitions, but once in a while we come across a service which is spread
across 2 or 3 hosts which don't share anything in common. We can go ahead
add separate service definition for each of them(not preferred) or write an
apply rule with a reflex matching those specific hosts.

Adding plain service definition for a single host and switching over to
apply rules when 2 or 3 hosts are involved feels counter-intuitive. Since
service definitions will be added by many teams would like to keep it
simple..

So need a simple and elegant solution keeping in mind the common pitfalls.

https://www.icinga.com/2016/04/28/avoiding-common-pitfalls-with-apply-rules/

So idea is to keep it simple and avoid the pitfalls and performance issues.


Kind regards,
Michael



>
> Icinga1 Doc:
>     host_name:
>     This directive is used to specify the short name(s) of the host(s)
that the service "runs" on or is associated with. Multiple hosts should be
separated by commas.
> _______________________________________________
> icinga-users mailing list
> icinga-users@lists.icinga.org
> https://lists.icinga.org/mailman/listinfo/icinga-users

_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to