mirror of
https://github.com/status-im/consul.git
synced 2025-02-02 17:03:31 +00:00
Add missing docs for checks Watch type (#5188)
Add configuration examples for specifying watch checks by health check state or service, and corresponding CLI examples. Resolves: #5188
This commit is contained in:
parent
e6e5acce92
commit
8572ac135c
@ -360,9 +360,39 @@ filter to a specific state. By default, it will watch all checks.
|
|||||||
This maps to the `/v1/health/state/` API if monitoring by state
|
This maps to the `/v1/health/state/` API if monitoring by state
|
||||||
or `/v1/health/checks/` if monitoring by service.
|
or `/v1/health/checks/` if monitoring by service.
|
||||||
|
|
||||||
|
Here is an example configuration for monitoring by state:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "checks",
|
||||||
|
"state": "passing",
|
||||||
|
"args": ["/usr/bin/my-check-handler.sh", "-passing"]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Here is an example configuration for monitoring by service:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "checks",
|
||||||
|
"service": "redis",
|
||||||
|
"args": ["/usr/bin/my-check-handler.sh", "-redis"]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Or, using the watch command:
|
||||||
|
|
||||||
|
State:
|
||||||
|
|
||||||
|
$ consul watch -type=checks -state=passing /usr/bin/my-check-handler.sh -passing
|
||||||
|
|
||||||
|
Service:
|
||||||
|
|
||||||
|
$ consul watch -type=checks -service=redis /usr/bin/my-check-handler.sh -redis
|
||||||
|
|
||||||
An example of the output of this command:
|
An example of the output of this command:
|
||||||
|
|
||||||
```javascript
|
```json
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"Node": "foobar",
|
"Node": "foobar",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user