From 83eeb181f39d497b9367de437c9557a39f68164e Mon Sep 17 00:00:00 2001 From: Janki Chhatbar Date: Mon, 18 Sep 2017 12:50:47 +0530 Subject: [PATCH] Add healthcheck for ODL container This patch adds healtcheck logic for ODL container. Change-Id: I75af8119f495e2eb1b617b9773dde7abb6ea1727 Closes-Bug: #1713632 --- container-images/tripleo_kolla_template_overrides.j2 | 7 +++++++ healthcheck/opendaylight-api | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 healthcheck/opendaylight-api diff --git a/container-images/tripleo_kolla_template_overrides.j2 b/container-images/tripleo_kolla_template_overrides.j2 index 215e08538..4c806459c 100644 --- a/container-images/tripleo_kolla_template_overrides.j2 +++ b/container-images/tripleo_kolla_template_overrides.j2 @@ -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 diff --git a/healthcheck/opendaylight-api b/healthcheck/opendaylight-api new file mode 100644 index 000000000..72f510533 --- /dev/null +++ b/healthcheck/opendaylight-api @@ -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 '' "/opt/opendaylight/etc/jetty.xml" | awk -F'>' FNR==1'{print $2}') +bind_port=$(grep -r '