Skip to content

Instantly share code, notes, and snippets.

@abuxton
Created February 17, 2021 09:33
Show Gist options
  • Save abuxton/d673a2d3aa7c132855e0cba540247a40 to your computer and use it in GitHub Desktop.
Save abuxton/d673a2d3aa7c132855e0cba540247a40 to your computer and use it in GitHub Desktop.
helper function for hashicorp vault manual healthcheck
function vault_health () {
if [[ -z "${VAULT_ADDR}" ]]; then
echo "# ensure the following exports are set: \n
# export VAULT_TOKEN=<token> \n
# export VAULT_CACERT=<path/to/cacert \n
# export VAULT_ADDR='127.0.0.1:8200' "
else
echo '# vault status'
vault status
echo '# curl -k --header "X-Vault-Token: ${VAULT_TOKEN}" "https://${VAULT_ADDR}/v1/sys/config/state/sanitized" | jq '
curl -k --header "X-Vault-Token: ${VAULT_TOKEN}" "https://${VAULT_ADDR}/v1/sys/config/state/sanitized" | jq
echo '# curl -k https://127.0.0.1:8200/v1/sys/health | jq '
curl -k https://127.0.0.1:8200/v1/sys/health | jq
echo '# curl -k --header "X-Vault-Token: ${VAULT_TOKEN}" "https://${VAULT_ADDR}/v1/sys/metrics" | jq '
curl -k --header "X-Vault-Token: ${VAULT_TOKEN}" "https://${VAULT_ADDR}/v1/sys/metrics" | jq
echo '# curl -k --header "X-Vault-Token: ${VAULT_TOKEN}" "https://${VAULT_ADDR}/v1/sys/license" | jq '
curl -k --header "X-Vault-Token: ${VAULT_TOKEN}" "https://${VAULT_ADDR}/v1/sys/license" | jq
echo '# curl -k 'https://127.0.0.1:8200/v1/sys/replication/status' | jq '
curl -k 'https://127.0.0.1:8200/v1/sys/replication/status' | jq
echo '# curl -k --header "X-Vault-Token: ${VAULT_TOKEN}" "https://${VAULT_ADDR}/v1/sys/storage/raft/configuration" | jq '
curl -k --header "X-Vault-Token: ${VAULT_TOKEN}" "https://${VAULT_ADDR}/v1/sys/storage/raft/configuration" | jq
fi
}
@abuxton
Copy link
Author

abuxton commented Mar 8, 2022

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