Browse code

BM-15288 Fix: add SDS check

Anthony Prades authored on 24/10/2019 12:44:12
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,28 @@
1
+#!/bin/bash
2
+
3
+JAVA_APP="net.bluemind.sds.proxy.launcher.sds-proxy"
4
+APP_NAME="BlueMind SDS proxy server"
5
+WORKSPACE=`dirname $0`
6
+
7
+source ${WORKSPACE}"/check.lib"
8
+
9
+function check_sds {
10
+    existrequest=$(curl --connect-timeout 30 --max-time 120 -X HEAD -o /dev/null -w "%{http_code}" --silent -d'{"mailbox":"check","partition":"check"}' http://localhost:8091/mailbox)
11
+    existrequestret=$?
12
+    if [ ${existrequestret} -ne 0 ]
13
+        then
14
+            echo "[ERROR] Could not connect to "${APP_NAME}
15
+            exit 2
16
+    fi
17
+
18
+    if [ ${existrequest} -ne 403 ]; then
19
+            echo "[ERROR] HTTP error code "${existrequest}" on "${APP_NAME}
20
+            exit 2
21
+    fi
22
+}
23
+
24
+check_hprof
25
+check_networkport "" 8091
26
+check_sds
27
+
28
+exit_ok