Single Service To Multiple host Template For 2 Zones


I have 2 Zones, Zone1 and Zone2
I have created 2 Host_Templates each for Zone1 and Zone2.
Host-tmpl-Zone1 and Host-tmpl-Zone2

I have created a service template for postgres monitoring
I have created multiple single service based on the service template of posgres

Now while deploying single service I can select only one Host-tmpl and not both

In case of creating Service Set - it only works with Service Template and not Single Service.

How do I deploy Single Service to 2 Host Template

Everything via director

Hi, I am not sure what you want to get as result. You can use multiple templates for apply rules with OR f.e.

I’am using mostly vars to apply services to hosts and sets.

If you want a service or service set to “belong” to a host template, you can add the service or service set directly to the host template.

You could also add a host group to you template and you that in an apply rule.
Same goes for a host variable you add to the template and use that to apply services.

Thank You Log1c & Rafael for your response

I went to Icinga Director -> Hosts -> Templates -> Clicked on One Template where I want to distribute Single Service -> Right Side Service -> Add Service
In the drop down - it is not single service - rather it is all service templates. I want to add single service and not service template. You see the existing ones are Single Service and Not Service Template

Of course it is all service templates, because a single service has to import at least one service template.
That’s where it gets its check command, intervals, and other things from.
More detailed info in the docs:

Choose the template you want, fit it to the hosts/service needs, e.g. thresholds, and add it to the host template.

1 Like