Fix formatting options

Fix tabs<->spaces and other bashate complains
	Change mode to +x to scripts missing it
	Force shell to be /bin/bash for compatibility

Change-Id: Ied5979f2d886c15b273956a9828d9e0484368bab
Signed-off-by: Pablo Iranzo Gómez <Pablo.Iranzo@gmail.com>
This commit is contained in:
Pablo Iranzo Gómez
2018-08-30 00:26:49 +02:00
parent fc1f301f26
commit 37a5c78673
73 changed files with 290 additions and 289 deletions

View File

@@ -1,7 +1,7 @@
# Health check commands # Health check commands
The scripts in this directory are meant to implement the The scripts in this directory are meant to implement the
[container-healthcheck][] blueprint. They are written to be compatible [container-healthcheck][] blueprint. They are written to be compatible
with the Docker [HEALTHCHECK][] api. with the Docker [HEALTHCHECK][] api.
[container-healthcheck]: https://blueprints.launchpad.net/tripleo/+spec/container-healthchecks [container-healthcheck]: https://blueprints.launchpad.net/tripleo/+spec/container-healthchecks
@@ -12,7 +12,7 @@ The scripts expect to source
want to run scripts without installing to that file, you can set the want to run scripts without installing to that file, you can set the
`HEALTHCHECKS_DIR` environment variable, e.g: `HEALTHCHECKS_DIR` environment variable, e.g:
$ export HEALTHCHECKS_DIR=$PWD $ export HEALTHCHECKS_DIR=$PWD
$ ./heat-api $ ./heat-api
{"versions": [{"status": "CURRENT", "id": "v1.0", "links": [{"href": "http://192.168.24.1:8004/v1/", "rel": "self"}]}]} {"versions": [{"status": "CURRENT", "id": "v1.0", "links": [{"href": "http://192.168.24.1:8004/v1/", "rel": "self"}]}]}
300 192.168.24.1:8004 0.002 seconds 300 192.168.24.1:8004 0.002 seconds

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -6,9 +6,9 @@ process='aodh-evaluator'
args="${@:-6379}" args="${@:-6379}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened Redis ports ($ports) running in the container" echo "There is no $process process with opened Redis ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='aodh-listener'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='aodh-notifier'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -6,9 +6,9 @@ process='barbican-keystone-listener'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='barbican-worker'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='ceilometer-polling'
args="${@:-6379}" args="${@:-6379}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened Redis ports ($ports) running in the container" echo "There is no $process process with opened Redis ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='ceilometer-polling'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='ceilometer-polling'
args="${@:-6379}" args="${@:-6379}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened Redis ports ($ports) running in the container" echo "There is no $process process with opened Redis ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='ceilometer-agent-notification'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -6,9 +6,9 @@ process='cinder-backup'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='cinder-scheduler'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='cinder-volume'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

97
healthcheck/common.sh Normal file → Executable file
View File

@@ -1,55 +1,56 @@
#!/bin/bash
: ${HEALTHCHECK_CURL_MAX_TIME:=10} : ${HEALTHCHECK_CURL_MAX_TIME:=10}
: ${HEALTHCHECK_CURL_USER_AGENT:=curl-healthcheck} : ${HEALTHCHECK_CURL_USER_AGENT:=curl-healthcheck}
: ${HEALTHCHECK_CURL_WRITE_OUT:='\n%{http_code} %{remote_ip}:%{remote_port} %{time_total} seconds\n'} : ${HEALTHCHECK_CURL_WRITE_OUT:='\n%{http_code} %{remote_ip}:%{remote_port} %{time_total} seconds\n'}
healthcheck_curl () { healthcheck_curl () {
curl -g -k -q --fail \ curl -g -k -q --fail \
--max-time "${HEALTHCHECK_CURL_MAX_TIME}" \ --max-time "${HEALTHCHECK_CURL_MAX_TIME}" \
--user-agent "${HEALTHCHECK_CURL_USER_AGENT}" \ --user-agent "${HEALTHCHECK_CURL_USER_AGENT}" \
--write-out "${HEALTHCHECK_CURL_WRITE_OUT}" \ --write-out "${HEALTHCHECK_CURL_WRITE_OUT}" \
"$@" || return 1 "$@" || return 1
} }
healthcheck_port () { healthcheck_port () {
process=$1 process=$1
# ss truncate command name to 15 characters and this behaviour # ss truncate command name to 15 characters and this behaviour
# cannot be disabled # cannot be disabled
if [ ${#process} -gt 15 ] ; then if [ ${#process} -gt 15 ] ; then
process=${process:0:15} process=${process:0:15}
fi fi
shift 1 shift 1
args=$@ args=$@
ports=${args// /|} ports=${args// /|}
ss -ntp | awk '{print $5,"-",$6}' | egrep ":($ports)" | grep "$process" ss -ntp | awk '{print $5,"-",$6}' | egrep ":($ports)" | grep "$process"
} }
healthcheck_listen () { healthcheck_listen () {
process=$1 process=$1
# ss truncate command name to 15 characters and this behaviour # ss truncate command name to 15 characters and this behaviour
# cannot be disabled # cannot be disabled
if [ ${#process} -gt 15 ] ; then if [ ${#process} -gt 15 ] ; then
process=${process:0:15} process=${process:0:15}
fi fi
shift 1 shift 1
args=$@ args=$@
ports=${args// /|} ports=${args// /|}
ss -lnp | awk '{print $5,"-",$7}' | egrep ":($ports)" | grep "$process" ss -lnp | awk '{print $5,"-",$7}' | egrep ":($ports)" | grep "$process"
} }
healthcheck_socket () { healthcheck_socket () {
process=$1 process=$1
socket=$2 socket=$2
# lsof truncate command name to 15 characters and this behaviour # lsof truncate command name to 15 characters and this behaviour
# cannot be disabled # cannot be disabled
if [ ${#process} -gt 15 ] ; then if [ ${#process} -gt 15 ] ; then
process=${process:0:15} process=${process:0:15}
fi fi
lsof -Fc -Ua $socket | grep "c$process" lsof -Fc -Ua $socket | grep "c$process"
} }
healthcheck_file_modification () { healthcheck_file_modification () {
@@ -60,27 +61,27 @@ healthcheck_file_modification () {
last_mod=$(stat -c '%Y' $file_path) last_mod=$(stat -c '%Y' $file_path)
limit_epoch=$(( curr_time-limit_seconds )) limit_epoch=$(( curr_time-limit_seconds ))
if [ "$limit_epoch" -gt "$last_mod" ]; then if [ "$limit_epoch" -gt "$last_mod" ]; then
return 1 return 1
fi fi
} }
get_config_val () { get_config_val () {
crudini --get "$1" "$2" "$3" 2> /dev/null || echo "$4" crudini --get "$1" "$2" "$3" 2> /dev/null || echo "$4"
} }
# apachectl -S is slightly harder to parse and doesn't say if the vhost is serving SSL # apachectl -S is slightly harder to parse and doesn't say if the vhost is serving SSL
get_url_from_vhost () { get_url_from_vhost () {
vhost_file=$1 vhost_file=$1
server_name=$(awk '/ServerName/ {print $2}' $vhost_file) server_name=$(awk '/ServerName/ {print $2}' $vhost_file)
ssl_enabled=$(awk '/SSLEngine/ {print $2}' $vhost_file) ssl_enabled=$(awk '/SSLEngine/ {print $2}' $vhost_file)
bind_port=$(grep -h "<VirtualHost .*>" $vhost_file | sed 's/<VirtualHost .*:\(.*\)>/\1/') bind_port=$(grep -h "<VirtualHost .*>" $vhost_file | sed 's/<VirtualHost .*:\(.*\)>/\1/')
wsgi_alias=$(awk '/WSGIScriptAlias/ {print $2}' $vhost_file) wsgi_alias=$(awk '/WSGIScriptAlias/ {print $2}' $vhost_file)
proto=http proto=http
if [[ $ssl_enabled == "on" ]]; then if [[ $ssl_enabled == "on" ]]; then
proto=https proto=https
fi fi
if [[ $wsgi_alias != "/" ]]; then if [[ $wsgi_alias != "/" ]]; then
wsgi_alias="${wsgi_alias}/" wsgi_alias="${wsgi_alias}/"
fi fi
echo ${proto}://${server_name}:${bind_port}${wsgi_alias} echo ${proto}://${server_name}:${bind_port}${wsgi_alias}
} }

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
@@ -6,7 +6,7 @@ bind_host=$(get_config_val /etc/glance/glance-api.conf DEFAULT bind_host 127.0.0
bind_port=$(get_config_val /etc/glance/glance-api.conf DEFAULT bind_port 9292) bind_port=$(get_config_val /etc/glance/glance-api.conf DEFAULT bind_port 9292)
# Add brackets if IPv6 # Add brackets if IPv6
if [[ $bind_host =~ ":" ]]; then if [[ $bind_host =~ ":" ]]; then
bind_host="[${bind_host}]" bind_host="[${bind_host}]"
fi fi
# glance-api is still eventlet # glance-api is still eventlet
healthcheck_curl http://${bind_host}:${bind_port}/ healthcheck_curl http://${bind_host}:${bind_port}/

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -6,9 +6,9 @@ process='gnocchi-metricd'
args="${@:-6379}" args="${@:-6379}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened Redis ports ($ports) running in the container" echo "There is no $process process with opened Redis ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,6 +6,6 @@ process='gnocchi-statsd'
bind_port=$(get_config_val /etc/gnocchi/gnocchi.conf statsd port 8125) bind_port=$(get_config_val /etc/gnocchi/gnocchi.conf statsd port 8125)
if ! healthcheck_listen $process $bind_port; then if ! healthcheck_listen $process $bind_port; then
echo "There is no $process process listening on ports $bind_port in the container." echo "There is no $process process listening on ports $bind_port in the container."
exit 1 exit 1
fi fi

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -6,9 +6,9 @@ process='heat-engine'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -1,10 +1,10 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
check_url=$(get_url_from_vhost /etc/httpd/conf.d/10-horizon_vhost.conf) check_url=$(get_url_from_vhost /etc/httpd/conf.d/10-horizon_vhost.conf)
if healthcheck_curl ${check_url}; then if healthcheck_curl ${check_url}; then
exit 0 exit 0
else else
healthcheck_curl $(get_url_from_vhost /etc/httpd/conf.d/10-horizon_ssl_vhost.conf) healthcheck_curl $(get_url_from_vhost /etc/httpd/conf.d/10-horizon_ssl_vhost.conf)
fi fi

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -6,9 +6,9 @@ process='ironic-conductor'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -1,16 +1,16 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
if grep "/httpd " /run_command ; then if grep "/httpd " /run_command ; then
bind_host=127.0.0.1 bind_host=127.0.0.1
bind_port=$(grep "^Listen " /etc/httpd/conf.d/10-ipxe_vhost.conf | awk '{print $2}') bind_port=$(grep "^Listen " /etc/httpd/conf.d/10-ipxe_vhost.conf | awk '{print $2}')
protocol=http protocol=http
path= path=
else else
bind_host=$(ps -ef | grep -oe '--address \([0-9]\+\.\?\)\+' | awk '{print $2}') bind_host=$(ps -ef | grep -oe '--address \([0-9]\+\.\?\)\+' | awk '{print $2}')
bind_port=69 bind_port=69
protocol=tftp protocol=tftp
path=map-file path=map-file
fi fi
healthcheck_curl ${protocol}://${bind_host}:${bind_port}/${path} healthcheck_curl ${protocol}://${bind_host}:${bind_port}/${path}

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -6,9 +6,9 @@ process='manila-scheduler'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
GALERA_XINETD_CONF='/etc/xinetd.d/galera-monitor' GALERA_XINETD_CONF='/etc/xinetd.d/galera-monitor'
@@ -6,11 +6,11 @@ GALERA_XINETD_CONF='/etc/xinetd.d/galera-monitor'
# If the mariadb container is running xinetd with galera-monitor then it is a # If the mariadb container is running xinetd with galera-monitor then it is a
# clustercheck container, otherwise a mysql/mariadb one # clustercheck container, otherwise a mysql/mariadb one
if pgrep xinetd &> /dev/null && grep -qe 'disable.*no' $GALERA_XINETD_CONF; then if pgrep xinetd &> /dev/null && grep -qe 'disable.*no' $GALERA_XINETD_CONF; then
PORT=$(awk '/port.*=/{ print $3 }' $GALERA_XINETD_CONF) PORT=$(awk '/port.*=/{ print $3 }' $GALERA_XINETD_CONF)
ADDR=$(awk '/bind.*=/{ print $3 }' $GALERA_XINETD_CONF) ADDR=$(awk '/bind.*=/{ print $3 }' $GALERA_XINETD_CONF)
bind_host=${ADDR:-$(hostname)} bind_host=${ADDR:-$(hostname)}
bind_port=${PORT:-9200} bind_port=${PORT:-9200}
healthcheck_curl http://${bind_host}:${bind_port}/ healthcheck_curl http://${bind_host}:${bind_port}/
else else
mysql -e 'select 1' || exit 1 mysql -e 'select 1' || exit 1
fi fi

View File

@@ -4,7 +4,7 @@ listen_addr=$(awk 'match($0, /-l +([0-9a-fA-F\.\:]+) /, a) {print a[1]}' /etc/sy
# Add brackets if IPv6 # Add brackets if IPv6
if [[ $listen_addr =~ ":" ]]; then if [[ $listen_addr =~ ":" ]]; then
listen_addr="[${listen_addr}]" listen_addr="[${listen_addr}]"
fi fi
echo "stats" | socat - TCP:$listen_addr:11211 echo "stats" | socat - TCP:$listen_addr:11211

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -6,9 +6,9 @@ process='mistral-server'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='mistral-server'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='mistral-server'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
@@ -7,7 +7,7 @@ bind_port=$(get_config_val /etc/neutron/neutron.conf DEFAULT bind_port 9696)
# Add brackets if IPv6 # Add brackets if IPv6
if [[ $bind_host =~ ":" ]]; then if [[ $bind_host =~ ":" ]]; then
bind_host="[${bind_host}]" bind_host="[${bind_host}]"
fi fi
healthcheck_curl http://${bind_host}:${bind_port}/ healthcheck_curl http://${bind_host}:${bind_port}/

View File

@@ -6,9 +6,9 @@ process='neutron-dhcp-agent'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='neutron-l3-agent'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='neutron-metadata-agent'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='neutron-openvswitch-agent'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='neutron-sriov-nic-agent'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process connected via RabbitMQ ports ($ports) running in the container" echo "There is no $process process connected via RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -1,14 +1,14 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
if ps -e | grep --quiet nova-api-metada; then if ps -e | grep --quiet nova-api-metada; then
bind_host=$(get_config_val /etc/nova/nova.conf DEFAULT metadata_listen 127.0.0.1) bind_host=$(get_config_val /etc/nova/nova.conf DEFAULT metadata_listen 127.0.0.1)
bind_port=$(get_config_val /etc/nova/nova.conf DEFAULT metadata_listen_port 8775) bind_port=$(get_config_val /etc/nova/nova.conf DEFAULT metadata_listen_port 8775)
check_url="http://${bind_host}:${bind_port}/" check_url="http://${bind_host}:${bind_port}/"
else else
check_url=$(get_url_from_vhost /etc/httpd/conf.d/10-nova_api_wsgi.conf) check_url=$(get_url_from_vhost /etc/httpd/conf.d/10-nova_api_wsgi.conf)
fi fi
healthcheck_curl ${check_url} healthcheck_curl ${check_url}

View File

@@ -3,20 +3,20 @@
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
if ps -e | grep nova-compute; then if ps -e | grep nova-compute; then
process='nova-compute' process='nova-compute'
args="${@:-5671 5672}" args="${@:-5671 5672}"
test_func='healthcheck_port' test_func='healthcheck_port'
err_msg="There is no $process process with opened RabbitMQ ports (${args// /,}) running in the container" err_msg="There is no $process process with opened RabbitMQ ports (${args// /,}) running in the container"
else else
process='sshd' process='sshd'
args="${@:-2022}" args="${@:-2022}"
test_func='healthcheck_listen' test_func='healthcheck_listen'
err_msg="There is no $process process listening on port(s) ${args// /,} in the container" err_msg="There is no $process process listening on port(s) ${args// /,} in the container"
fi fi
if $test_func $process $args; then if $test_func $process $args; then
exit 0 exit 0
else else
echo $err_msg echo $err_msg
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='nova-conductor'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='nova-consoleauth'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='nova-compute'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -1,3 +1,3 @@
#!/bin/sh #!/bin/bash
virsh version --daemon virsh version --daemon

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -6,9 +6,9 @@ process='nova-scheduler'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -9,7 +9,7 @@ proto_is_ssl=$(get_config_val /etc/nova/nova.conf DEFAULT ssl_only false)
bind_proto=http bind_proto=http
if [ "${proto_is_ssl,,}" = true ] ; then if [ "${proto_is_ssl,,}" = true ] ; then
bind_proto=https bind_proto=https
fi fi
healthcheck_curl ${bind_proto}://${bind_host}:${bind_port}/ healthcheck_curl ${bind_proto}://${bind_host}:${bind_port}/

View File

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

View File

@@ -6,9 +6,9 @@ process='octavia-health-manager'
args="${@:-5555}" args="${@:-5555}"
if healthcheck_listen $process $args; then if healthcheck_listen $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process listening on ports $ports." echo "There is no $process process listening on ports $ports."
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='octavia-housekeeping'
args="${@:-3306}" args="${@:-3306}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "Did not find $process process running and connected to MySQL via ports ($ports) in the container." echo "Did not find $process process running and connected to MySQL via ports ($ports) in the container."
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='octavia-worker'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ file=/opt/opendaylight/etc/org.ops4j.pax.web.cfg
bind_host=$(awk -F "= *" '/^org.ops4j.pax.web.listening.addresses/ {print $2}' $file) bind_host=$(awk -F "= *" '/^org.ops4j.pax.web.listening.addresses/ {print $2}' $file)
tls_enabled=$(awk -F "= *" '/^org.osgi.service.http.secure.enabled/ {print $2}' $file) tls_enabled=$(awk -F "= *" '/^org.osgi.service.http.secure.enabled/ {print $2}' $file)
if [[ -z "$tls_enabled" || "$tls_enabled" != "true" ]]; then if [[ -z "$tls_enabled" || "$tls_enabled" != "true" ]]; then
bind_port=$(awk -F "= *" '/^org.osgi.service.http.port\s*=/ {print $2}' $file) bind_port=$(awk -F "= *" '/^org.osgi.service.http.port\s*=/ {print $2}' $file)
else else
bind_port=$(awk -F "= *" '/^org.osgi.service.http.port.secure/ {print $2}' $file) bind_port=$(awk -F "= *" '/^org.osgi.service.http.port.secure/ {print $2}' $file)
fi fi
healthcheck_curl http://$bind_host:$bind_port/diagstatus healthcheck_curl http://$bind_host:$bind_port/diagstatus

8
healthcheck/ovn-controller Normal file → Executable file
View File

@@ -6,9 +6,9 @@ process='ovn-controller'
args="${@:-6642}" args="${@:-6642}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process connected to ovsdb ports $ports running in the container" echo "There is no $process process connected to ovsdb ports $ports running in the container"
exit 1 exit 1
fi fi

8
healthcheck/ovn-dbs Normal file → Executable file
View File

@@ -6,8 +6,8 @@ process='ovn-northd'
sockets="${@:-/run/openvswitch/ovnnb_db.sock /run/openvswitch/ovnsb_db.sock}" sockets="${@:-/run/openvswitch/ovnnb_db.sock /run/openvswitch/ovnsb_db.sock}"
for sock in sockets; do for sock in sockets; do
if ! healthcheck_socket $process $sock; then if ! healthcheck_socket $process $sock; then
echo "There is no $process process connected to socket $sock running in the container" echo "There is no $process process connected to socket $sock running in the container"
exit 1 exit 1
fi fi
done done

View File

@@ -6,9 +6,9 @@ process='networking-ovn-metadata-agent'
args="${@:-6642}" args="${@:-6642}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process connected to ovsdb ports $ports running in the container" echo "There is no $process process connected to ovsdb ports $ports running in the container"
exit 1 exit 1
fi fi

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

View File

@@ -1,3 +1,3 @@
#!/bin/sh #!/bin/bash
rabbitmqctl node_health_check || exit 1 rabbitmqctl node_health_check || exit 1

View File

@@ -1,27 +1,27 @@
#!/bin/bash #!/bin/bash
if parse_out=$(cat "/etc/redis.conf" | egrep "^bind +.*$"); then if parse_out=$(cat "/etc/redis.conf" | egrep "^bind +.*$"); then
redis_host=$(echo -n $parse_out | awk '{print $2}') redis_host=$(echo -n $parse_out | awk '{print $2}')
else else
redis_host=127.0.0.1 redis_host=127.0.0.1
fi fi
if parse_out=$(cat "/etc/redis.conf" | egrep "^port +.*$"); then if parse_out=$(cat "/etc/redis.conf" | egrep "^port +.*$"); then
redis_port=$(echo -n $parse_out | awk '{print $2}') redis_port=$(echo -n $parse_out | awk '{print $2}')
else else
redis_port=6379 redis_port=6379
fi fi
if parse_out=$(cat "/etc/redis.conf" | egrep "^requirepass +.*$"); then if parse_out=$(cat "/etc/redis.conf" | egrep "^requirepass +.*$"); then
redis_pass=$(echo -n $parse_out | awk '{print $2}') redis_pass=$(echo -n $parse_out | awk '{print $2}')
result=$(printf "*2\r\n\$4\r\nAUTH\r\n\$${#redis_pass}\r\n${redis_pass}\r\n*1\r\n\$4\r\nPING\r\n" | socat - TCP:$redis_host:$redis_port) result=$(printf "*2\r\n\$4\r\nAUTH\r\n\$${#redis_pass}\r\n${redis_pass}\r\n*1\r\n\$4\r\nPING\r\n" | socat - TCP:$redis_host:$redis_port)
else else
result=$(printf "*1\r\n\$4\r\nPING\r\n" | socat - TCP:$redis_host:$redis_port) result=$(printf "*1\r\n\$4\r\nPING\r\n" | socat - TCP:$redis_host:$redis_port)
fi fi
if echo $result | grep -q '+PONG'; then if echo $result | grep -q '+PONG'; then
echo "Redis server responded correctly on ${redis_host}:${redis_port}." echo "Redis server responded correctly on ${redis_host}:${redis_port}."
else else
echo "Redis server does not respond correctly: ${result}" echo "Redis server does not respond correctly: ${result}"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='sahara-engine'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -6,9 +6,9 @@ process='sensu-client'
args="${@:-5671 5672}" args="${@:-5671 5672}"
if healthcheck_port $process $args; then if healthcheck_port $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container" echo "There is no $process process with opened RabbitMQ ports ($ports) running in the container"
exit 1 exit 1
fi fi

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
@@ -16,7 +16,7 @@ if ps -e | grep --quiet swift-account-server; then
bind_port=$(get_config_val $conf DEFAULT bind_port 6002) bind_port=$(get_config_val $conf DEFAULT bind_port 6002)
# Add brackets if IPv6 # Add brackets if IPv6
if [[ $bind_host =~ ":" ]]; then if [[ $bind_host =~ ":" ]]; then
bind_host="[${bind_host}]" bind_host="[${bind_host}]"
fi fi
healthcheck_curl http://${bind_host}:${bind_port}/healthcheck healthcheck_curl http://${bind_host}:${bind_port}/healthcheck
else else

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
@@ -16,7 +16,7 @@ if ps -e | grep --quiet swift-container-server; then
bind_port=$(get_config_val $conf DEFAULT bind_port 6001) bind_port=$(get_config_val $conf DEFAULT bind_port 6001)
# Add brackets if IPv6 # Add brackets if IPv6
if [[ $bind_host =~ ":" ]]; then if [[ $bind_host =~ ":" ]]; then
bind_host="[${bind_host}]" bind_host="[${bind_host}]"
fi fi
healthcheck_curl http://${bind_host}:${bind_port}/healthcheck healthcheck_curl http://${bind_host}:${bind_port}/healthcheck
else else

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
@@ -16,7 +16,7 @@ if ps -e | grep --quiet swift-object-server; then
bind_port=$(get_config_val $conf DEFAULT bind_port 6000) bind_port=$(get_config_val $conf DEFAULT bind_port 6000)
# Add brackets if IPv6 # Add brackets if IPv6
if [[ $bind_host =~ ":" ]]; then if [[ $bind_host =~ ":" ]]; then
bind_host="[${bind_host}]" bind_host="[${bind_host}]"
fi fi
healthcheck_curl http://${bind_host}:${bind_port}/healthcheck healthcheck_curl http://${bind_host}:${bind_port}/healthcheck
elif ps -e | grep --quiet rsync; then elif ps -e | grep --quiet rsync; then
@@ -24,9 +24,9 @@ elif ps -e | grep --quiet rsync; then
args="${@:-873}" args="${@:-873}"
if ! healthcheck_listen $process $args; then if ! healthcheck_listen $process $args; then
ports=${args// /,} ports=${args// /,}
echo "There is no $process process, listening on port(s) $ports, running in the container." echo "There is no $process process, listening on port(s) $ports, running in the container."
exit 1 exit 1
fi fi
else else
if ps -e | grep --quiet swift-account-auditor; then if ps -e | grep --quiet swift-account-auditor; then

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
@@ -6,8 +6,8 @@ if ps -e | grep --quiet swift-proxy-server; then
conf=/etc/swift/proxy-server.conf conf=/etc/swift/proxy-server.conf
if ! crudini --get $conf pipeline:main pipeline | grep -q healthcheck; then if ! crudini --get $conf pipeline:main pipeline | grep -q healthcheck; then
echo "healthcheck is not available" >&2 echo "healthcheck is not available" >&2
exit 0 exit 0
fi fi
# swift-proxy is still eventlet # swift-proxy is still eventlet
@@ -15,7 +15,7 @@ if ps -e | grep --quiet swift-proxy-server; then
bind_port=$(get_config_val $conf DEFAULT bind_port 8080) bind_port=$(get_config_val $conf DEFAULT bind_port 8080)
# Add brackets if IPv6 # Add brackets if IPv6
if [[ $bind_host =~ ":" ]]; then if [[ $bind_host =~ ":" ]]; then
bind_host="[${bind_host}]" bind_host="[${bind_host}]"
fi fi
healthcheck_curl http://${bind_host}:${bind_port}/healthcheck healthcheck_curl http://${bind_host}:${bind_port}/healthcheck
else else

View File

@@ -6,9 +6,9 @@ process='rsync'
args="${@:-873}" args="${@:-873}"
if healthcheck_listen $process $args; then if healthcheck_listen $process $args; then
exit 0 exit 0
else else
ports=${args// /,} ports=${args// /,}
echo "There is no $process process, listening on port(s) $ports, running in the container." echo "There is no $process process, listening on port(s) $ports, running in the container."
exit 1 exit 1
fi fi

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh . ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
@@ -6,7 +6,7 @@ bind_host=$(get_config_val /etc/tacker/tacker.conf DEFAULT bind_host 127.0.0.1)
bind_port=$(get_config_val /etc/tacker/tacker.conf DEFAULT bind_port 9890) bind_port=$(get_config_val /etc/tacker/tacker.conf DEFAULT bind_port 9890)
# Add brackets if IPv6 # Add brackets if IPv6
if [[ $bind_host =~ ":" ]]; then if [[ $bind_host =~ ":" ]]; then
bind_host="[${bind_host}]" bind_host="[${bind_host}]"
fi fi
healthcheck_curl http://${bind_host}:${bind_port}/ healthcheck_curl http://${bind_host}:${bind_port}/