nagios: Split postgresql into primary and replica.

Replication checks should only run on primary and replicas, not
standalone hosts; while `autovac_freeze` currently only runs on
primary hosts, it functions identically on replicas, and is fine to
run there.

Make `autovac_freeze` run on all `postgresql` hosts, and make
standalone hosts no longer `postgres_primary`, so they do not fail the
replication tests.
This commit is contained in:
Alex Vandiver 2022-06-13 18:34:36 -07:00 committed by Alex Vandiver
parent 38e435347b
commit 499284d2fd
3 changed files with 10 additions and 5 deletions

View File

@ -68,7 +68,7 @@ define hostgroup {
define hostgroup { define hostgroup {
hostgroup_name postgresql hostgroup_name postgresql
alias PostgreSQL app servers alias PostgreSQL app servers
hostgroup_members postgresql_primary hostgroup_members postgresql_primary, postgresql_replica
} }
define hostgroup { define hostgroup {
@ -76,6 +76,11 @@ define hostgroup {
alias Primary PostgreSQL app servers alias Primary PostgreSQL app servers
} }
define hostgroup {
hostgroup_name postgresql_replica
alias Replica PostgreSQL servers
}
define hostgroup { define hostgroup {
hostgroup_name smokescreen hostgroup_name smokescreen
alias Servers that run the Smokescreen HTTP proxy alias Servers that run the Smokescreen HTTP proxy

View File

@ -229,7 +229,7 @@ define service {
define service { define service {
use generic-service use generic-service
service_description Check PostgreSQL autovac_freeze service_description Check PostgreSQL autovac_freeze
hostgroup_name postgresql_primary hostgroup_name postgresql
check_command check_postgres_alert_args!zulip!nagios!autovac_freeze!101%!105% check_command check_postgres_alert_args!zulip!nagios!autovac_freeze!101%!105%
contact_groups admins contact_groups admins
} }
@ -317,7 +317,7 @@ define service {
define service { define service {
use generic-service use generic-service
service_description Check PostgreSQL replication lag service_description Check PostgreSQL replication lag
hostgroup_name postgresql hostgroup_name postgresql_primary, postgresql_replica
check_command check_postgresql_replication_lag check_command check_postgresql_replication_lag
contact_groups admins contact_groups admins
} }

View File

@ -4,7 +4,7 @@ define host{
host_name <%= host %> host_name <%= host %>
alias <%= host %> alias <%= host %>
address <%= host %> address <%= host %>
hostgroups all,fullstack,non_aws_host,frontends,not_pageable_servers,postgresql_primary hostgroups all,fullstack,non_aws_host,frontends,not_pageable_servers,postgresql
} }
<% end -%> <% end -%>
@ -64,7 +64,7 @@ define host{
host_name <%= host %> host_name <%= host %>
alias <%= host %> alias <%= host %>
address <%= host %>.<%= @default_host_domain %> address <%= host %>.<%= @default_host_domain %>
hostgroups all,aws_host,postgresql,pageable_servers hostgroups all,aws_host,postgresql_replica,pageable_servers
} }
<% end -%> <% end -%>