Add and fix healthcheck scripts for Octavia services

- adds script for docker health check of octavia-api service
 - fix the check method for octavia-health-manager service
 - fix the check method for octavia-housekeeping service

Change-Id: Ie8eaab9919bde61793a3310328ee9f117c4e58da
This commit is contained in:
Martin Mágr 2018-03-13 15:48:25 +01:00
parent 95cc729950
commit dc342858a7
3 changed files with 18 additions and 5 deletions

13
healthcheck/octavia-api Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
bind_host=$(get_config_val /etc/octavia/octavia.conf api_settings bind_host 127.0.0.1)
bind_port=$(get_config_val /etc/octavia/octavia.conf api_settings bind_port 9876)
# Add brackets if IPv6
if [[ $bind_host =~ ":" ]]; then
bind_host="[${bind_host}]"
fi
healthcheck_curl http://${bind_host}:${bind_port}/

View File

@ -3,12 +3,12 @@
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
process='octavia-health-manager'
args="${@:-5671 5672}"
args="${@:-5555}"
if healthcheck_port $process $args; then
if healthcheck_listen $process $args; then
exit 0
else
ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
echo "There is no $process process listening on ports $ports."
exit 1
fi

View File

@ -3,12 +3,12 @@
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
process='octavia-housekeeping'
args="${@:-5671 5672}"
args="${@:-3306}"
if healthcheck_port $process $args; then
exit 0
else
ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
echo "Did not find $process process running and connected to MySQL via ports ($ports) in the container."
exit 1
fi