tripleo-common/healthcheck/opendaylight-api
Janki Chhatbar 83eeb181f3 Add healthcheck for ODL container
This patch adds healtcheck logic for ODL container.

Change-Id: I75af8119f495e2eb1b617b9773dde7abb6ea1727
Closes-Bug: #1713632
2017-09-20 12:02:16 +05:30

12 lines
718 B
Bash

#!/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