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 }}