Improve README file

This commit is contained in:
Benjamin Renard 2019-03-15 17:21:18 +01:00
parent 914e33d335
commit 327f382b30

View file

@ -5,28 +5,30 @@ This script could be used as Nagios check plugin to verify Postgres Streaming re
This script :
- check if Postgres is running (CRITICAL raise if not)
- check if Postgres is running (_CRITICAL_ raise if not)
- check if Postgres is in recovery mode :
- if Postgres is in recovery mode :
- retreive from Postgres the last xlog file receive and the xlog file replay
- check if Postgres recovery configuration file is NOT present (CRITICAL raise if present)
- 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 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
- retreive from Postgres the last _xlog_ file receive and the _xlog_ file replay
- check if Postgres recovery configuration file is NOT present (_CRITICAL_ raise if present)
- 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 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 :
- check if Postgres recovery configuration file is present (CRITICAL raise if present)
- check if stand-by client(s) is connected (WARNING raise if not)
- Return OK state with list and count of stand-by client(s)
- check if Postgres recovery configuration file is present (_CRITICAL_ raise if present)
- 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 for PostgreSQL 9.1 and test on 9.1, 9.5 and 9.6 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 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 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 on the 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 on the database with the same name (or another specify with `-D`) as trust (or via md5 using password specify in `~/.pgpass`).
* `sudo` must be install on each nodes.
Usage
-----