Ceph-mgr: make liveness to check through admin scoket
This is to update the mgr liveness script to use admin socket instead of resolving ceph mon fqdn Change-Id: Id95f78afef44103a834312d0667d49947ee803a4 Co-Authored-By: Jean-Charles Lopez <jl970p@att.com>
This commit is contained in:
parent
b3b4e6858b
commit
793b3631b5
@ -22,13 +22,15 @@ export LC_ALL=C
|
|||||||
COMMAND="${@:-liveness}"
|
COMMAND="${@:-liveness}"
|
||||||
|
|
||||||
function heath_check () {
|
function heath_check () {
|
||||||
IS_MGR_AVAIL=$(ceph --cluster "${CLUSTER}" mgr dump | python -c "import json, sys; print json.load(sys.stdin)['available']")
|
ASOK=$(ls /var/run/ceph/${CLUSTER}-mgr*)
|
||||||
|
MGR_NAME=$(basename ${ASOK} | sed -e 's/.asok//' | cut -d. -f2)
|
||||||
if [ "${IS_MGR_AVAIL}" = True ]; then
|
MGR_STATE=$(ceph --cluster ${CLUSTER} --connect-timeout 1 daemon mgr.${MGR_NAME} status|grep "osd_epoch")
|
||||||
exit 0
|
if [ $? = 0 ]; then
|
||||||
else
|
exit 0
|
||||||
exit 1
|
else
|
||||||
fi
|
echo $MGR_STATE
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function liveness () {
|
function liveness () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user