Improve help message and docs
Benjamin Renard

Benjamin Renard commited on 2017-08-25 14:19:43
Showing 2 changed files, with 21 additions and 12 deletions.

... ...
@@ -15,7 +15,8 @@ This script :
15 15
     - retreive master connection informations from Postgres recovery configuration
16 16
       file (UNKNOWN raise on error). Default Postgres master TCP port will be used
17 17
       if port is not specify.
18
-    - retreive  current xlog file from Postgres master server (UNKNOWN raise on error).
18
+    - retreive current xlog file from Postgres master server by making a connection
19
+      on master server (UNKNOWN raise on error).
19 20
     - check if the last receive xlog file is the last replay xlog file (WARNING raise if not)
20 21
     - Return OK state
21 22
 - if Postgres is not in recovery mode :
... ...
@@ -23,20 +24,24 @@ This script :
23 24
   - check if stand-by client(s) is connected (WARNING raise if not)
24 25
   - Return OK state with list and count of stand-by client(s)
25 26
 
26
-Note : This script was originally write and test for PostgreSQL 9.1, but it could be compatible
27
-with other versions of PostgreSQL. Do not hesitate to tell me how this script work with other
28
-versions and share some fix. All contributions are welcome !
27
+Note : This script was originally write for PostgreSQL 9.1 and test on 9.1 and 9.5 but it
28
+could be compatible with other versions of PostgreSQL. Do not hesitate to tell me how this
29
+script work with other versions and share some fix. All contributions are welcome !
29 30
 
30 31
 Requirements
31 32
 ------------
32 33
 
33 34
  * On master node :
34 35
 
35
-     Slaves node must be able to connect with user PG_USER to database postgres as trust.
36
+     Slaves must be able to connect with user from recovery.conf to database with
37
+     the same name (or another specify with -D) as trust (or via md5 using password
38
+     specify in ~/.pgpass).
36 39
 
37 40
  * On standby node :
38 41
 
39
-     PG_USER must be able to connect localy as trust
42
+     PG_USER must be able to connect localy on the database with the same name
43
+     (or another specify with -D) as trust (or via md5 using password specify in
44
+     ~/.pgpass).
40 45
 
41 46
 Usage
42 47
 -----
... ...
@@ -49,13 +54,14 @@ Usage
49 54
 	-r recovery_conf	Specify Postgres recovery configuration file path
50 55
 				(Default : /var/lib/postgresql/9.1/main/recovery.conf)
51 56
 	-p pg_port		Specify default Postgres master TCP port (Default : 5432)
57
+	-D dbname		Specify DB name on Postgres hosts to connect on (Default : postgres)
52 58
 	-d			Debug mode
53 59
 	-h 			Show this message
54 60
 
55 61
 Copyright
56 62
 ---------
57 63
 
58
-Copyright (c) 2013 Benjamin Renard 
64
+Copyright (c) 2017 Benjamin Renard
59 65
 
60 66
 License
61 67
 -------
... ...
@@ -6,13 +6,16 @@
6 6
 #
7 7
 # Requirement : 
8 8
 #
9
-#     On master node : Slaves must be able to connect with user PG_USER
10
-#                      to database postgres as trust
9
+#     On master node : Slaves must be able to connect with user from recovery.conf
10
+#                      to database with the same name (or another specify with -D)
11
+#                      as trust (or via md5 using password specify in ~/.pgpass).
11 12
 #
12
-#     On standby node : PG_USER must be able to connect localy as trust
13
+#     On standby node : PG_USER must be able to connect localy on the database
14
+#                       with the same name (or another specify with -D) as trust
15
+#                       (or via md5 using password specify in ~/.pgpass).
13 16
 #
14 17
 # Author : Benjamin Renard <brenard@easter-eggs.com>
15
-# Date : Wed, 14 Mar 2012 14:45:55 +0000
18
+# Date : Fri, 25 Aug 2017 15:57:57 +0200
16 19
 # Source : http://git.zionetrix.net/check_pg_streaming_replication
17 20
 #
18 21
 
... ...
@@ -44,7 +47,7 @@ Usage : $0 [-d] [-h] [options]
44 47
 				(By default, try to auto-detect it, on your system it :
45 48
                                 $PG_MAIN)
46 49
 	-r recovery_conf	Specify Postgres recovery configuration file path
47
-				(Default : $PG_MAIN/$RECOVERY_CONF_FILENAME)
50
+				(Default : [PG_MAIN]/$RECOVERY_CONF_FILENAME)
48 51
 	-p pg_port		Specify default Postgres master TCP port (Default : $PG_DEFAULT_PORT)
49 52
 	-D dbname		Specify DB name on Postgres master/slave to connect on (Default : PG_USER)
50 53
 	-d			Debug mode
51 54