From e96ee436123b9f1088c9ae2280a54ddbe3202359 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Thu, 17 May 2018 21:15:15 +0000 Subject: [PATCH] ok, lets try this one --- roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 b/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 index 05dcff2c9a..dd54a04993 100644 --- a/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 @@ -4,7 +4,9 @@ ## {{ env }} {% for key, value in groups.iteritems() %} -{% if groups[key] != [] and hostvars[host].nagios_Check_Services['monitor'] == true %} +{% if groups[key] != [] %} +{% for host in groups[key] %} +{% if hostvars[host].nagios_Check_Services['monitor'] == true %} define hostgroup{ hostgroup_name {{ key }} alias {{ key }} @@ -12,6 +14,7 @@ define hostgroup{ } {% endif %} +{% endif %} {% endfor %} ## Services with minimal monitoring