From 98e03e8b543125fa57766dd7be80db3cb7e33693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20BERSAC?= Date: Mon, 11 Jul 2022 12:12:26 +0200 Subject: [PATCH 1/2] Make doc/make_readme.sh independent of PWD --- doc/make_readme.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/make_readme.sh b/doc/make_readme.sh index 9279f93..c529b97 100755 --- a/doc/make_readme.sh +++ b/doc/make_readme.sh @@ -5,7 +5,8 @@ if ! command -v check_patroni &>/dev/null; then exit 1 fi -README="../README.md" +top_srcdir="$(readlink -m "$0/../..")" +README="${top_srcdir}/README.md" function readme(){ echo "$1" >> $README } From 3ac8570748ac01acd6a4e384d7d9f1a3ec47ab5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20BERSAC?= Date: Mon, 11 Jul 2022 11:53:00 +0200 Subject: [PATCH 2/2] Review README, extracting CONTRIBUTING --- CONTRIBUTING.md | 50 +++++++++++++++++++++++++++++++++++++++++ README.md | 53 +++++++++++++++---------------------------- doc/make_readme.sh | 56 ++++++++++++++-------------------------------- 3 files changed, 85 insertions(+), 74 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f48bf54 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,50 @@ +# Contributing to check_patroni + +Thanks for your interest in contributing to check_patroni. + +## Clone Git Repository + +Installation from the git repository: + +``` +$ git clone https://github.com/dalibo/check_patroni.git +$ cd check_patroni +``` + +Change the branch if necessary. + +## Create Python Virtual Environment + +You need a dedicated environment, install dependencies and then check_patroni +from the repo: + +``` +$ python3 -m venv .venv +$ . .venv/bin/activate +(.venv) $ pip3 install .[dev,test] +(.venv) $ check_patroni +``` + +To quit this env and destroy it: + +``` +$ deactivate +$ rm -r .venv +``` + + +## Development Environment + +A vagrant file is available to create a icinga / opm / grafana stack and +install check_patroni. You can then add a server to the supervision and +watch the graphs in grafana. It's in `./test/vagrant`. + +A vagrant file can be found in [this +repository](https://github.com/ioguix/vagrant-patroni to generate a patroni/etcd +setup. + + +## Executing Tests + +The pytests are in `./test` and use a moker to provide a json response instead +of having to call the patroni API. diff --git a/README.md b/README.md index a082921..f3e91af 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,13 @@ # check_patroni +A nagios plugin for patroni. + +## Features + +- Check presence of leader, replicas, node counts. +- Check each node for replication status. + + ``` Usage: check_patroni [OPTIONS] COMMAND [ARGS]... @@ -36,36 +44,24 @@ Commands: ## Install -Installation from the git repository: +check_patroni is licensed under PostgreSQL license. ``` -$ git clone https://github.com/dalibo/check_patroni -``` - -Change the branch if necessary. Then create a dedicated environment, -install dependencies and then check_patroni from the repo: - -``` -$ cd check_patroni -$ python3 -m venv .venv -$ . .venv/bin/activate -(.venv) $ pip3 install . -(.venv) $ pip3 install .[dev] # for dev purposes -(.venv) $ pip3 install .[test] # for testing purposes -(.venv) $ check_patroni -``` - -To quit this env and destroy it: - -``` -$ deactivate -$ rm -r .venv +$ pip install git+https://github.com/dalibo/check_patroni.git ``` Links: * [pip & centos 7](https://linuxize.com/post/how-to-install-pip-on-centos-7/) * [pip & debian10](https://linuxize.com/post/how-to-install-pip-on-debian-10/) +## Support + +If you hit a bug or need help, open a [GitHub +issue](https://github.com/dalibo/check_patroni/issues/new). Dalibo has no +commitment on response time for public free support. Thanks for you +contribution ! + + ## Config file All global and service specific parameters can be specified via a config file has follows: @@ -338,16 +334,3 @@ Options: ``` -## test - -The pytests are in `./test` and use a moker to provide a json response instead -of having to call the patroni API. - -A vagrant file is available to create a icinga / opm / grafana stack and -install check_patroni. You can then add a server to the supervision and -watch the graphs in grafana. It's in `./test/vagrant`. - -A vagrant file can be found in [this -repository](https://github.com/ioguix/vagrant-patroni to generate a -patroni/etcd setup. - diff --git a/doc/make_readme.sh b/doc/make_readme.sh index c529b97..cd1d393 100755 --- a/doc/make_readme.sh +++ b/doc/make_readme.sh @@ -21,41 +21,36 @@ function helpme(){ cat << '_EOF_' > $README # check_patroni + +A nagios plugin for patroni. + +## Features + +- Check presence of leader, replicas, node counts. +- Check each node for replication status. + _EOF_ helpme cat << '_EOF_' >> $README ## Install -Installation from the git repository: +check_patroni is licensed under PostgreSQL license. ``` -$ git clone https://github.com/dalibo/check_patroni -``` - -Change the branch if necessary. Then create a dedicated environment, -install dependencies and then check_patroni from the repo: - -``` -$ cd check_patroni -$ python3 -m venv .venv -$ . .venv/bin/activate -(.venv) $ pip3 install . -(.venv) $ pip3 install .[dev] # for dev purposes -(.venv) $ pip3 install .[test] # for testing purposes -(.venv) $ check_patroni -``` - -To quit this env and destroy it: - -``` -$ deactivate -$ rm -r .venv +$ pip install git+https://github.com/dalibo/check_patroni.git ``` Links: * [pip & centos 7](https://linuxize.com/post/how-to-install-pip-on-centos-7/) * [pip & debian10](https://linuxize.com/post/how-to-install-pip-on-debian-10/) +## Support + +If you hit a bug or need help, open a [GitHub +issue](https://github.com/dalibo/check_patroni/issues/new). Dalibo has no +commitment on response time for public free support. Thanks for you +contribution ! + ## Config file All global and service specific parameters can be specified via a config file has follows: @@ -121,20 +116,3 @@ helpme node_tl_has_changed cat << _EOF_ >> $README _EOF_ - -cat << '_EOF_' >> $README -## test - -The pytests are in `./test` and use a moker to provide a json response instead -of having to call the patroni API. - -A vagrant file is available to create a icinga / opm / grafana stack and -install check_patroni. You can then add a server to the supervision and -watch the graphs in grafana. It's in `./test/vagrant`. - -A vagrant file can be found in [this -repository](https://github.com/ioguix/vagrant-patroni to generate a -patroni/etcd setup. - -_EOF_ -