bucardo / check_postgres

Nagios check_postgres plugin for checking status of PostgreSQL databases
http://bucardo.org/wiki/Check_postgres
Other
562 stars 175 forks source link

Update hot_standby_delay to support watching cascading replication #177

Open joshwilliams opened 3 years ago

joshwilliams commented 3 years ago

This may be old and no longer relevant, but it's been on my list to investigate for a while and I haven't been able to get to it.

check_postgres takes a pair of hosts as arguments and uses a detection mechanism to determine which is the replica and which is the primary to compare WAL counters against and all that. But in the case of cascading replication, where one systems is both a replica it self and the source for another system, the check fails out.

If that's still the case, it'd be nice to add a feature to explicitly say which server is the source and which to treat as the replica. Or, maybe we just simplify it and always assume server 1 is primary, and just take the absolute value of the difference in case we're wrong.

It also seems to be doing something that isn't compatible on a replica anyway:

HINT:  WAL control functions cannot be executed during recovery.