summaryrefslogtreecommitdiff
path: root/scripts/checkPostgreSQLrepl
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-04-09 18:45:40 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2019-04-09 18:45:40 +0100
commit4f2338a51283958389e867f85750061646cd3971 (patch)
tree06898ae420d04df6f9d0a036ca3feaa0e507ab95 /scripts/checkPostgreSQLrepl
parentAdd nagios bits to apache (diff)
downloadconfig-4f2338a51283958389e867f85750061646cd3971.tar.bz2
config-4f2338a51283958389e867f85750061646cd3971.tar.xz
config-4f2338a51283958389e867f85750061646cd3971.zip
Revised checkPostgreSQLrepl for v11 logical rep
Diffstat (limited to 'scripts/checkPostgreSQLrepl')
-rwxr-xr-xscripts/checkPostgreSQLrepl6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/checkPostgreSQLrepl b/scripts/checkPostgreSQLrepl
index 6558cf3..20b74fe 100755
--- a/scripts/checkPostgreSQLrepl
+++ b/scripts/checkPostgreSQLrepl
@@ -1,5 +1,5 @@
#!/bin/bash
-CHECKSQL="SELECT ss.subscription_name, status, provider_node, provider_dsn FROM pglogical.subscription s, pglogical.show_subscription_status(s.sub_name) ss"
-echo "$CHECKSQL" | psql -U postgres p2pvr -h firebrand
-echo "$CHECKSQL" | psql -U postgres gentoobrowse -h defiant
+CHECKSQL="SELECT application_name AS name, COALESCE(client_hostname, CAST(client_addr AS TEXT)) AS client, state, sync_state AS type, pg_wal_lsn_diff(sent_lsn, replay_lsn) AS lag FROM pg_stat_replication"
+echo "$CHECKSQL" | psql -U postgres -h firebrand
+echo "$CHECKSQL" | psql -U postgres -h defiant