summaryrefslogtreecommitdiffstats
path: root/kubernetes/appc/resources/config
diff options
context:
space:
mode:
authorBorislav Glozman <Borislav.Glozman@amdocs.com>2018-06-27 10:42:45 +0000
committerGerrit Code Review <gerrit@onap.org>2018-06-27 10:42:45 +0000
commit56e950f4095f8b1be0705e3471d57dd21af06f5d (patch)
tree03e81c878f3d389b905863a2e7f136c933f081f8 /kubernetes/appc/resources/config
parent341e4bd2b7c0b936e984f2de06afbfeea612e945 (diff)
parent1d464b57ba669528f481ca5aec94720470223b73 (diff)
Merge "Create readiness health check for readiness probe"
Diffstat (limited to 'kubernetes/appc/resources/config')
-rwxr-xr-xkubernetes/appc/resources/config/appc/opt/onap/appc/bin/health_check.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/health_check.sh b/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/health_check.sh
new file mode 100755
index 0000000000..544358c1af
--- /dev/null
+++ b/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/health_check.sh
@@ -0,0 +1,15 @@
+#!/bin/bash -x
+
+startODL_status=$(ps -e | grep startODL | wc -l)
+waiting_bundles=$(/opt/opendaylight/current/bin/client bundle:list | grep Waiting | wc -l)
+run_level=$(/opt/opendaylight/current/bin/client system:start-level)
+
+ if [ "$run_level" == "Level 100" ] && [ "$startODL_status" -lt "1" ] && [ "$waiting_bundles" -lt "1" ]
+ then
+ echo APPC is healthy.
+ else
+ echo APPC is not healthy.
+ exit 1
+ fi
+
+exit 0