From e60ddb9aae6115df062bb321f061c39606bed3c5 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Tue, 2 May 2017 00:04:30 +0000 Subject: [PATCH] see if we can define cloud hosts, but just not bother checking them --- .../nagios_server/files/nagios/hosts/templates.cfg | 14 ++++++++++++++ .../templates/nagios/hosts/cloud-hosts.cfg.j2 | 8 ++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) 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 }}