From 73920cf38bda6c0c82dd101c40e27acd83ef8b08 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Sat, 29 Apr 2017 22:30:16 +0000 Subject: [PATCH] and we have an attempt at this --- inventory/group_vars/all | 4 ++++ inventory/group_vars/dns | 2 ++ .../templates/nagios/servicegroups/kvmHosts.cfg.j2 | 9 ++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/inventory/group_vars/all b/inventory/group_vars/all index 5d32e33716..46987fc84b 100644 --- a/inventory/group_vars/all +++ b/inventory/group_vars/all @@ -257,3 +257,7 @@ vpn: False # assume createrepo is true and this builder has the koji nfs mount to do that createrepo: True + +# Nagios global variables +nagios_has_named: false + diff --git a/inventory/group_vars/dns b/inventory/group_vars/dns index db01b32a3c..efefd01fa1 100644 --- a/inventory/group_vars/dns +++ b/inventory/group_vars/dns @@ -20,3 +20,5 @@ sudoers: "{{ private }}/files/sudo/sysadmin-dns" csi_security_category: High csi_primary_contact: Fedora Admins - admin@fedoraproject.org csi_purpose: Domain Name Service + +nagios_has_named: true diff --git a/roles/nagios_server/templates/nagios/servicegroups/kvmHosts.cfg.j2 b/roles/nagios_server/templates/nagios/servicegroups/kvmHosts.cfg.j2 index 21b4dc03a2..173d5aaba3 100644 --- a/roles/nagios_server/templates/nagios/servicegroups/kvmHosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/servicegroups/kvmHosts.cfg.j2 @@ -5,7 +5,14 @@ define hostgroup { hostgroup_name phx-virt alias PHX Virtual ServiceGroup - members {% for host in groups['virtservers'] %} {{host}}, Disk space /, {{host}}, Total Processes, {{host}}, Check Raid, {{host}}, Swap, {{host}}, SSH, {% endfor %} + members {% for host in groups['virtservers'] %}{% if hostvars[host].datacenter == 'phx2'%} {{host}}, Disk space /, {{host}}, Total Processes, {{host}}, Check Raid, {{host}}, Swap, {{host}}, SSH,{% endif %}{% endfor %} + +} + +define hostgroup { + hostgroup_name remote-virt + alias PHX Virtual ServiceGroup + members {% for host in groups['virtservers'] %}{% if hostvars[host].datacenter != 'phx2'%} {{host}}, Disk space /, {{host}}, Total Processes, {{host}}, Check Raid, {{host}}, Swap, {{host}}, SSH,{% endif %}{% endfor %} }