diff --git a/inventory/group_vars/all b/inventory/group_vars/all index 47f177567c..016585fe28 100644 --- a/inventory/group_vars/all +++ b/inventory/group_vars/all @@ -262,6 +262,7 @@ nagios_Check_Services: dhcpd: false httpd: false swap: true + ping: true # Set variable if we want to use our global iptables defaults # Some things need to set their own. diff --git a/inventory/host_vars/batcave13.rdu2.fedoraproject.org b/inventory/host_vars/batcave13.rdu2.fedoraproject.org index 5b05aa6749..bb2910174c 100644 --- a/inventory/host_vars/batcave13.rdu2.fedoraproject.org +++ b/inventory/host_vars/batcave13.rdu2.fedoraproject.org @@ -25,6 +25,12 @@ datacenter: rdu postfix_group: vpn vpn: true +nagios_Check_Services: + nrpe: false + sshd: false + swap: false + ping: false + nrpe_procs_warn: 1200 nrpe_procs_crit: 1400 diff --git a/roles/nagios_server/templates/nagios/hosts/rdu-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/rdu-hosts.cfg.j2 index 97a1e1daa1..b8769d41f1 100644 --- a/roles/nagios_server/templates/nagios/hosts/rdu-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/rdu-hosts.cfg.j2 @@ -1,13 +1,12 @@ {% for host in groups['all'] %} -{% if hostvars[host].datacenter == 'rdu' %} +{% if hostvars[host].datacenter == 'rdu' and hostvars[host].nagios_Check_Services['ping'] == true %} define host { {% if vars['nagios_location'] == 'internal' %} use defaulttemplate {% else %} use mincheck {% endif %} - - host_name {{ host }} + host_name {{ host }} {% if hostvars[host].ansible_hostname is defined %} alias {{ hostvars[host].ansible_hostname }} {% else %} @@ -24,5 +23,6 @@ define host { parents rdu-gw {% endif %} } + {% endif %} {% endfor %}