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:
Chinasubbareddy M 2018-10-16 07:53:16 -05:00 committed by chinasubbareddy mallavarapu
parent b3b4e6858b
commit 793b3631b5

View File

@ -22,13 +22,15 @@ export LC_ALL=C
COMMAND="${@:-liveness}"
function heath_check () {
IS_MGR_AVAIL=$(ceph --cluster "${CLUSTER}" mgr dump | python -c "import json, sys; print json.load(sys.stdin)['available']")
if [ "${IS_MGR_AVAIL}" = True ]; then
exit 0
else
exit 1
fi
ASOK=$(ls /var/run/ceph/${CLUSTER}-mgr*)
MGR_NAME=$(basename ${ASOK} | sed -e 's/.asok//' | cut -d. -f2)
MGR_STATE=$(ceph --cluster ${CLUSTER} --connect-timeout 1 daemon mgr.${MGR_NAME} status|grep "osd_epoch")
if [ $? = 0 ]; then
exit 0
else
echo $MGR_STATE
exit 1
fi
}
function liveness () {