diff --git a/README.md b/README.md index a8e8ee8..5f9104d 100644 --- a/README.md +++ b/README.md @@ -202,14 +202,32 @@ Usage: check_patroni cluster_node_count [OPTIONS] Count the number of nodes in the cluster. + The state refers to the state of PostgreSQL. Possible values are: + * initalizing new cluster, initdb failed + * running custom bootstrap script, custom bootstrap failed + * starting, start failed + * restarting, restart failed + * running + * stopping, stopped, stop failed + * creating replica + * crashed + + The role refers to the role of the server in the cluster. Possible values + are: + * master or leader (V3.0.0+) + * replica + * demoted + * promoted + * uninitialized + Check: * Compares the number of nodes against the normal and running node warning and critical thresholds. * `OK`: If they are not provided. Perfdata: * `members`: the member count. - * all the roles of the nodes in the cluster with their number. - * all the statuses of the nodes in the cluster with their number. + * all the roles of the nodes in the cluster with their number (start with "role_"). + * all the statuses of the nodes in the cluster with their number (start with "state_"). Options: -w, --warning TEXT Warning threshold for the number of nodes. diff --git a/check_patroni/cli.py b/check_patroni/cli.py index d76cc37..1ab53b5 100644 --- a/check_patroni/cli.py +++ b/check_patroni/cli.py @@ -206,6 +206,26 @@ def cluster_node_count( ) -> None: """Count the number of nodes in the cluster. + \b + The state refers to the state of PostgreSQL. Possible values are: + * initializing new cluster, initdb failed + * running custom bootstrap script, custom bootstrap failed + * starting, start failed + * restarting, restart failed + * running + * stopping, stopped, stop failed + * creating replica + * crashed + + \b + The role refers to the role of the server in the cluster. Possible values + are: + * master or leader (V3.0.0+) + * replica + * demoted + * promoted + * uninitialized + \b Check: * Compares the number of nodes against the normal and running node warning and critical thresholds. @@ -214,8 +234,8 @@ def cluster_node_count( \b Perfdata: * `members`: the member count. - * all the roles of the nodes in the cluster with their number. - * all the statuses of the nodes in the cluster with their number. + * all the roles of the nodes in the cluster with their number (start with "role_"). + * all the statuses of the nodes in the cluster with their number (start with "state_"). """ check = nagiosplugin.Check() check.add(