> On 6. Sep 2018, at 19:14, Assaf Flatto <ici...@flatto.net> wrote:
> 
> On 06/09/18 10:35, Tadeja Saje wrote:
>> Hello
>> 
>> I want assign hosts to more hostgroup.
>> 
>> example: groups.conf
>> 
>> object HostGroup "testniprimer11" {
>>   display_name = "Testni primer11"
>>   assign where "testniprimer11" in host.vars.host_groups
>> 
>>   }
>> 
>> object HostGroup "testniprimer21" {
>>   display_name = "Testni primer21"
>>   assign where "testniprimer21" in host.vars.host_groups
> 
> Assign is used for apply rules, not object definition.
> when you define a group, you define it without indicating the hosts in it, 
> that is done in the host object definition.

Sorry to interrupt here, that is not correct. `assign where` expressions can be 
used for group assignments too.
https://www.icinga.com/docs/icinga2/latest/doc/03-monitoring-basics/#group-membership-assign

Please continue in this discussion: 
https://monitoring-portal.org/t/assign-host-to-more-hostgroups/4068

Cheers,
Michael

>> 
>>   }
>> 
>> file in hosts directory
>> # A host definition
>> object Host "testniprimer21.cpe.arnes.si" {
>>   address = "100.64.7.1"
>>   check_command = "hostalive"
>>   vars.host_groups = ["testniprimer11" ,"testniprimer21"]}
>> 
>> 
>> This example do not work for me.
>> 
>> 
>> Best regards,
>> 
>> Tadeja Saje
>> 
>> _______________________________________________
>> 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