-
Notifications
You must be signed in to change notification settings - Fork 67
Check
Subcommand | Synopsis |
---|---|
deregister | Remove a check from the agent |
fail | Mark a local check as critical |
pass | Mark a local check as passing |
register | Register a new local check |
warn | Mark a local check as warning |
Register a check with the agent
Usage: consul-cli check register [options] checkName
-
--id
The service ID. If--id
is not provided thencheckName
is used. There cannot be duplicate IDs per agent so it may be necessary to specify an id -
--http
A URL to check every interval. Only one of--http
,--script
or--ttl
can be specified -
--script
Path to a local command that is run every interval. Only one of--http
,--script
or--ttl
can be specified -
--ttl
The duration that Consul will wait before marking the service ascritical
. In this mode, the application must update the status via thepass
,warn
orfail
endpoints before the TTL expires. Only one of--http
,--script
or--ttl
can be specified -
--interval
For--http
and--script
check types, the time between execution of the check. -
--service-id
Service ID to associate the check with -
--notes
Text description of the check
$ ./consul-cli check register --id='test:ttl' --ttl=2m testTTL
Deregisters a check from the agent
Usage: consul-cli check deregister [options] checkId
$ ./consul-cli check deregister 'test:ttl'
$
Mark a check as passing
Usage: consul-cli check pass [options] checkId
-
--note
Text message to associate with the check status
$ ./consul-cli check pass 'test:ttl'
$ ./consul-cli agent checks
{
"test:ttl": {
"Node": "default",
"CheckID": "test:ttl",
"Name": "testTTL",
"Status": "passing",
"Notes": "",
"Output": "",
"ServiceID": "",
"ServiceName": ""
}
}
Mark a check as critical
Usage: consul-cli check fail [options] checkId
-
--note
Text message to associate with the check status
$ ./consul-cli check fail 'test:ttl'
$ ./consul-cli agent checks
{
"test:ttl": {
"Node": "default",
"CheckID": "test:ttl",
"Name": "testTTL",
"Status": "critical",
"Notes": "",
"Output": "",
"ServiceID": "",
"ServiceName": ""
}
}
Mark a check as warning
Usage: consul-cli check warn [options] checkId
-
--note
Text message to associate with the check status
$ ./consul-cli check warn 'test:ttl'
$ ./consul-cli agent checks
{
"test:ttl": {
"Node": "default",
"CheckID": "test:ttl",
"Name": "testTTL",
"Status": "warning",
"Notes": "",
"Output": "",
"ServiceID": "",
"ServiceName": ""
}
}