D
D
DeeZ2017-06-10 16:34:01
linux
DeeZ, 2017-06-10 16:34:01

How to create a watcher in Consul?

The documentation for Consul has an example of a config with a watcher . I want to make mine similar. I create config.json

{
  "watches":
  {
    "type": "checks",
    "state": "critical",
    "handler": "/crit.sh"
  }
}

I try to add:
curl -v -XPUT -d @config.json http://127.0.0.1:8500/v1/agent/check/register

But it doesn't show up in the config. I look like this:
curl -s http://127.0.0.1:8500/v1/agent/self
I suspect that I'm either registering it wrong or checking it in the wrong place. Tell me how to add a watcher through the API?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question