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_ -