Better way to monitor for failed replication? - Mailing list pgsql-admin

From Ron Johnson
Subject Better way to monitor for failed replication?
Date
Msg-id CANzqJaBG-MkG9YTt8pYTnHu+9U5wpwEcWQKzx2aOu85C6Uzn-w@mail.gmail.com
Whole thread Raw
Responses Re: Better way to monitor for failed replication?
List pgsql-admin
Currently, in a bash script, I run this SELECT statement against the Primary server which is supposed to replicate to multiple servers.  If active == f, I send an alter email.

postgres=# SELECT rs.slot_name, rs.active, sr.client_hostname
from pg_replication_slots rs
    left outer join pg_stat_replication sr on rs.active_pid = sr.pid;
  slot_name   | active | client_hostname
--------------+--------+-----------------
 pgstandby1   | t      | BBOPITCPGS302B
 replicate_dr | f      |
(2 rows)

Is there a better way to check for replication that's supposed to be happening, but isn't (like PG on the replica was stopped for some reason)?

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

pgsql-admin by date:

Previous
From: Dharin Shah
Date:
Subject: Re: Is PgAudit extension database specific?
Next
From: Keith
Date:
Subject: Re: Better way to monitor for failed replication?