Created
February 17, 2021 09:33
-
-
Save abuxton/d673a2d3aa7c132855e0cba540247a40 to your computer and use it in GitHub Desktop.
helper function for hashicorp vault manual healthcheck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
just use https://github.com/hashicorp/hcdiag