From ba1f5ab3e73b2ee3c10bd6da163e31150d263ece Mon Sep 17 00:00:00 2001 From: benoit Date: Thu, 26 Aug 2021 15:31:47 +0200 Subject: [PATCH] Syntax of threshold parameter in README.md --- README.md | 19 +++++++++++++++++++ doc/make_readme.sh | 24 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/README.md b/README.md index 0f9005e..a285d3e 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,25 @@ timeout = 0 [options.node_is_replica] lag=100 ``` +## thresholds + +The format for the threshold parameters is "[@][start:][end]". + +* "start:" may be omitted if start==0 +* "~:" means that start is negative infinity +* If `end` is omitted, infinity is assumed +* To invert the match condition, prefix the range expression with "@". + +A match is found when : start <= VALUE <= end + +For example, the followinf command will raise : + +* a warning if there is less than 1 nodes +* a critical if there are no nodes + +``` +check_patroni -e https://10.20.199.3:8008 cluster_has_replica --warning @1 --critical @0 +``` ## cluster services ### cluster_config_has_changed diff --git a/doc/make_readme.sh b/doc/make_readme.sh index c1c5d88..884fe6b 100755 --- a/doc/make_readme.sh +++ b/doc/make_readme.sh @@ -1,5 +1,10 @@ #!/bin/bash +if ! command -v check_patroni &>/dev/null; then + echo "check_partroni must be installed to generate the documentation" + exit 1 +fi + README="../README.md" function readme(){ echo "$1" >> $README @@ -54,6 +59,25 @@ timeout = 0 [options.node_is_replica] lag=100 ``` +## thresholds + +The format for the threshold parameters is "[@][start:][end]". + +* "start:" may be omitted if start==0 +* "~:" means that start is negative infinity +* If `end` is omitted, infinity is assumed +* To invert the match condition, prefix the range expression with "@". + +A match is found when : start <= VALUE <= end + +For example, the followinf command will raise : + +* a warning if there is less than 1 nodes +* a critical if there are no nodes + +``` +check_patroni -e https://10.20.199.3:8008 cluster_has_replica --warning @1 --critical @0 +``` _EOF_ readme readme "## cluster services"