[icinga-users] Using check_multi with Icinga2

Michael Martinez mwtzzz at gmail.com
Fri Aug 12 20:10:34 CEST 2016


On Thu, Aug 11, 2016 at 11:53 PM, Michael Friedrich
<Michael.Friedrich at netways.de> wrote:
> That as such won’t work since the custom attributes values are computed at config compile time. You are looking for runtime calculated values - which is why you need to turn the custom attribute values into a function.
>
> Something like that:
>
> vars.cluster_label = {{ get_host("vagrant-minion").state }}
> vars.cluster_data =  {{ get_host("vagrant-minion").state }}
>

Ah, got it! This works. Thanks so much for the clarification.

Now I'm running into a new challenge. I would like to construct an
array of hostnames and then reference this array inside a service
object, as follows:

vars.elb["x"] = [ "xx.ap-northeast-1.compute.amazonaws.com" ,
"xy.ap-northeast-1.compute.amazonaws.com" ]

apply Service "clusterx" {
....
if (!vars.elb["x"] { log("Array not defined") }
...
}

The log statement shows me that this array is not defined in the
service definition. What am I doing wrong?


More information about the icinga-users mailing list