This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
Health
Chris Aubuchon edited this page Feb 5, 2016
·
3 revisions
Subcommand | Synopsis |
---|---|
checks | Get the health checks for a service |
node | Get the health info for a node |
service | Get the nodes and health info for a service |
state | Get the checks in a given state |
Get the checks for a service
Usage: consul-cli health checks [options] service
$ ./consul-cli health checks docker
[
{
"Node": "default",
"CheckID": "service:docker",
"Name": "Service 'docker' check",
"Status": "passing",
"Notes": "",
"Output": "active\n",
"ServiceID": "docker",
"ServiceName": "docker"
}
]
Get the health info for a node
Usage: consul-cli health node [options] nodeName
$ ./consul-cli health node default
[
{
"Node": "default",
"CheckID": "service:docker",
"Name": "Service 'docker' check",
"Status": "passing",
"Notes": "",
"Output": "active\n",
"ServiceID": "docker",
"ServiceName": "docker"
}
]
Get the nodes and health info of a service
Usage: consul-cli health service [options] serviceName
-
--tag
Only return services matchingtag
-
--passing
Only return nodes with all service checks in apassing
state
$ ./consul-cli health service --passing=true docker
[
{
"Node": {
"Node": "default",
"Address": "10.0.2.15"
},
"Service": {
"ID": "docker",
"Service": "docker",
"Tags": null,
"Port": 0,
"Address": ""
},
"Checks": [
{
"Node": "default",
"CheckID": "service:docker",
"Name": "Service 'docker' check",
"Status": "passing",
"Notes": "",
"Output": "active\n",
"ServiceID": "docker",
"ServiceName": "docker"
},
{
"Node": "default",
"CheckID": "serfHealth",
"Name": "Serf Health Status",
"Status": "passing",
"Notes": "",
"Output": "Agent alive and reachable",
"ServiceID": "",
"ServiceName": ""
}
]
}
]
Get the checks in a given state
Usage: consul-cli health checks [options] (any|unknown|passing|warning|critical)
$ ./consul-cli health state passing
[
{
"Node": "default",
"CheckID": "serfHealth",
"Name": "Serf Health Status",
"Status": "passing",
"Notes": "",
"Output": "Agent alive and reachable",
"ServiceID": "",
"ServiceName": ""
},
{
"Node": "default",
"CheckID": "service:docker",
"Name": "Service 'docker' check",
"Status": "passing",
"Notes": "",
"Output": "active\n",
"ServiceID": "docker",
"ServiceName": "docker"
}
]