0

I am trying to register a health check using the a config file but I have ran into an issue where it says a script file does not exist but it clearly does when I manually check if it exists.

Checks API call

{
    "mem-util": {
        "CheckID": "mem-util",
        "CreateIndex": 0,
        "Definition": {},
        "ModifyIndex": 0,
        "Name": "Memory utilization",
        "Node": "consul-01",
        "Notes": "",
        "Output": "fork/exec /work-disk/consul/data/mem-check.sh: no such file or directory",
        "ServiceID": "",
        "ServiceName": "",
        "ServiceTags": [],
        "Status": "critical"
    }
}

Mem Check JSON file

{
    "check": {
      "id": "mem-util",
      "name": "Memory utilization",
      "args": ["/work-disk/consul/data/mem-check.sh"],
      "interval": "10s",
      "timeout": "1s"
    }
}

Manually checking if file exists

me@JK-SRV-CHEF-TEST-2:/work-disk/consul/data$ pwd
/work-disk/consul/data
me@JK-SRV-CHEF-TEST-2:/work-disk/consul/data$ ll
total 32
drwxr-xr-x 5 consul consul 4096 Nov 10 22:46 ./
drwxr-xr-x 6 consul consul 4096 Nov 10 21:25 ../
-rw-r--r-- 1 root   root    394 Nov 10 16:31 checkpoint-signature
-rwxr-xr-x 1 consul consul  281 Nov 10 20:47 mem-check.sh*
-rw------- 1 root   root     36 Nov 10 16:31 node-id
drwx------ 2 root   root   4096 Nov 10 21:25 proxy/
drwxr-xr-x 3 root   root   4096 Nov 10 16:31 raft/
drwxr-xr-x 2 root   root   4096 Nov 10 16:31 serf/

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.