+DISPATCH="/home/opnfv/bottlenecks/monitor/dispatch"
+OPENSTACK_ENV=${MONITOR_CONFIG}/openstack_exporter.conf
+
+usage="Script to run the tests in Bottlenecks.
+
+usage:
+ bash $(basename "$0") [-h|--help] [-i|--installer <installer typer>] [-o|--openstack-env <openstack env>]
+
+where:
+ -h|--help show the help text
+ -i|--installer specify the installer for the system to be monitored
+ <installer type>
+ one of the following:
+ (apex, compass)
+ -o|--opentack-env specify the openstack env file for openstack monitoring
+ defalt value is \"${MONITOR_CONFIG}/openstack_exporter.conf\"
+
+examples:
+ $(basename "$0") -i compass"
+
+
+info () {
+ logger -s -t "BOTTLENECKS INFO" "$*"
+}
+
+error () {
+ logger -s -t "BOTTLENECKS ERROR" "$*"
+ exit 1
+}
+
+# Process input variables
+while [[ $# > 0 ]]
+ do
+ key="$1"
+ case $key in
+ -h|--help)
+ echo "$usage"
+ exit 0
+ shift
+ ;;
+ -i|--installer)
+ INSTALLER_TYPE="$2"
+ shift
+ ;;
+ -o|--openstack-env)
+ OPENSTACK_ENV="$2"
+ shift
+ ;;
+ *)
+ error "unkown input options $1 $2"
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+
+barometer_client_install_sh="/home/opnfv/bottlenecks/monitor/dispatch/install_barometer_client.sh"
+barometer_client_install_conf="/home/opnfv/bottlenecks/monitor/config/barometer_client.conf"
+
+cadvisor_client_install_sh="/home/opnfv/bottlenecks/monitor/dispatch/install_cadvisor_client.sh"
+
+collectd_client_install_sh="/home/opnfv/bottlenecks/monitor/dispatch/install_collectd_client.sh"
+collectd_client_install_conf="/home/opnfv/bottlenecks/monitor/config/collectd_client.conf"
+
+# INSTALL GRAFANA + PROMETHEUS + CADVISOR + BAROMETER on the JUMPERSERVER
+# # Node-Exporter
+echo == installation of monitoring module is started ==
+
+# # Collectd
+# # Configure IP Address in collectd server configuration
+# python ${DISPATCH}/server_ip_configure.py ${MONITOR_CONFIG}/collectd_server.conf
+# sudo docker run --name bottlenecks-collectd -d \
+# --privileged \
+# -v ${MONITOR_CONFIG}/collectd_server.conf:/etc/collectd/collectd.conf:ro \
+# -v /proc:/mnt/proc:ro \
+# fr3nd/collectd:5.5.0-1
+
+set +e
+# Prometheus
+sudo docker run --name bottlenecks-prometheus \
+ -d -p 9090:9090 \
+ -v ${MONITOR_CONFIG}/prometheus.yaml:/etc/prometheus/prometheus.yml \
+ prom/prometheus:v1.7.1
+
+# Collectd-Exporter
+sudo docker run --name bottlenecks-collectd-exporter \
+ -d -p 9103:9103 -p 25826:25826/udp \
+ prom/collectd-exporter:0.3.1 \
+ -collectd.listen-address=":25826"