From 646a7dc0670cea16cc0ca411d36db1ceaddd214e Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 8 Sep 2016 20:13:45 +0000 Subject: [PATCH] IcingaConfig: workaround for no host in service --- library/Director/IcingaConfig/IcingaConfig.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/Director/IcingaConfig/IcingaConfig.php b/library/Director/IcingaConfig/IcingaConfig.php index 60676723..d06f5d0e 100644 --- a/library/Director/IcingaConfig/IcingaConfig.php +++ b/library/Director/IcingaConfig/IcingaConfig.php @@ -473,6 +473,14 @@ class IcingaConfig const DirectorVarsOverride = "%s" template Service "%s" { + /** + * Seems that host is missing when used in a service object, works fine for + * apply rules + */ + if (! host) { + var host = get_host(host_name) + } + if (vars) { vars += host.vars[DirectorVarsOverride][name] } else {