Uptime Monitoring Hierarchy: Main Monitor Status Based on Server Availability

Hello Elastic Community,

I Need to create a hierarchical tree structure for monitoring uptime across three servers, labeled A, B, and C. I want to have a main monitor, and when all three servers are running, the main monitor should display an "UP" status. However, if any of the servers (A, B, or C) goes down, the main monitor should show a "DOWN" status.

Hirerchy

This is the below code i tried for this in heartbeat but when i m runnig hearteat beat i m getting 3 differnt monitors for all 3 servers each instaed of i want only 1 monitor that will show the status up or down of all 3 server can any one pls give the solution or suggection how can i do it

- type: http
  enabled: true
  id: MAIN Server
  name: MAIN_Server 
  service.name: main server
  hosts: 
    - "http://123.123.123.123:5001/actuator/health" # Server A
    - "http://123.123.123.124:5002/actuator/health" # Server B
    - "http://123.123.123.125:5003/actuator/health" # Server c
  ipv4: true
  mode: all
  timeout: 50m
  check.request.method: GET
  check.response:
    status: [200]
    json:
      - description: Server A status
        expression: '$.status == "UP"' # Check Server A status
      - description: Server B status
        expression: '$.status == "UP"' # Check Server B status
      - description: Server C status
        expression: '$.status == "UP"' # Check Server C status
  response.include_body: always
  schedule: '@every 60s'
  tags: ["Health"]

Hi @kasecen637,

Heartbeat does not have the notion of monitor grouping at the moment. As you mentioned, it creates a monitor for each of the specified endpoints, each with a separate status.

If your use case supports it, you could simulate the grouping logic through custom queries.