From 41a09f3b675b3fa7ead1325cef2f04a2e1fa3bcd Mon Sep 17 00:00:00 2001 From: Amnon Heiman Date: Sat, 19 Sep 2015 01:07:03 +0300 Subject: [PATCH] scripts: A startup script for the JMX proxy The startup scripts helps in running the JMX proxy, wrap the java command with help and default values. Signed-off-by: Amnon Heiman Signed-off-by: Pekka Enberg --- scripts/scylla-jmx | 65 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 scripts/scylla-jmx diff --git a/scripts/scylla-jmx b/scripts/scylla-jmx new file mode 100755 index 0000000..be66cf3 --- /dev/null +++ b/scripts/scylla-jmx @@ -0,0 +1,65 @@ +#!/bin/sh +# +# Copyright (C) 2015 Cloudius Systems, Ltd. + +JMX_PORT=7199 +API_ADDR="127.0.0.1" +API_PORT="10000" +PARAM_HELP="-h" +PARAM_JMX_PORT="-jp" +PARAM_API_PORT="-p" +PARAM_ADDR="-a" +PARAM_LOCATION="-l" +LOCATION="target" + +print_help() { + cat < - The jmx port to open + $PARAM_API_PORT - The API port to connect to + $PARAM_ADDR
- The API address to connect to + $PARAM_LOCATION - The location of the jmx proxy jar file +HLPEND +} + +while test "$#" -ne 0 +do + case "$1" in + "$PARAM_API_PORT") + API_PORT=$2 + shift 2 + ;; + "$PARAM_ADDR") + API_ADDR=$2 + shift 2 + ;; + "$PARAM_PORT") + API_ADDR=$2 + shift 2 + ;; + "$PARAM_JMX_PORT") + JMX_PORT=$2 + shift 2 + ;; + "$PARAM_LOCATION") + LOCATION=$2 + shift 2 + ;; + "$PARAM_HELP") + print_help + exit 0 + ;; + *) + esac +done + +java -Dapiaddress=$API_ADDR -Dapiport=$API_PORT -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$JMX_PORT -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar $LOCATION/urchin-mbean-1.0.jar