Add healthcheck for ODL container
This patch adds healtcheck logic for ODL container. Change-Id: I75af8119f495e2eb1b617b9773dde7abb6ea1727 Closes-Bug: #1713632
This commit is contained in:
parent
b46a35a40e
commit
83eeb181f3
@ -326,6 +326,13 @@ RUN mkdir -p /openstack && \
|
||||
HEALTHCHECK CMD /openstack/healthcheck
|
||||
{% endblock %}
|
||||
|
||||
{% block opendaylight_footer %}
|
||||
RUN mkdir -p /openstack && \
|
||||
ln -s /usr/share/openstack-tripleo-common/healthcheck/opendaylight-api /openstack/healthcheck && \
|
||||
chmod -R a+rx /openstack
|
||||
HEALTHCHECK CMD /openstack/healthcheck
|
||||
{% endblock %}
|
||||
|
||||
{% block rabbitmq_footer %}
|
||||
RUN yum install -y pacemaker pacemaker-remote pcs libqb resource-agents && mkdir /etc/libqb
|
||||
|
||||
|
11
healthcheck/opendaylight-api
Normal file
11
healthcheck/opendaylight-api
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
|
||||
|
||||
username=$(get_config_val /opt/opendaylight/etc/org.jolokia.osgi.cfg DEFAULT org.jolokia.user admin)
|
||||
password=$(get_config_val /opt/opendaylight/etc/org.jolokia.osgi.cfg DEFAULT org.jolokia.password admin)
|
||||
bind_host=$(grep -r '<Set name="host">' "/opt/opendaylight/etc/jetty.xml" | awk -F'>' FNR==1'{print $2}')
|
||||
bind_port=$(grep -r '<Property name="jetty.port" default=' "/opt/opendaylight/etc/jetty.xml" | awk FNR==2'{print $3}' | cut -d'"' -f2)
|
||||
odl_check_url=restconf/operational/network-topology:network-topology/topology/netvirt:1
|
||||
|
||||
healthcheck_curl -u $username:$password http://$bind_host:$bind_port/$odl_check_url
|
Loading…
Reference in New Issue
Block a user