From 83454d7260d6ea1497e592beb60bd7cf354f0103 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Thu, 17 May 2018 21:52:14 +0000 Subject: [PATCH] lets try this another way --- inventory/inventory | 5 +++++ roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 | 7 +------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/inventory/inventory b/inventory/inventory index 4a341f36b8..3d828a6eb1 100644 --- a/inventory/inventory +++ b/inventory/inventory @@ -1075,6 +1075,11 @@ fed-cloud15.cloud.fedoraproject.org #fed-cloud-ppc01.cloud.fedoraproject.org fed-cloud-ppc02.cloud.fedoraproject.org +# Group for hosts we don't want to monitor with nagios. +[nomonitor:children] +newcloud-control +newcloud-compute + [newcloud:children] newcloud-control newcloud-compute diff --git a/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 b/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 index 466dfba57c..cc77de0eb0 100644 --- a/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 @@ -2,11 +2,8 @@ # All Servers and associated devices ############### ## {{ env }} - {% for key, value in groups.iteritems() %} -{% if groups[key] != [] %} -{% for host in groups[key] %} -{% if hostvars[host].nagios_Check_Services['monitor'] == true %} +{% if groups[key] != [] and groups[key] != 'nomonitor' %} define hostgroup{ hostgroup_name {{ key }} alias {{ key }} @@ -15,8 +12,6 @@ define hostgroup{ } {% endif %} {% endfor %} -{% endif %} -{% endfor %} ## Services with minimal monitoring define hostgroup{