+

Improve help message and docs

Benjamin Renard [2017-08-25 14:19:43]
Improve help message and docs
Filename
README
check_pg_streaming_replication
diff --git a/README b/README
index 7805b95..e13bdcc 100644
--- a/README
+++ b/README
@@ -15,7 +15,8 @@ This script :
     - retreive master connection informations from Postgres recovery configuration
       file (UNKNOWN raise on error). Default Postgres master TCP port will be used
       if port is not specify.
-    - retreive  current xlog file from Postgres master server (UNKNOWN raise on error).
+    - retreive current xlog file from Postgres master server by making a connection
+      on master server (UNKNOWN raise on error).
     - check if the last receive xlog file is the last replay xlog file (WARNING raise if not)
     - Return OK state
 - if Postgres is not in recovery mode :
@@ -23,20 +24,24 @@ This script :
   - check if stand-by client(s) is connected (WARNING raise if not)
   - Return OK state with list and count of stand-by client(s)

-Note : This script was originally write and test for PostgreSQL 9.1, but it could be compatible
-with other versions of PostgreSQL. Do not hesitate to tell me how this script work with other
-versions and share some fix. All contributions are welcome !
+Note : This script was originally write for PostgreSQL 9.1 and test on 9.1 and 9.5 but it
+could be compatible with other versions of PostgreSQL. Do not hesitate to tell me how this
+script work with other versions and share some fix. All contributions are welcome !

 Requirements
 ------------

  * On master node :

-     Slaves node must be able to connect with user PG_USER to database postgres as trust.
+     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).

  * On standby node :

-     PG_USER must be able to connect localy as trust
+     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).

 Usage
 -----
@@ -49,13 +54,14 @@ Usage
 	-r recovery_conf	Specify Postgres recovery configuration file path
 				(Default : /var/lib/postgresql/9.1/main/recovery.conf)
 	-p pg_port		Specify default Postgres master TCP port (Default : 5432)
+	-D dbname		Specify DB name on Postgres hosts to connect on (Default : postgres)
 	-d			Debug mode
 	-h 			Show this message

 Copyright
 ---------

-Copyright (c) 2013 Benjamin Renard
+Copyright (c) 2017 Benjamin Renard

 License
 -------
diff --git a/check_pg_streaming_replication b/check_pg_streaming_replication
index b8ca958..1385182 100755
--- a/check_pg_streaming_replication
+++ b/check_pg_streaming_replication
@@ -6,13 +6,16 @@
 #
 # Requirement :
 #
-#     On master node : Slaves must be able to connect with user PG_USER
-#                      to database postgres as trust
+#     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).
 #
-#     On standby node : PG_USER must be able to connect localy as trust
+#     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).
 #
 # Author : Benjamin Renard <brenard@easter-eggs.com>
-# Date : Wed, 14 Mar 2012 14:45:55 +0000
+# Date : Fri, 25 Aug 2017 15:57:57 +0200
 # Source : http://git.zionetrix.net/check_pg_streaming_replication
 #

@@ -44,7 +47,7 @@ Usage : $0 [-d] [-h] [options]
 				(By default, try to auto-detect it, on your system it :
                                 $PG_MAIN)
 	-r recovery_conf	Specify Postgres recovery configuration file path
-				(Default : $PG_MAIN/$RECOVERY_CONF_FILENAME)
+				(Default : [PG_MAIN]/$RECOVERY_CONF_FILENAME)
 	-p pg_port		Specify default Postgres master TCP port (Default : $PG_DEFAULT_PORT)
 	-D dbname		Specify DB name on Postgres master/slave to connect on (Default : PG_USER)
 	-d			Debug mode
ViewGit