Merge "Add healthcheck for ODL container" into stable/pike

This commit is contained in:
Jenkins 2017-09-26 10:26:18 +00:00 committed by Gerrit Code Review
commit f535225fb7
2 changed files with 18 additions and 0 deletions

View File

@ -335,6 +335,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 Executable file
View 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