Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Health checks with SERVICE_CHECK_SCRIPT doesn't work #687

Open
kevinimbrechts opened this issue Oct 2, 2020 · 1 comment
Open

Health checks with SERVICE_CHECK_SCRIPT doesn't work #687

kevinimbrechts opened this issue Oct 2, 2020 · 1 comment

Comments

@kevinimbrechts
Copy link

Hi there,

  • What version of docker are you running?
    Docker version 18.09.7, build 2d0083d
  • What version of registrator are you running?
    v7
  • What version of Consul are you running?
    Consul v1.6.1
  • Did you build a custom version of registrator? If so, what is that image?
    No
  • What is the exact command you are running registrator with?
    -internal=true -deregister=on-success consul-tls://consul:8501
  • What is the exact command you are running your container with?
environment:
  - SERVICE_CHECK_SCRIPT=curl --noproxy '*' example.com
  • A log capture of all the docker events before, during, and after the issue.
2020/10/02 14:53:41 [ERR] agent: Check "service:xxxxxxxxxxxxxxxxx" failed to invoke: exec: "curl --noproxy '*' example.com": executable file not found in $PATH

Description of the problem:
I want to use health checks with Registrator and Consul, but when I add the env var SERVICE_CHECK_SCRIPT, Consul is unable to register the health check.
I have tried to change the command by this one :

environment:
  - SERVICE_CHECK_SCRIPT=/usr/bin/curl --noproxy '*' example.com

But I have this error message :

fork/exec /usr/bin/curl --noproxy '*' example.com: no such file or directory

/usr/bin/curl exists in the Consul container :

ls -lah /usr/bin
-rwxr-xr-x    1 root     root      214.0K Jun  5  2019 curl
@lettore
Copy link

lettore commented Sep 23, 2021

It's really sad that a useful project like this is left in an abandoned state.
I made a Docker image for my personal use that solves this problem and works in swarm with overlay networks.
docker pull lettore/registrator:8.0.1-3.11, where 3.11 is the Alpine version used, it's also multi-arch.
Hopes this can be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants