Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
ChrisAubuchon edited this page Jul 14, 2015 · 3 revisions

check-register

API Reference

Register a check with the agent

Basic Usage

Usage: consul-cli check-register [options] checkName

Command Line Options

  • --id
    The service ID. If --id is not provided then checkName 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 as critical. In this mode, the application must update the status via the pass, warn or fail 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

Examples

$ ./consul-cli check-register --id='test:ttl' --ttl=2m testTTL

check-deregister

API Reference

Deregisters a check from the agent

Basic Usage

Usage: consul-cli check-deregister [options] checkId

Examples

$ ./consul-cli check-deregister 'test:ttl'
$

check-pass

API Reference

Mark a check as passing

Basic Usage

Usage: consul-cli check-pass [options] checkId

Command Line Options

  • --note
    Text message to associate with the check status

Examples

$ ./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": ""
  }
}

check-fail

API Reference

Mark a check as critical

Basic Usage

Usage: consul-cli check-fail [options] checkId

Command Line Options

  • --note
    Text message to associate with the check status

Examples

$ ./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": ""
  }
}

check-warn


API Reference

Mark a check as warning

Basic Usage

Usage: consul-cli check-warn [options] checkId

Command Line Options

  • --note
    Text message to associate with the check status

Examples

$ ./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": ""
  }
}
Clone this wiki locally