0

I am trying to register a health check with consul using the curl command since I plan to covert this over to chef/ruby once I get it working.

When I input the command below it gives no error message but when I list out all of the checks it shows no checks were registered. My system is consul 1.3.0 and Ubuntu 16.04 LTS

Curl command

curl -v -H "Content-Type: application/json" --header "X-Consul-Token: <token>"  --request PUT --data @mem.json http://localhost:8500/v1/agent/check/register

Command and out put for check for checks

curl http://127.0.0.1:8500/v1/agent/checks
{}

I added -v to the curl command it is looks like the check is missing a name property but I have copied the check directly from the consul docs.

JSON file

{
  "check": {
    "name": "ping",
    "args": ["ping", "-c1", "google.com"], 
    "interval": "30s"
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.