adaptai / platform /dbops /tools /quick_health.sh
ADAPT-Chase's picture
Add files using upload-large-folder tool
503b0e9 verified
#!/usr/bin/env bash
set -euo pipefail
DBOPS_ROOT=${DBOPS_ROOT:-/data/adaptai/platform/dbops}
PATH="$DBOPS_ROOT/binaries/redis:$PATH"
green=0; yellow=0; red=0
q() {
bash "$DBOPS_ROOT/checks/qdrant_health.sh" >/dev/null 2>&1 || true
jq -r '.service + ":" + .health' "$DBOPS_ROOT/run/health/qdrant.json" 2>/dev/null || echo qdrant:red
}
d() {
bash "$DBOPS_ROOT/checks/dragonfly_cluster_health.sh" >/dev/null 2>&1 || true
jq -r '.service + ":" + .health' "$DBOPS_ROOT/run/health/dragonfly.json" 2>/dev/null || echo dragonfly:red
}
r() {
bash "$DBOPS_ROOT/checks/redis_cluster_health.sh" >/dev/null 2>&1 || true
jq -r '.service + ":" + .health' "$DBOPS_ROOT/run/health/redis_cluster.json" 2>/dev/null || echo redis_cluster:red
}
for s in $(q; d; r); do
case "$s" in
*:green) echo "$s"; green=$((green+1));;
*:yellow) echo "$s"; yellow=$((yellow+1));;
*) echo "$s"; red=$((red+1));;
esac
done
echo "summary: green=$green yellow=$yellow red=$red"
exit 0