From 5131201736e215e14b5133967181f0509632a496 Mon Sep 17 00:00:00 2001 From: Andrii Krymets Date: Wed, 27 Dec 2017 17:23:29 +0200 Subject: [PATCH 1/2] Update checks.html.md 1. Replace deprecated "script" option with "args" in check definition examples (Not sure in correctness of arguments splitting) --- website/source/intro/getting-started/checks.html.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/website/source/intro/getting-started/checks.html.md b/website/source/intro/getting-started/checks.html.md index f3b79f1b39..287b954024 100644 --- a/website/source/intro/getting-started/checks.html.md +++ b/website/source/intro/getting-started/checks.html.md @@ -26,16 +26,18 @@ appropriate calls to the [HTTP API](/api/health.html). We will use the check definition approach because, just like with services, definitions are the most common way to set up checks. +In Consul 0.9.0 and later the agent must be configured with enable_script_checks set to true in order to enable script checks. + Create two definition files in the Consul configuration directory of the second node: ```text vagrant@n2:~$ echo '{"check": {"name": "ping", - "script": "ping -c1 google.com >/dev/null", "interval": "30s"}}' \ + "args": ["ping","-c1","google.com",">/dev/null"], "interval": "30s"}}' \ >/etc/consul.d/ping.json vagrant@n2:~$ echo '{"service": {"name": "web", "tags": ["rails"], "port": 80, - "check": {"script": "curl localhost >/dev/null 2>&1", "interval": "10s"}}}' \ + "check": {"args": ["curl","localhost",">/dev/null","2>&1"], "interval": "10s"}}}' \ >/etc/consul.d/web.json ``` From 584a136906a65298b190bdae9da2cf505569e2fb Mon Sep 17 00:00:00 2001 From: James Phillips Date: Wed, 3 Jan 2018 18:32:42 -0800 Subject: [PATCH 2/2] Update checks.html.md --- website/source/intro/getting-started/checks.html.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/website/source/intro/getting-started/checks.html.md b/website/source/intro/getting-started/checks.html.md index 287b954024..5d5a5cd65a 100644 --- a/website/source/intro/getting-started/checks.html.md +++ b/website/source/intro/getting-started/checks.html.md @@ -26,18 +26,19 @@ appropriate calls to the [HTTP API](/api/health.html). We will use the check definition approach because, just like with services, definitions are the most common way to set up checks. -In Consul 0.9.0 and later the agent must be configured with enable_script_checks set to true in order to enable script checks. +In Consul 0.9.0 and later the agent must be configured with +`enable_script_checks` set to true in order to enable script checks. Create two definition files in the Consul configuration directory of the second node: ```text vagrant@n2:~$ echo '{"check": {"name": "ping", - "args": ["ping","-c1","google.com",">/dev/null"], "interval": "30s"}}' \ + "args": ["ping", "-c1", "google.com"], "interval": "30s"}}' \ >/etc/consul.d/ping.json vagrant@n2:~$ echo '{"service": {"name": "web", "tags": ["rails"], "port": 80, - "check": {"args": ["curl","localhost",">/dev/null","2>&1"], "interval": "10s"}}}' \ + "check": {"args": ["curl", "localhost"], "interval": "10s"}}}' \ >/etc/consul.d/web.json ```