From 60469243d2bcf8ef7e326cfebba40a30c76918bd Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Thu, 17 May 2018 20:58:52 +0000 Subject: [PATCH] try this --- inventory/group_vars/all | 1 + inventory/group_vars/newcloud | 1 + roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/inventory/group_vars/all b/inventory/group_vars/all index cb76f2fd96..358603584c 100644 --- a/inventory/group_vars/all +++ b/inventory/group_vars/all @@ -259,6 +259,7 @@ createrepo: True # Nagios global variables nagios_Check_Services: + monitor: true nrpe: true sshd: true named: false diff --git a/inventory/group_vars/newcloud b/inventory/group_vars/newcloud index 5b60b0abe4..f21192df17 100644 --- a/inventory/group_vars/newcloud +++ b/inventory/group_vars/newcloud @@ -8,6 +8,7 @@ freezes: false ansible_ifcfg_whitelist: ['eth1'] baseiptables: false nagios_Check_Services: + monitor: false nrpe: false sshd: false swap: false diff --git a/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 b/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 index f246482cad..05dcff2c9a 100644 --- a/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hostgroups/all.cfg.j2 @@ -4,7 +4,7 @@ ## {{ env }} {% for key, value in groups.iteritems() %} -{% if groups[key] != [] %} +{% if groups[key] != [] and hostvars[host].nagios_Check_Services['monitor'] == true %} define hostgroup{ hostgroup_name {{ key }} alias {{ key }}