Skip to content
This repository was archived by the owner on Jul 6, 2021. It is now read-only.

Commit b6b9b13

Browse files
NastradamusNikolayS
authored andcommitted
Resolve "Clarify the meaning -h connection parameter (or rename/split it)"
1 parent 1240aed commit b6b9b13

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

README.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,19 @@ Cluster `slony` contains two servers - `db1.vpn.local` and `db1.vpn.local`.
100100
Postgres-checkup automatically detects which one is a master:
101101

102102
```bash
103-
./checkup -h db1.vpn.local -p 5432 --username postgres --dbname postgres --project prod1
103+
./checkup -h db1.vpn.local -p 5432 --username postgres --dbname postgres --project prod1 -e 1
104104
```
105105

106106
```bash
107107
./checkup -h db2.vpn.local -p 5432 --username postgres --dbname postgres --project prod1 -e 1
108108
```
109109

110-
Which literally means: "connect to the server with given credentials, save data into `prod1`
111-
project directory as epoch of check `1`. Epoch is a numerical (**integer**) sign of current iteration.
110+
Which literally means: connect to the server with given credentials, save data into `prod1`
111+
project directory, as epoch of check `1`. Epoch is a numerical (**integer**) sign of current iteration.
112112
For example: in half a year we can switch to "epoch number `2`".
113113

114-
At the first run we can skip `-e 1` because default epoch is `1`, but at the second argument `-e`
115-
must exist: we don't want to overwrite historical results.
116-
114+
`-h db2.vpn.local` means: try to connect to host via SSH and then use remote `psql` command to perform checks.
115+
If SSH is not available the local 'psql' will be used (non-psql reports will be skipped).
117116

118117
As a result of postgres-checkup we have got two directories with .json files and .md files:
119118

@@ -128,7 +127,7 @@ all instances of the postgres cluster `prod1`.
128127
A human-readable report can be found at:
129128

130129
```bash
131-
./artifacts/prod1/e1_full_report.md
130+
./artifacts/prod1/md_reports/1_2018_12_06T14_12_36_+0300/Full_report.md
132131
```
133132

134133
Open it with your favorite Markdown files viewer or just upload to a service such as gist.github.com.

checkup

+11-10
Original file line numberDiff line numberDiff line change
@@ -489,20 +489,21 @@ usage() {
489489
done
490490
echo -n " --help" >&${out_descriptor}
491491
echo " this help" >&${out_descriptor}
492-
# additional info
493-
echo >&${out_descriptor}
494-
echo "Example:" >&${out_descriptor}
495-
echo " PGPASSWORD=mypasswd ./${SCRIPT_NAME} -h [ssh_user]@host_to_connect_via_ssh \\"
496-
echo " --username ${USER} --dbname postgres \\"
497-
echo " --project dummy ${BOLD}-e %EPOCH_NUMBER%${RESET}" >&${out_descriptor}
498-
echo >&${out_descriptor}
499-
echo "You can add more checks into './resources/checks/' directory." >&${out_descriptor}
500-
echo >&${out_descriptor}
501-
echo "Report bugs to https://gitlab.com/postgres-ai-team/postgres-checkup." >&${out_descriptor}
502492
fi
503493
prev_section=${SECTION[$i]}
504494
done
505495

496+
# Print example
497+
echo >&${out_descriptor}
498+
echo "Example:" >&${out_descriptor}
499+
echo " PGPASSWORD=mypasswd ./${SCRIPT_NAME} -h [ssh_user]@host_to_connect_via_ssh \\"
500+
echo " --username ${USER} --dbname postgres \\"
501+
echo " --project dummy ${BOLD}-e %EPOCH_NUMBER%${RESET}" >&${out_descriptor}
502+
echo >&${out_descriptor}
503+
echo "You can add more checks into './resources/checks/' directory." >&${out_descriptor}
504+
echo >&${out_descriptor}
505+
echo "Report bugs to https://gitlab.com/postgres-ai-team/postgres-checkup." >&${out_descriptor}
506+
506507
exit $exit_code
507508
}
508509

resources/cli.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
#
88
# please put items in order by section
99

10+
Connection options|h|hostname|HOST|text|mandatory|connect to host via SSH and then use 'psql' installed on that server OR the local 'psql' will be used
1011
Connection options|p|port|PGPORT|number|optional|PostgreSQL database server port (default: "5432")
1112
Connection options|d|dbname|DBNAME|word|optional|database name to connect to (default: "postgres")
1213
Connection options|None|ss-dbname|SSDBNAME|word|optional|database name with enabled 'pg_stat_statements' extension (for Kxxx checks)
1314
Connection options|U|username|USERNAME|word|optional|database user name (default: psql's default if not given)
14-
Connection options|h|hostname|HOST|text|mandatory|database and ssh server host
1515
Connection options|s|pg-socket-dir|PGSOCKET|text|optional|PostgreSQL domain socket dir (default: psql's default)
1616
Connection options|None|psql-binary|PSQLBINARY|text|optional|psql utility path (default: from $PATH)
1717
Connection options|S|statement-timeout|STIMEOUT|number|optional|statement timeout for sql commands (default: 15 seconds)

0 commit comments

Comments
 (0)