From 4f5a275086a6fab538a69bfdb74e002489d7e599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= Date: Wed, 24 Apr 2019 17:58:01 +0200 Subject: [PATCH] Add new healthchecks for zaqar services Zaqar has 2 containers, one for API (wsgi) and a second one for websocket (python). We therefore want to ensure the ports are in use in the containers. Change-Id: I0d5ea0ba630714f7ec3ca4f1361e3235320e52d7 --- healthcheck/zaqar-api | 6 ++++++ healthcheck/zaqar-socket | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100755 healthcheck/zaqar-api create mode 100755 healthcheck/zaqar-socket diff --git a/healthcheck/zaqar-api b/healthcheck/zaqar-api new file mode 100755 index 000000000..4b7d8aa89 --- /dev/null +++ b/healthcheck/zaqar-api @@ -0,0 +1,6 @@ +#!/bin/bash + +. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh + +check_url=$(get_url_from_vhost /etc/httpd/conf.d/10-zaqar_wsgi.conf) +healthcheck_curl ${check_url} diff --git a/healthcheck/zaqar-socket b/healthcheck/zaqar-socket new file mode 100755 index 000000000..b8ed1ca0f --- /dev/null +++ b/healthcheck/zaqar-socket @@ -0,0 +1,15 @@ +#!/bin/bash + +. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh + +process=zaqar-server +args="${@:-9000}" + +if healthcheck_listen $process $args; then + exit 0 +else + ports=${args// /,} + echo "There is no $process process, listening on port(s) $ports, running in the container." + exit 1 +fi +