Hi.

I have a custom arttribute for a host, which contains the name of another host 
in my setup.

For example (not all attributes shown):

        object Host "alpha" { vars.neighbour = "beta" }

So, for the object 'alpha', host.vars.neighbour has the value "beta".

The object 'beta' has all the usual attributes, such as display_name, address, 
check_command etc.

        object Host "beta" { display_name = "Beta test system" }

I'm trying to work out how to get the value of one of these attributes for the 
'beta' object, starting from alpha's vars.neighbour attribute.

If I reference $host.vars.neighbour$, I get "beta".

So, starting from $host.vars.neighbour$ for "alpha", how can I get "Beta test 
system"?

I've tried:

        $host.vars.neighbour.display_name$

        $host.vars.neighbour$.$display_name$

        get_host("$host.vars.neighbour$").display_name

        var neighbour="$host.vars.neighbour$"
        neighbour.display_name

        var neighbour="$host.vars.neighbour$"
        $neighbour.display_name$

        var neighbour=get_host("$host.vars.neighbour$")
        neighbour.display_name

        var neighbour=get_host("$host.vars.neighbour$")
        $neighbour.display_name$

Nothing gives me what I need :(

In fact, most result in no value at all.


Can anyone point me at the correct syntax for de-referencing the variable 
host.vars.neighbour so that I can get the display_name attribute for that 
object?


Thanks,


Antony.

-- 
What do you get when you cross a joke with a rhetorical question?

                                                   Please reply to the list;
                                                         please *don't* CC me.
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to