fix: alert on degraded community scheduler health
This commit is contained in:
@@ -45,6 +45,18 @@ done
|
|||||||
|
|
||||||
ready_payload=$(curl -fsS --max-time 10 "$base_url/ready" 2>/dev/null) || ready_payload=""
|
ready_payload=$(curl -fsS --max-time 10 "$base_url/ready" 2>/dev/null) || ready_payload=""
|
||||||
printf '%s' "$ready_payload" | grep -Eq '"status"[[:space:]]*:[[:space:]]*"ready"' || fail "readiness"
|
printf '%s' "$ready_payload" | grep -Eq '"status"[[:space:]]*:[[:space:]]*"ready"' || fail "readiness"
|
||||||
|
# Import health is intentionally non-blocking for /ready, but must still alert.
|
||||||
|
# Parse the nested component instead of accepting any unrelated "ready" field.
|
||||||
|
community_status=$(printf '%s' "$ready_payload" | python3 -c 'import json,sys
|
||||||
|
try:
|
||||||
|
payload=json.load(sys.stdin)
|
||||||
|
print(payload.get("components",{}).get("community_scheduler",{}).get("status", "unknown"))
|
||||||
|
except Exception:
|
||||||
|
print("unknown")')
|
||||||
|
case "$community_status" in
|
||||||
|
ready) : ;;
|
||||||
|
*) fail "community-scheduler:${community_status}" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
disk_used=$(df -Pk "$repo" | awk 'NR==2 {gsub(/%/, "", $5); print $5}')
|
disk_used=$(df -Pk "$repo" | awk 'NR==2 {gsub(/%/, "", $5); print $5}')
|
||||||
case "$disk_used" in
|
case "$disk_used" in
|
||||||
|
|||||||
Reference in New Issue
Block a user