From ab44c4500fe7b876523d4d9456757519587d4a91 Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Fri, 14 Jul 2017 17:02:27 -0400 Subject: [PATCH] healthchecks: service checks for rabbit, swift-*, mysql Change-Id: I219a01077f5ea3209cbb40b6f27fdbfa638386f7 Implements: blueprint container-healthchecks --- healthcheck/mariadb | 3 +++ healthcheck/rabbitmq | 3 +++ healthcheck/swift-account-server | 14 ++++++++++++++ healthcheck/swift-container-server | 14 ++++++++++++++ healthcheck/swift-object-server | 14 ++++++++++++++ healthcheck/swift-proxy | 14 ++++++++++++++ 6 files changed, 62 insertions(+) create mode 100755 healthcheck/mariadb create mode 100755 healthcheck/rabbitmq create mode 100755 healthcheck/swift-account-server create mode 100755 healthcheck/swift-container-server create mode 100755 healthcheck/swift-object-server create mode 100755 healthcheck/swift-proxy diff --git a/healthcheck/mariadb b/healthcheck/mariadb new file mode 100755 index 000000000..2081ddc09 --- /dev/null +++ b/healthcheck/mariadb @@ -0,0 +1,3 @@ +#!/bin/sh + +mysql -e 'show databases' || exit 1 diff --git a/healthcheck/rabbitmq b/healthcheck/rabbitmq new file mode 100755 index 000000000..ea790df8f --- /dev/null +++ b/healthcheck/rabbitmq @@ -0,0 +1,3 @@ +#!/bin/sh + +rabbitmqctl node_health_check || exit 1 diff --git a/healthcheck/swift-account-server b/healthcheck/swift-account-server new file mode 100755 index 000000000..496f8754b --- /dev/null +++ b/healthcheck/swift-account-server @@ -0,0 +1,14 @@ +#!/bin/sh + +. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh + +conf=/etc/swift/account-server.conf + +if ! crudini --get $conf pipeline:main pipeline | grep -q healthcheck; then + echo "healthcheck is not available" >&2 + exit 0 +fi + +bind_host=$(get_config_val $conf DEFAULT bind_ip 127.0.0.1) +bind_port=$(get_config_val $conf DEFAULT bind_port 6002) +healthcheck_curl http://${bind_host}:${bind_port}/healthcheck diff --git a/healthcheck/swift-container-server b/healthcheck/swift-container-server new file mode 100755 index 000000000..63df1bd29 --- /dev/null +++ b/healthcheck/swift-container-server @@ -0,0 +1,14 @@ +#!/bin/sh + +. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh + +conf=/etc/swift/container-server.conf + +if ! crudini --get $conf pipeline:main pipeline | grep -q healthcheck; then + echo "healthcheck is not available" >&2 + exit 0 +fi + +bind_host=$(get_config_val $conf DEFAULT bind_ip 127.0.0.1) +bind_port=$(get_config_val $conf DEFAULT bind_port 6001) +healthcheck_curl http://${bind_host}:${bind_port}/healthcheck diff --git a/healthcheck/swift-object-server b/healthcheck/swift-object-server new file mode 100755 index 000000000..3c54dcfa9 --- /dev/null +++ b/healthcheck/swift-object-server @@ -0,0 +1,14 @@ +#!/bin/sh + +. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh + +conf=/etc/swift/object-server.conf + +if ! crudini --get $conf pipeline:main pipeline | grep -q healthcheck; then + echo "healthcheck is not available" >&2 + exit 0 +fi + +bind_host=$(get_config_val $conf DEFAULT bind_ip 127.0.0.1) +bind_port=$(get_config_val $conf DEFAULT bind_port 6000) +healthcheck_curl http://${bind_host}:${bind_port}/healthcheck diff --git a/healthcheck/swift-proxy b/healthcheck/swift-proxy new file mode 100755 index 000000000..bb5ef8066 --- /dev/null +++ b/healthcheck/swift-proxy @@ -0,0 +1,14 @@ +#!/bin/sh + +. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh + +conf=/etc/swift/proxy-server.conf + +if ! crudini --get $conf pipeline:main pipeline | grep -q healthcheck; then + echo "healthcheck is not available" >&2 + exit 0 +fi + +bind_host=$(get_config_val $conf DEFAULT bind_ip 127.0.0.1) +bind_port=$(get_config_val $conf DEFAULT bind_port 8080) +healthcheck_curl http://${bind_host}:${bind_port}/healthcheck