Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

nagios: Split AWS and non-AWS hosts, for ntp checks.

Alex Vandiverc74f195fbadb
diff --git a/puppet/zulip_ops/files/nagios4/commands.cfg b/puppet/zulip_ops/files/nagios4/commands.cfg
index 7506ea8f654..4480dc4d370 100644
--- a/puppet/zulip_ops/files/nagios4/commands.cfg
+++ b/puppet/zulip_ops/files/nagios4/commands.cfg
@@ -82,7 +82,7 @@ define command{
define command{
command_name check_ntp_time
- command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_ntp_time -H 169.254.169.123 -w .5 -c 1'
+ command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_ntp_time -H $ARG2$ -w .5 -c 1'
}
define command{
diff --git a/puppet/zulip_ops/files/nagios4/conf.d/hostgroups.cfg b/puppet/zulip_ops/files/nagios4/conf.d/hostgroups.cfg
index 4db0ef5c76d..1d1073f0e9d 100644
--- a/puppet/zulip_ops/files/nagios4/conf.d/hostgroups.cfg
+++ b/puppet/zulip_ops/files/nagios4/conf.d/hostgroups.cfg
@@ -5,6 +5,16 @@ define hostgroup {
members *
}
+define hostgroup {
+ hostgroup_name aws_host
+ alias Hosts in AWS
+ }
+
+define hostgroup {
+ hostgroup_name non_aws_host
+ alias Hosts not in AWS
+ }
+
define hostgroup {
hostgroup_name pageable_servers
alias Servers for whom we want to page
diff --git a/puppet/zulip_ops/files/nagios4/conf.d/services.cfg b/puppet/zulip_ops/files/nagios4/conf.d/services.cfg
index 52f67b3eb84..92358469671 100644
--- a/puppet/zulip_ops/files/nagios4/conf.d/services.cfg
+++ b/puppet/zulip_ops/files/nagios4/conf.d/services.cfg
@@ -127,10 +127,19 @@ define service {
define service {
use generic-service
- service_description Check NTP time
- check_command check_ntp_time!22
+ service_description Check AWS NTP time
+ check_command check_ntp_time!22!169.254.169.123
max_check_attempts 3
- hostgroup_name all
+ hostgroup_name aws_host
+ contact_groups admins
+}
+
+define service {
+ use generic-service
+ service_description Check non-AWS NTP time
+ check_command check_ntp_time!22!pool.ntp.org
+ max_check_attempts 5
+ hostgroup_name non_aws_host
contact_groups admins
}
diff --git a/puppet/zulip_ops/templates/nagios4/hosts.cfg.template.erb b/puppet/zulip_ops/templates/nagios4/hosts.cfg.template.erb
index 9abedefbc45..4210b590d44 100644
--- a/puppet/zulip_ops/templates/nagios4/hosts.cfg.template.erb
+++ b/puppet/zulip_ops/templates/nagios4/hosts.cfg.template.erb
@@ -4,7 +4,7 @@ define host{
host_name <%= host %>
alias <%= host %>
address <%= host %>.<%= @default_host_domain %>
- hostgroups all,web,frontends,prod_frontends,pageable_servers
+ hostgroups all,aws_host,web,frontends,prod_frontends,pageable_servers
}
<% end -%>
@@ -14,7 +14,7 @@ define host{
host_name <%= host %>
alias <%= host %>
address <%= host %>
- hostgroups all,web,frontends,staging_frontends,not_pageable_servers,postgresql,postgresql_primary
+ hostgroups all,non_aws_host,web,frontends,staging_frontends,not_pageable_servers,postgresql,postgresql_primary
}
<% end -%>
@@ -24,7 +24,7 @@ define host{
host_name <%= host %>
alias <%= host %>
address <%= host %>.<%= @default_host_domain %>
- hostgroups all,web,frontends,staging_frontends,not_pageable_servers
+ hostgroups all,aws_host,web,frontends,staging_frontends,not_pageable_servers
}
<% end -%>
@@ -34,7 +34,7 @@ define host{
host_name <%= host %>
alias <%= host %>
address <%= host %>.<%= @default_host_domain %>
- hostgroups all,zmirror,zmirror_main
+ hostgroups all,non_aws_host,zmirror,zmirror_main
}
<% end -%>
@@ -44,7 +44,7 @@ define host{
host_name <%= host %>
alias <%= host %>
address <%= host %>.<%= @default_host_domain %>
- hostgroups all,zmirror,zmirrorp
+ hostgroups all,non_aws_host,zmirror,zmirrorp
}
<% end -%>
@@ -54,7 +54,7 @@ define host{
host_name <%= host %>
alias <%= host %>
address <%= host %>.<%= @default_host_domain %>
- hostgroups all,postgresql,postgresql_primary,pageable_servers
+ hostgroups all,aws_host,postgresql,postgresql_primary,pageable_servers
}
<% end -%>
@@ -64,7 +64,7 @@ define host{
host_name <%= host %>
alias <%= host %>
address <%= host %>.<%= @default_host_domain %>
- hostgroups all,postgresql,pageable_servers
+ hostgroups all,aws_host,postgresql,pageable_servers
}
<% end -%>
@@ -74,7 +74,7 @@ define host{
host_name <%= host %>
alias <%= host %>
address <%= host %>.<%= @default_host_domain %>
- hostgroups all,not_pageable_servers
+ hostgroups all,aws_host,not_pageable_servers
}
<% end -%>
@@ -84,7 +84,7 @@ define host{
host_name <%= host %>
alias <%= host %>
address <%= host %>.<%= @default_host_domain %>
- hostgroups all,not_pageable_servers, redis
+ hostgroups all,aws_host,not_pageable_servers, redis
}
<% end -%>
@@ -94,6 +94,6 @@ define host{
host_name <%= host %>
alias <%= host %>
address <%= host %>.<%= @default_host_domain %>
- hostgroups all,pageable_servers,smokescreen
+ hostgroups all,aws_host,pageable_servers,smokescreen
}
<% end -%>