Bootstrap FreeKB - Hashicorp Vault - Check Vault Health using Node.js node-vault
Hashicorp Vault - Check Vault Health using Node.js node-vault

Updated:   |  Hashicorp Vault articles

This assumes you are familiar with Node.js node-vault. If not, check out my article Getting Started with Node.js node-vault.

This assumes the following has already been done.

Here is how you can return health status of Hashicorp Vault.

var options = {
  apiVersion: 'v1',
  endpoint: 'http://vault.example.com:8200',
  token: 'hvs.CAESIAfdfIXuyXbXZCaDx7kSXpC04y4yPRhbTulQBGinXzbsGiUKHGh2cy5sb2lQZVFnRWVxQjdxak8yTkZUNVJUd0sQmM6ACRgI'
};

var vault = require("node-vault")(options);

vault.health()
    .then(console.log)
    .catch((err) => console.error(err.message));

 

Something like this should be returned.

{
  initialized: true,
  sealed: false,
  standby: true,
  performance_standby: true,
  replication_performance_mode: 'disabled',
  replication_dr_mode: 'primary',
  server_time_utc: 1732602178,
  version: '1.16.3+ent',
  enterprise: true,
  cluster_name: 'vault-cluster-58c38b21',
  cluster_id: 'abcd1234-xyza-5678-fd12-1234abde5432',
  license: {
    state: 'autoloaded',
    expiry_time: '2026-06-30T00:00:00Z',
    terminated: false
  },
  echo_duration_ms: 1,
  clock_skew_ms: 0
}

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 825a44 in the box below so that we can be sure you are a human.