Skip to content

Commit

Permalink
add network partition check in ovn probes
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Sep 21, 2022
1 parent 270e9dc commit 6df23c2
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions dist/images/ovn-healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,23 @@ ovn-ctl status_northd
ovn-ctl status_ovnnb | grep -q '^running'
ovn-ctl status_ovnsb | grep -q '^running'

ovn-appctl -t /var/run/ovn/ovnnb_db.ctl cluster/status OVN_Northbound | grep Status | grep -v "failed"
ovn-appctl -t /var/run/ovn/ovnsb_db.ctl cluster/status OVN_Southbound | grep Status | grep -v "failed"
nb_status=$(ovn-appctl -t /var/run/ovn/ovnnb_db.ctl cluster/status OVN_Northbound | grep Status)
sb_status=$(ovn-appctl -t /var/run/ovn/ovnsb_db.ctl cluster/status OVN_Southbound | grep Status)
nb_role=$(ovn-appctl -t /var/run/ovn/ovnnb_db.ctl cluster/status OVN_Northbound | grep Role)
sb_role=$(ovn-appctl -t /var/run/ovn/ovnsb_db.ctl cluster/status OVN_Southbound | grep Role)

if ! echo ${nb_status} | grep -v "failed"; then
echo "nb health check failed"
fi
if ! echo ${sb_status} | grep -v "failed"; then
echo "sb health check failed"
fi

if echo ${nb_status} | grep "disconnected" && echo ${nb_role} | grep "candidate"; then
echo "nb health check failed"
exit 1
fi
if echo ${sb_status} | grep "disconnected" && echo ${sb_role} | grep "candidate"; then
echo "sb health check failed"
exit 1
fi

0 comments on commit 6df23c2

Please sign in to comment.