VOL-3213 - (2) allow settings for onos and bbsim

- any values for onos and bbsim in *-values.yaml
- fix monitor.sh (bug)
- add bbsim index to ced script

Change-Id: I3b53ec546276fb57902d5fd475ce7fb44943e399
diff --git a/scripts/ced b/scripts/ced
index 1d85473..e1e1527 100755
--- a/scripts/ced
+++ b/scripts/ced
@@ -1,4 +1,12 @@
 #!/usr/bin/env bash
+REQ=$(test $# -gt 0 && echo $1 || echo 0)
+IDX=$((REQ + 1))
 set -x
-BBSIM=$(kubectl get --all-namespaces -l app=bbsim svc -o json | jq -r '.items[] | .metadata.name + "." + .metadata.namespace + ".svc:50060"' | head -1)
+BBSIM=$(kubectl get --all-namespaces -l app=bbsim svc -o json | jq -r '.items[] | .metadata.name + "." + .metadata.namespace + ".svc:50060"' | sed "$IDX!d")
+set +x
+if [[ -z "$BBSIM" ]]; then
+    >&2 echo "ERROR: No BBSIM instance found as index '$REQ'"
+    exit 1
+fi
+set -x
 exec voltctl device enable "$(voltctl device create -t openolt -H "$BBSIM")"
diff --git a/scripts/monitor.sh b/scripts/monitor.sh
index 4621941..b5952a2 100755
--- a/scripts/monitor.sh
+++ b/scripts/monitor.sh
@@ -67,7 +67,7 @@
 echo
 kubectl get --all-namespaces pods,svc,configmap | grep -v kube-system | cut -c -$__COLS
 echo
-kubectl  describe --all-namespaces  pods | grep Image: | grep '\(voltha\|bbsim\)' | sed -e "s/^ *//g" -e "s/: */: /g" | sort -u | cut -c -$COLS
+kubectl  describe --all-namespaces  pods | grep Image: | grep '\(voltha\|bbsim\)' | sed -e "s/^ *//g" -e "s/: */: /g" | sort -u | cut -c -$__COLS
 echo
 echo "DB SIZE: $("$SCRIPTPATH/etcd-db-size.sh")"
 echo