I have a host with vars.disks = ["/","/home"]
and a service for that host with vars.disk_partitions = host.vars.disks
. But the check does not work, even though both directories exist on the host. The error message in Icinga Web reads “DISK CRITICAL - is not accessible: No such file or directory”. It goes away if I assign the verbatim array in the service instead of copying it from the host. What am I missing and how can I further diagnose the situation?
Have you tried vars.disk_partitions = "$disks$"
?
2 Likes
Thank you very much, that does work indeed. But I don’t yet see how. I suppose $disks$
references an array, whereas $disks
erroneously referenced a scalar variable. But how does “$disks$” cause a lookup in host.vars
? Can you please point to the relevant section(s) in the documentation.
Have a look at the runtime-macro evaluation order: https://icinga.com/docs/icinga-2/latest/doc/03-monitoring-basics/#evaluation-order.
1 Like
I see and $host.vars.disks$
apparently also works.
1 Like
Yes but then you loose the ability to have defaults in other levels of the evaluation oder, like command.
2 Likes