From d33476ce8d503aab2557978cb75b0b72bd37a27d Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 4 Nov 2020 19:19:22 +0100 Subject: [PATCH] Update comment and README.md file --- README.md | 45 +++++++++++++++++++--------------- check_pg_streaming_replication | 2 +- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 1ef6b86..efbe222 100644 --- a/README.md +++ b/README.md @@ -29,32 +29,37 @@ This script : Requirements ------------ -* **On master node :** Slaves must be able to connect with user from `recovery.conf` to database with the same name (or another specify with `-D`) as trust (or via md5 using password specify in `~/.pgpass`). +* Some CLI tools: `sudo`, `awk`, `sed`, `bc`, `psql` and `pg_lscluster` -* **On standby node :** `PG_USER` must be able to connect localy on the database with the same name (or another specify with `-D`) as trust (or via md5 using password specify in `~/.pgpass`). +* **On master node:** Slaves must be able to connect with user from `recovery.conf` (or user specify using `-U`) to database with the same name (or another specified with `-D`) as `trust` (or via `md5` using password specified in `~/.pgpass`). This user must have `SUPERUSER` privilege (need to get replication details). -* `sudo` must be install on each nodes. +* **On standby node:** `PG_USER` must be able to connect localy on the database with the same name `(or another specified with -D)` as `trust` (or via `md5` using password specified in `~/.pgpass`). Usage ----- - Usage : check_pg_streaming_replication [-d] [-h] [options] - -u pg_user Specify Postgres user (Default : postgres) - -b psql_bin Specify psql binary path (Default : /usr/bin/psql) - -m pg_main Specify Postgres main directory path - (By default, try to auto-detect it, on your system it : - /var/lib/postgresql/9.6/main) - -r recovery_conf Specify Postgres recovery configuration file path - (Default : [PG_MAIN]/recovery.conf) - -U pg_master_user Specify Postgres user to use on master (Default : user from recovery.conf file) - -p pg_port Specify default Postgres master TCP port (Default : 5432) - -D dbname Specify DB name on Postgres master/slave to connect on (Default : PG_USER) - -C 1/0 Enable or disable check if the current XLOG file of the master host is the same - of the last replay XLOG file (Default : 1) - -w replay_warn_delay Specify the replay warning delay in second (Default : 3) - -c replay_crit_delay Specify the replay critical delay in second (Default : 5) - -d Debug mode - -h Show this message +``` +Usage: check_pg_streaming_replication [-d] [-h] [options] + -u pg_user Specify local Postgres user (Default: try to auto-detect or use postgres) + -b psql_bin Specify psql binary path (Default: /usr/bin/psql) + -B pg_lsclusters_bin Specify pg_lsclusters binary path (Default: /usr/bin/pg_lsclusters) + -V pg_version Specify Postgres version (Default: try to auto-detect or use 9.1) + -m pg_main Specify Postgres main directory path (Default: try to auto-detect or use + /var/lib/postgresql//main) + -r recovery_conf Specify Postgres recovery configuration file path + (Default: [PG_MAIN]/recovery.conf) + -U pg_master_user Specify Postgres user to use on master (Default: user from recovery.conf file) + -p pg_port Specify default Postgres master TCP port (Default: same as local PostgreSQL + port if detected or use 5432) + -D dbname Specify DB name on Postgres master/slave to connect on (Default: PG_USER, must + match with .pgpass one is used) + -C 1/0 Enable or disable check if the current LSN of the master host is the same + of the last received LSN (Default: 1) + -w replay_warn_delay Specify the replay warning delay in second (Default: 3) + -c replay_crit_delay Specify the replay critical delay in second (Default: 5) + -d Debug mode + -h Show this message +``` Copyright --------- diff --git a/check_pg_streaming_replication b/check_pg_streaming_replication index e71ec82..fcd2745 100755 --- a/check_pg_streaming_replication +++ b/check_pg_streaming_replication @@ -6,7 +6,7 @@ # # Requirements: # -# Some CLI tools: awk, sed, bc, psql and pg_lscluster +# Some CLI tools: sudo, awk, sed, bc, psql and pg_lscluster # # On master node: Slaves must be able to connect with user from recovery.conf # (or user specify using -U) to database with the same name