Skip to content

Elasticsearch — catch cluster going yellow/red

Production ES cluster goes yellow status. Need an alert now, not 30 minutes later via Kibana.

Recipe

bash
#!/usr/bin/env bash
# Expose-as-HTTP wrapper over _cluster/health.
# Returns just the status word so a body-keyword rule can match.
ES_URL="${ES_URL:-http://localhost:9200}"
STATUS=$(curl -s --max-time 5 "$ES_URL/_cluster/health" \
         | python3 -c 'import json,sys; print(json.load(sys.stdin).get("status","unknown"))')
echo "$STATUS"

Same thing in Enterno.io

Expose this endpoint and point an Enterno HTTP monitor with rule "body = green". Pioneer+ persists every status — you can see exactly when it went yellow.

Set up HTTP monitor → ← All recipes

Related recipes