Add health check for services connected to RabbitMQ
- extended common lib with check for processes opening a specific ports - added health check scripts for services which require to be connected to RabbitMQ server Implements: blueprint container-healthchecks Change-Id: I039b4f2bc9826bece6c382ac07e8fb2495fae924
This commit is contained in:
parent
23468032b3
commit
b4327a4d3b
@ -16,4 +16,3 @@ want to run scripts without installing to that file, you can set the
|
||||
$ ./heat-api
|
||||
{"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
|
||||
|
||||
|
14
healthcheck/aodh-evaluator
Normal file
14
healthcheck/aodh-evaluator
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='aodh-evaluator'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/aodh-listener
Normal file
14
healthcheck/aodh-listener
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='aodh-listener'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/aodh-notifier
Normal file
14
healthcheck/aodh-notifier
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='aodh-notifier'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/ceilometer-agent-central
Normal file
14
healthcheck/ceilometer-agent-central
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='ceilometer-polling'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/ceilometer-agent-ipmi
Normal file
14
healthcheck/ceilometer-agent-ipmi
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='ceilometer-polling'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/ceilometer-agent-notification
Normal file
14
healthcheck/ceilometer-agent-notification
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='ceilometer-agent-notification'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/cinder-backup
Normal file
14
healthcheck/cinder-backup
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='cinder-backup'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/cinder-scheduler
Normal file
14
healthcheck/cinder-scheduler
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='cinder-scheduler'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/cinder-volume
Normal file
14
healthcheck/cinder-volume
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='cinder-volume'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
@ -10,6 +10,17 @@ healthcheck_curl () {
|
||||
"$@" || return 1
|
||||
}
|
||||
|
||||
healthcheck_port () {
|
||||
process=$1
|
||||
shift 1
|
||||
|
||||
port_args=()
|
||||
for arg in "$@"; do
|
||||
port_args+=("-i" "tcp:${arg}")
|
||||
done
|
||||
lsof +c0 -nP "${port_args[@]}" | awk '{print $1}' | grep -q "^${process}$"
|
||||
}
|
||||
|
||||
get_config_val () {
|
||||
crudini --get "$1" "$2" "$3" 2> /dev/null || echo "$4"
|
||||
}
|
||||
|
14
healthcheck/heat-engine
Normal file
14
healthcheck/heat-engine
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='heat-engine'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/ironic-conductor
Normal file
14
healthcheck/ironic-conductor
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='ironic-conductor'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/manila-scheduler
Normal file
14
healthcheck/manila-scheduler
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='manila-scheduler'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/mistral-engine
Normal file
14
healthcheck/mistral-engine
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='mistral-server'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/mistral-executor
Normal file
14
healthcheck/mistral-executor
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='mistral-server'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/neutron-dhcp
Normal file
14
healthcheck/neutron-dhcp
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='neutron-dhcp-agent'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/neutron-l3
Normal file
14
healthcheck/neutron-l3
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='neutron-l3-agent'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/neutron-metadata
Normal file
14
healthcheck/neutron-metadata
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='neutron-metadata-agent'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/neutron-ovs-agent
Normal file
14
healthcheck/neutron-ovs-agent
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='neutron-openvswitch-agent'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/nova-compute
Normal file
14
healthcheck/nova-compute
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='nova-compute'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/nova-conductor
Normal file
14
healthcheck/nova-conductor
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='nova-conductor'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/nova-consoleauth
Normal file
14
healthcheck/nova-consoleauth
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='nova-consoleauth'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/nova-ironic
Normal file
14
healthcheck/nova-ironic
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='nova-compute'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/nova-scheduler
Normal file
14
healthcheck/nova-scheduler
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='nova-scheduler'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/nova-vnc-proxy
Normal file
14
healthcheck/nova-vnc-proxy
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='nova-novncproxy'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/octavia-health-manager
Normal file
14
healthcheck/octavia-health-manager
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='octavia-health-manager'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/octavia-housekeeping
Normal file
14
healthcheck/octavia-housekeeping
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='octavia-housekeeping'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/octavia-worker
Normal file
14
healthcheck/octavia-worker
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='octavia-worker'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/sahara-engine
Normal file
14
healthcheck/sahara-engine
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='sahara-engine'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
14
healthcheck/sensu-client
Normal file
14
healthcheck/sensu-client
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/tripleo-common/healthcheck}/common.sh
|
||||
|
||||
process='sensu-client'
|
||||
args="${@:-5671 5672}"
|
||||
|
||||
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"
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in New Issue
Block a user