On Monday 18 March 2019 at 14:17:57, Edgar Fuß wrote:
> EF> get_host(host.vars.neighbour)
>
> > [2019-03-18 09:24:55 +0000] critical/config: Error: Error while
> > evaluating expression: Tried to access undefined script variable 'host'
>
> What context is that in?
It's in a NotificationCommand object.
I can use things like $host.name$ and $host.display_name$ perfectly okay to
get properties of the machine the notification is about.
What I want to do is include in the Notification the name of a "partner"
machine to this one (it's in a load-balanced pair).
If I reference $host.vars.neighbour$, I get the name of the partner machine,
no problem.
Now I need to reference other properties of _that_ host, to find out its
display_name and a couple of other details to include in the notification
report.
> Depending on the context (function, Service Object, Host Object) you may
> need host.vars, vars or this.vars.
Yep, I've been trying all sorts of combinations :)
Thanks for the help so far...
Antony.
--
Most people are aware that the Universe is big.
- Paul Davies, Professor of Theoretical Physics
Please reply to the list;
please *don't* CC me.
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users