Adding a tool for remote collection of node and cluster diagnostics.
- Includes 'onos-diagnostics', 'onos-node-diagnostics'
- Includes REST API /onos/v1/diagnostics
Change-Id: Ife0a15627b14238d0fce52b01b72d56e6a1fe40f
(cherry picked from commit 15370d2a16fb9577a20103801611b004fcb56a6e)
diff --git a/tools/package/bin/onos-form-cluster b/tools/package/bin/onos-form-cluster
index 9286d0c..e677873 100755
--- a/tools/package/bin/onos-form-cluster
+++ b/tools/package/bin/onos-form-cluster
@@ -2,8 +2,9 @@
# -----------------------------------------------------------------------------
# Forms ONOS cluster using REST API of each separate instance.
# -----------------------------------------------------------------------------
-
-[ $# -lt 2 ] && echo "usage: $(basename $0) ip1 ip2..." && exit 1
+function usage() {
+ echo "usage: $(basename $0)[-x] [-u user] [-p password] [-s partitionSize] ip1 ip2..." && exit 1
+}
# Scan arguments for user/password or other options...
while getopts u:p:s: o; do
@@ -11,6 +12,7 @@
u) user=$OPTARG;;
p) password=$OPTARG;;
s) partitionsize=$OPTARG;;
+ *) usage;;
esac
done
ONOS_WEB_USER=${ONOS_WEB_USER:-onos} # ONOS WEB User defaults to 'onos'
@@ -20,6 +22,8 @@
let OPC=$OPTIND-1
shift $OPC
+[ $# -lt 2 ] && usage
+
ip=$1
shift
nodes=$*