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

etcdctl: Proper exit status of endpoint subcommand #8295

Closed
koorgoo opened this issue Jul 21, 2017 · 2 comments
Closed

etcdctl: Proper exit status of endpoint subcommand #8295

koorgoo opened this issue Jul 21, 2017 · 2 comments
Labels

Comments

@koorgoo
Copy link
Contributor

koorgoo commented Jul 21, 2017

etcdctl may be used for simple monitoring to check etcd cluster's health.
However, as of now etcdctl endpoint health returns 0 for a dead endpoint.

$ etcdctl endpoint health
127.0.0.1:2379 is unhealthy: failed to connect: dial tcp 127.0.0.1:2379: getsockopt: connection refused
$ echo $?
0

Expected exit statuses of etcdctl endpoint health command:

  • for single endpoint:
    • 0 - endpoint is healthy
    • non-0 - endpoint is unhealthy
  • for multiple endpoints:
    • 0 - all endpoints are healthy
    • non-0 - one or more endpoints are unhealthy
$ etcdctl version
etcdctl version: 3.2.4
API version: 3.2
@xiang90
Copy link
Contributor

xiang90 commented Jul 22, 2017

@koorgoo This is a bug. Would you like to help us fix it?

@koorgoo
Copy link
Contributor Author

koorgoo commented Jul 24, 2017

@xiang90 Yeah! With pleasure!

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

No branches or pull requests

2 participants