Health

Use Sensu’s health API to make sure your backend is up and running and check the health of your etcd cluster members.

Health payload example

A request to the health endpoint retrieves a JSON map with health data for your Sensu instance.

curl -X GET \
http://127.0.0.1:8080/health

HTTP/1.1 200 OK
{
  "Alarms": null,
  "ClusterHealth": [
    {
      "MemberID": 2882886652148554927,
      "MemberIDHex": "8923110df66458af",
      "Name": "default",
      "Err": "",
      "Healthy": true
    }
  ],
  "Header": {
    "cluster_id": 4255616344056076734,
    "member_id": 2882886652148554927,
    "raft_term": 26
  }
}

Health specification

Top-level attributes

Alarms
description Top-level attribute that lists all active etcd alarms.
required true
type String
example
"Alarms": null
ClusterHealth
description Top-level attribute that includes health status information for every etcd cluster member.
required true
type Map of key-value pairs
example
"ClusterHealth": [
    {
      "MemberID": 2882886652148554927,
      "MemberIDHex": "8923110df66458af",
      "Name": "default",
      "Err": "",
      "Healthy": true
    }
  ]
Header
description Top-level map that includes the response header for the entire cluster response.
required true
type Map of key-value pairs
example
"Header": {
    "cluster_id": 4255616344056076734,
    "member_id": 2882886652148554927,
    "raft_term": 26
  }

ClusterHealth attributes

Member ID
description The etcd cluster member’s ID.
required true
type Integer
example
"MemberID": 2882886652148554927
MemberIDHex
description The hexadecimal representation of the etcd cluster member’s ID.
required true
type String
example
"MemberIDHex": "8923110df66458af"
Name
description The etcd cluster member’s name.
required true
type String
example
Name": "default"
Err
description Any errors Sensu encountered while checking the etcd cluster member’s health.
required true
type String
example
"Err": ""
Healthy
description true if the etcd cluster member is connected. Otherwise, false.
required true
type Boolean
default false
example
"Healthy": true

Header attributes

cluster_id
description The etcd cluster ID.
required true
type Integer
example
"cluster_id": 4255616344056076734
member_id
description The etcd cluster member’s ID.
required true
type Integer
example
"member_id": 2882886652148554927
raft_term
description The etcd cluster member’s raft term.
required true
type Integer
example
"raft_term": 26