healthchecks: service checks for rabbit, swift-*, mysql

Change-Id: I219a01077f5ea3209cbb40b6f27fdbfa638386f7
Implements: blueprint container-healthchecks
This commit is contained in:
Lars Kellogg-Stedman 2017-07-14 17:02:27 -04:00 committed by Steve Baker
parent c072679220
commit ab44c4500f
6 changed files with 62 additions and 0 deletions

3
healthcheck/mariadb Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
mysql -e 'show databases' || exit 1

3
healthcheck/rabbitmq Executable file
View File

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

View File

@ -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

View File

@ -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

14
healthcheck/swift-object-server Executable file
View File

@ -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

14
healthcheck/swift-proxy Executable file
View File

@ -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