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

allow non 200 HTTP return code to be OK, fixes #48 #49

Merged
merged 1 commit into from
Aug 17, 2021

Conversation

xorpaul
Copy link
Contributor

@xorpaul xorpaul commented Aug 16, 2021

I'm using it to detect if my vault nodes are unsealed.
Standby nodes in HA mode return 429 instead of 200, which is intended by vault (hashicorp/vault#2850)

The default behavior stops validating the JSON output as soon as --status_level 429:0 is specified:

$ check_http_json.rb -u http://127.0.0.1:8200/v1/sys/health -e sealed -r false --status_level 429:0
OK: sealed does match 'false'

Copy link
Owner

@phrawzty phrawzty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax nit

check_http_json.rb Outdated Show resolved Hide resolved
@phrawzty phrawzty merged commit d98a0bf into phrawzty:main Aug 17, 2021
@phrawzty
Copy link
Owner

Looks great! Thanks for the PR! 😄

@xorpaul xorpaul deleted the allow_non_200_http_code branch August 18, 2021 09:28
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

Successfully merging this pull request may close these issues.

2 participants