On Fri, Aug 12, 2016 at 12:32 PM, Gunnar Beutner
<gunnar.beut...@netways.de> wrote:
> You’re going to have to move the attribute declaration _into_ the apply rule:
Hmmm..
Let me explain what I need to do, and maybe the folks here can help
suggest how to achieve it;

Outside of Icinga, I gather a list of amazon instances and the ELBs
that they are attached to. I am using Jinja templates to produce the
Icinga host objects from this list. In order to associate each ELB to
which hosts belong to it, I have done two things:

a) in each host object, have a vars._elb variable that contains the
names of the ELBs the host belongs to
b) outside of the host objects, created a "global" elb["elbname"]
array that contains the hostnames of the hosts that belong to it

Now, I need to create a Service object (for each ELB) that contains a
vars.cluster_data variable which contains the hosts in the ELB, as
follows:
vars.cluster_data = {{ get_host("hostname1").state + "," +
get_host("hostname2").state + "," + ....
}}

I was trying to do this by referencing the "global" elb array as I
mentioned, but apparently this global data is not available within the
Service definition.

What woudl be the right approach?

Perhaps instead of creating an ELB array, I should create a hostgroup
for each ELB, and put the ELB's members as members of the hostgroup.
Then I can reference them in my Service definition?
-- 
---
Michael Martinez
http://www.michael--martinez.com
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to