summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Fenzi <kevin@scrye.com>2017-05-02 00:04:30 +0000
committerKevin Fenzi <kevin@scrye.com>2017-05-02 00:04:30 +0000
commite60ddb9aae6115df062bb321f061c39606bed3c5 (patch)
tree84f3cba44717ce832617aa8e103dc72bea7ca4e0
parentc1db72ac46b90987e9dd455742c213dfc9f8c9e2 (diff)
downloadansible-e60ddb9aae6115df062bb321f061c39606bed3c5.tar.gz
ansible-e60ddb9aae6115df062bb321f061c39606bed3c5.tar.xz
ansible-e60ddb9aae6115df062bb321f061c39606bed3c5.zip
see if we can define cloud hosts, but just not bother checking them
-rw-r--r--roles/nagios_server/files/nagios/hosts/templates.cfg14
-rw-r--r--roles/nagios_server/templates/nagios/hosts/cloud-hosts.cfg.j28
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 ecfc6e0f8..d284e3a16 100644
--- a/roles/nagios_server/files/nagios/hosts/templates.cfg
+++ b/roles/nagios_server/files/nagios/hosts/templates.cfg
@@ -29,6 +29,20 @@ define host {
}
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
max_check_attempts 8
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 0b7a65852..e717f36bf 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 }}