From 7d31252ba00cac8c741c4f8ca6b0f5b22811a182 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Fri, 29 Jul 2022 09:46:49 -0400 Subject: [PATCH] FIX: nagios external was referencing phx2 ip addresses The PHX2 colocation has been turned off. This meant that some configs which had been accidently working before due to referencing an ip address there that no longer existed broke. The fix was to rewrite the config so that it contained proper router ips and remove all mentions of the PHX2 ip address. Signed-off-by: Stephen Smoogen --- .../nagios/hosts/gateway-hosts.cfg.j2 | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/roles/nagios_server/templates/nagios/hosts/gateway-hosts.cfg.j2 b/roles/nagios_server/templates/nagios/hosts/gateway-hosts.cfg.j2 index d81724c4ae..d38a2aec39 100644 --- a/roles/nagios_server/templates/nagios/hosts/gateway-hosts.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hosts/gateway-hosts.cfg.j2 @@ -2,14 +2,32 @@ # change to the nocs parent. Also hosts which aren't reachable should # be not defined on the external nagios. # + #'ibiblio' define host { host_name ibiblio-gw alias ibiblio gateway use mincheck check_command check-host-alive4 - address 152.19.134.129 +{% if vars['nagios_location'] == 'iad2_internal' %} parents iad2-gw +{% endif %} + address 152.19.134.129 +} + +#'iad2' +define host { + host_name iad2-gw + alias iad2 cage gateway + use mincheck + check_command check-host-alive4 +{% if vars['nagios_location'] == 'iad2_internal' %} + address 10.3.163.254 +{% elif vars['nagios_location'] == 'external' %} + address 209.132.185.254 + parents ibiblio-gw +{% endif %} + } @@ -23,7 +41,6 @@ define host { {% if vars['nagios_location'] == 'iad2_internal' %} parents iad2-gw {% elif vars['nagios_location'] == 'external' %} - address 66.187.228.248 parents ibiblio-gw {% endif %} @@ -39,7 +56,6 @@ define host { {% if vars['nagios_location'] == 'iad2_internal' %} parents iad2-gw {% elif vars['nagios_location'] == 'external' %} - address 66.187.228.248 parents ibiblio-gw {% endif %} @@ -55,7 +71,6 @@ define host { {% if vars['nagios_location'] == 'iad2_internal' %} parents iad2-gw {% elif vars['nagios_location'] == 'external' %} - address 66.187.228.248 parents ibiblio-gw {% endif %} @@ -71,7 +86,6 @@ define host { {% if vars['nagios_location'] == 'iad2_internal' %} parents iad2-gw {% elif vars['nagios_location'] == 'external' %} - address 66.187.228.248 parents ibiblio-gw {% endif %} @@ -87,7 +101,6 @@ define host { {% if vars['nagios_location'] == 'iad2_internal' %} parents iad2-gw {% elif vars['nagios_location'] == 'external' %} - address 66.187.228.248 parents ibiblio-gw {% endif %} @@ -103,22 +116,6 @@ define host { {% if vars['nagios_location'] == 'iad2_internal' %} parents iad2-gw {% elif vars['nagios_location'] == 'external' %} - address 66.187.228.248 - parents ibiblio-gw -{% endif %} - -} - -#'iad2' -define host { - host_name iad2-gw - alias iad2 cage gateway - use mincheck - check_command check-host-alive4 -{% if vars['nagios_location'] == 'iad2_internal' %} - address 10.3.163.254 -{% elif vars['nagios_location'] == 'external' %} - address 66.187.228.248 parents ibiblio-gw {% endif %}