3
votes

I am trying to run a shell script to do the health check using consul. I am able to do the HTTP checks but when I try the script its throwing error. ( maybe some silly mistake )

Config File

{
 "services": [
   {
     "name": "test",
     "checks": [
         {
           "script": "./test.sh",
           "interval": "15s"
         }
       ]
     }
   ] 
}

Run

./consul agent -enable-script-checks=true -ui -dev -config-dir=.     

Output

==> Error parsing web.json: 1 error(s) occurred:

* invalid config key services[0].checks[0].script
1

1 Answers

0
votes

change your configure variable,change “script” to “args”.

for example:

"args": [
    "/usr/local/bin/check_mem.py",
    "-limit",
    "256MB"
],

it should solve your problem