diff --git a/roles/nagios_server/files/nagios/hosts/templates.cfg b/roles/nagios_server/files/nagios/hosts/templates.cfg index ecfc6e0f8c..d284e3a161 100644 --- a/roles/nagios_server/files/nagios/hosts/templates.cfg +++ b/roles/nagios_server/files/nagios/hosts/templates.cfg @@ -28,6 +28,20 @@ define host { register 0 } +define host { + name nocheck + check_command check-host-alive + max_check_attempts 8 + checks_enabled 0 + retain_status_information 0 + retain_nonstatus_information 0 + notification_interval 15 + notifications_enabled 0 + notification_options d,r + contact_groups fedora-sysadmin-ircbot + register 0 +} + define host { name autoqatemplate check_command check-host-alive diff --git a/roles/nagios_server/templates/nagios/hosts/cloud-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/cloud-hosts.cfg.j2 index 0b7a65852c..e717f36bf6 100644 --- a/roles/nagios_server/templates/nagios/hosts/cloud-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/cloud-hosts.cfg.j2 @@ -1,7 +1,11 @@ {% for host in groups['all'] %} -{% if hostvars[host].datacenter == 'cloud' and hostvars[host].nagios_Check_Services['nrpe'] == true %} +{% if hostvars[host].datacenter == 'cloud' %} define host { - use mincheck +{% if hostvars[host].nagios_Check_Services['nrpe'] == true %} + use defaulttemplate +{% else %} + use nocheck +{% endif %} host_name {{ host }} {% if hostvars[host].ansible_hostname is defined %} alias {{ hostvars[host].ansible_hostname }}