Restructure monitoring scripts 13/57013/1
authorYang Yu <Gabriel.yuyang@huawei.com>
Wed, 2 May 2018 08:52:11 +0000 (16:52 +0800)
committerYu Yang (Gabriel) <Gabriel.yuyang@huawei.com>
Thu, 3 May 2018 08:19:30 +0000 (08:19 +0000)
Restructure the monitoring scripts and modify the scripts to remove the
redundance

Change-Id: Ib4a5d7bea2dc455ec03ad61780b6caf06831daa8
Signed-off-by: Yang Yu <Gabriel.yuyang@huawei.com>
(cherry picked from commit cb67313c1e14b6eca057bdfc7722bc11506b7a2a)

26 files changed:
monitor/barometer_install_client.sh [deleted file]
monitor/barometer_install_script.sh [deleted file]
monitor/config/barometer_client.conf [moved from monitor/barometer_client.conf with 98% similarity]
monitor/config/barometer_server.conf [moved from monitor/barometer_collectd.conf with 98% similarity]
monitor/config/collectd_client.conf [moved from monitor/config/collectd-client.conf with 100% similarity]
monitor/config/collectd_server.conf [moved from monitor/config/collectd.conf with 100% similarity]
monitor/config/grafana.ini [moved from monitor/grafana/config/grafana.ini with 100% similarity]
monitor/config/prometheus.yaml
monitor/dashboard/__init__.py [moved from monitor/config/__init__.py with 86% similarity]
monitor/dashboard/automated_dashboard_datasource.py [moved from monitor/automated_dashboard_datasource.py with 89% similarity]
monitor/dashboard/custom_dashboard.py [moved from monitor/custom_dashboard.py with 100% similarity]
monitor/dashboard/custom_query_dashboard.json [moved from monitor/custom_query_dashboard.json with 100% similarity]
monitor/dashboard/prometheus_system_rev1.json [moved from monitor/grafana/dashboards/prometheus_system_rev1.json with 98% similarity]
monitor/dashboard/prototype_dashboard_collapsible.json [moved from monitor/prototype_dashboard_collapsible.json with 99% similarity]
monitor/dashboard/prototype_prometheus_dashboard.json [moved from monitor/prototype_prometheus_dashboard.json with 100% similarity]
monitor/dispatch/__init__.py [new file with mode: 0644]
monitor/dispatch/automate_barometer_client.py [moved from monitor/barometer_automated_client_install.py with 74% similarity]
monitor/dispatch/automate_cadvisor_client.py [moved from monitor/automate_cadvisor_client.py with 82% similarity]
monitor/dispatch/automate_collectd_client.py [moved from monitor/automate_collectd_client.py with 81% similarity]
monitor/dispatch/client_ip_configure.py [moved from monitor/client_ip_configure.py with 100% similarity]
monitor/dispatch/install_barometer_client.sh [new file with mode: 0644]
monitor/dispatch/install_cadvisor_client.sh [moved from monitor/cadvisor_install.sh with 71% similarity]
monitor/dispatch/install_collectd_client.sh [new file with mode: 0644]
monitor/dispatch/server_ip_configure.py [moved from monitor/server_ip_configure.py with 100% similarity]
monitor/install_collectd_client.sh [deleted file]
monitor/monitoring.sh

diff --git a/monitor/barometer_install_client.sh b/monitor/barometer_install_client.sh
deleted file mode 100644 (file)
index 2bf6cd8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-docker pull opnfv/barometer
-sudo docker run  --name bottlenecks-barometer-client -tid --net=host -v `pwd`/../src/collectd_sample_configs:/opt/collectd/etc/collectd.conf.d \
--v /etc/barometer_config/barometer_client_collectd.conf:/src/barometer/src/collectd/collectd/src/collectd.conf \
--v /etc/barometer_config/barometer_client_collectd.conf:/opt/collectd/etc/collectd.conf \
--v /var/run:/var/run -v /tmp:/tmp --privileged opnfv/barometer /run_collectd.sh
diff --git a/monitor/barometer_install_script.sh b/monitor/barometer_install_script.sh
deleted file mode 100644 (file)
index b0abbb9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-docker pull opnfv/barometer
-sudo docker run  --name bottlenecks-barometer-server -tid --net=host -v `pwd`/../src/collectd_sample_configs:/opt/collectd/etc/collectd.conf.d \
--v /home/opnfv/bottlenecks/monitor/barometer_collectd.conf:/src/barometer/src/collectd/collectd/src/collectd.conf \
--v /etc/barometer_config/barometer_client_collectd.conf:/opt/collectd/etc/collectd.conf \
--v /var/run:/var/run -v /tmp:/tmp --privileged opnfv/barometer /run_collectd.sh
similarity index 98%
rename from monitor/barometer_client.conf
rename to monitor/config/barometer_client.conf
index fc29e72..54db388 100644 (file)
@@ -146,7 +146,7 @@ LoadPlugin write_http
 #</Plugin>
 
 <Plugin network>
-        Server "192.168.121.2" "25826"
+        Server "192.168.114.2" "25826"
 </Plugin>
 
 <Plugin ovs_events>
@@ -167,7 +167,7 @@ LoadPlugin write_http
 
 <Plugin write_http>
   <Node "collectd_exporter">
-    URL "http://192.168.121.2:9103/collectd-post"
+    URL "http://192.168.114.2:9103/collectd-post"
     Format "JSON"
     StoreRates false
   </Node>
similarity index 98%
rename from monitor/barometer_collectd.conf
rename to monitor/config/barometer_server.conf
index ecb1261..55ff96e 100644 (file)
@@ -146,7 +146,7 @@ LoadPlugin write_http
 #</Plugin>
 
 <Plugin network>
-        Listen "192.168.121.2" "25826"
+        Listen "192.168.114.2" "25826"
 </Plugin>
 
 <Plugin ovs_events>
@@ -167,7 +167,7 @@ LoadPlugin write_http
 
 <Plugin write_http>
   <Node "collectd_exporter">
-    URL "http://192.168.121.2:9103/collectd-post"
+    URL "http://192.168.114.2:9103/collectd-post"
     Format "JSON"
     StoreRates false
   </Node>
index 3736d8e..b218711 100644 (file)
@@ -25,7 +25,7 @@ scrape_configs:
     scrape_interval: 5s
 
     static_configs:
-      - targets: ['192.168.121.2:9090']
+      - targets: ['192.168.114.2:9090']
 
   - job_name: 'cadvisor'
 
@@ -33,7 +33,7 @@ scrape_configs:
     scrape_interval: 5s
 
     static_configs:
-      - targets: ['192.168.121.2:8080','10.1.0.50:8080','10.1.0.51:8080']
+      - targets: ['192.168.114.2:8080','10.1.0.50:8080','10.1.0.51:8080','10.1.0.52:8080','10.1.0.53:8080','10.1.0.54:8080']
 
   - job_name: 'collectd'
 
@@ -41,7 +41,7 @@ scrape_configs:
     scrape_interval: 5s
 
     static_configs:
-      - targets: ['192.168.121.2:9103']
+      - targets: ['192.168.114.2:9103']
 
   - job_name: 'node'
 
@@ -49,4 +49,4 @@ scrape_configs:
     scrape_interval: 5s
 
     static_configs:
-      - targets: ['192.168.121.2:9100']
+      - targets: ['192.168.114.2:9100']
similarity index 86%
rename from monitor/config/__init__.py
rename to monitor/dashboard/__init__.py
index b124dfa..a90f1d1 100644 (file)
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.
 #
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Apache License, Version 2.0
@@ -14,6 +14,7 @@ from oslo_serialization import jsonutils
 
 
 logger = logging.getLogger(__name__)
+MONITOR_DASHBOARD = "/home/opnfv/bottlenecks/monitor/dashboard/"
 
 
 def _create_dashboard(ip, port, path):
@@ -64,8 +65,7 @@ def post(url, data):
 
 ip_address = socket.gethostbyname(socket.gethostname())
 _create_data_source(ip_address, 3000)
-_create_dashboard(ip_address, 3000, '/var/lib/grafana/' +
-                  'dashboards/' +
-                  'prometheus_system_rev1.json')
+# _create_dashboard(ip_address, 3000,
+#                   MONITOR_DASHBOARD + 'prometheus_system_rev1.json')
 _create_dashboard(ip_address, 3000,
-                  'prototype_dashboard_collapsible.json')
+                  MONITOR_DASHBOARD + 'prototype_dashboard_collapsible.json')
@@ -63,7 +63,7 @@
             "rgba(237, 129, 40, 0.89)",
             "rgba(50, 172, 45, 0.97)"
           ],
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 1,
           "editable": true,
           "error": false,
             "rgba(237, 129, 40, 0.89)",
             "rgba(50, 172, 45, 0.97)"
           ],
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "editable": true,
           "error": false,
           "format": "none",
             "rgba(237, 129, 40, 0.89)",
             "rgba(50, 172, 45, 0.97)"
           ],
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
             "rgba(237, 129, 40, 0.89)",
             "rgba(245, 54, 54, 0.9)"
           ],
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 0,
           "editable": true,
           "error": false,
         {
           "aliasColors": {},
           "bars": false,
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
         {
           "aliasColors": {},
           "bars": false,
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
         {
           "aliasColors": {},
           "bars": false,
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
         {
           "aliasColors": {},
           "bars": false,
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
         {
           "aliasColors": {},
           "bars": true,
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
         {
           "aliasColors": {},
           "bars": true,
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
         {
           "aliasColors": {},
           "bars": false,
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
         {
           "aliasColors": {},
           "bars": false,
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
         {
           "aliasColors": {},
           "bars": false,
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
         {
           "aliasColors": {},
           "bars": true,
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
         {
           "aliasColors": {},
           "bars": false,
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
         {
           "aliasColors": {},
           "bars": false,
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
         {
           "aliasColors": {},
           "bars": false,
-          "datasource": "${DS_PROMETHEUS}",
+          "datasource": "automated-ds",
           "decimals": 2,
           "editable": true,
           "error": false,
       {
         "allFormat": "glob",
         "current": {},
-        "datasource": "${DS_PROMETHEUS}",
+        "datasource": "automated-ds",
         "hide": 0,
         "includeAll": false,
         "label": "Host",
   "annotations": {
     "list": [
       {
-        "datasource": "${DS_PROMETHEUS}",
+        "datasource": "automated-ds",
         "enable": false,
         "expr": "ALERTS{alias=\"$host\", alertstate=\"firing\"}",
         "iconColor": "rgb(252, 5, 0)",
         "titleFormat": "{{ alertname }}"
       },
       {
-        "datasource": "${DS_PROMETHEUS}",
+        "datasource": "automated-ds",
         "enable": true,
         "expr": "ALERTS{alias=\"$host\",alertstate=\"pending\"}",
         "iconColor": "rgb(228, 242, 9)",
@@ -7,7 +7,7 @@
   "gnetId": 893,
   "graphTooltip": 1,
   "hideControls": false,
-  "id": 13,
+  "id": null,
   "links": [],
   "refresh": "15m",
   "rows": [
       {
         "allValue": null,
         "current": {
-          "text": "192.168.121.2",
-          "value": "192.168.121.2"
+          "text": "192.168.114.2",
+          "value": "192.168.114.2"
         },
         "datasource": "automated-ds",
         "hide": 0,
     ]
   },
   "timezone": "browser",
-  "title": "Monitoring docker using Prometheus",
+  "title": "Collapsibe System Monitor using Prometheus",
   "version": 3
 }
diff --git a/monitor/dispatch/__init__.py b/monitor/dispatch/__init__.py
new file mode 100644 (file)
index 0000000..a90f1d1
--- /dev/null
@@ -0,0 +1,8 @@
+##############################################################################
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
@@ -13,9 +13,9 @@ import utils.infra_setup.passwordless_SSH.ssh as ssh
 
 logger = logging.getLogger(__name__)
 barometer_client_install_sh =\
-    "/home/opnfv/bottlenecks/monitor/barometer_install_client.sh"
+    "/home/opnfv/bottlenecks/monitor/dispatch/install_barometer_client.sh"
 barometer_client_install_conf =\
-    "/home/opnfv/bottlenecks/monitor/barometer_client.conf"
+    "/home/opnfv/bottlenecks/monitor/config/barometer_client.conf"
 
 with open('/tmp/pod.yaml') as f:
     dataMap = yaml.safe_load(f)
@@ -30,14 +30,22 @@ with open('/tmp/pod.yaml') as f:
                     "cd /etc && mkdir barometer_config"
                 )
                 if status:
-                    raise Exception("Command failed with non-zero status.")
+                    print Exception(
+                        "Command: \"mkdir barometer_config\" failed.")
                     logger.info(stdout.splitlines())
                 with open(barometer_client_install_conf) as stdin_file:
                     ssh_d.run("cat > /etc/barometer_config/\
-                        barometer_client_collectd.conf",
+barometer_client.conf",
                               stdin=stdin_file)
                 with open(barometer_client_install_sh) as stdin_file:
                     ssh_d.run("cat > /etc/barometer_config/install.sh",
                               stdin=stdin_file)
 
+                status, stdout, stderr = ssh_d.execute(
+                    "sudo apt-get install -y docker.io"
+                )
+                if status:
+                    raise Exception("Command for installing docker failed.")
+                    logger.info(stdout.splitlines())
+
                 ssh_d.run("cd /etc/barometer_config/ && bash ./install.sh")
similarity index 82%
rename from monitor/automate_cadvisor_client.py
rename to monitor/dispatch/automate_cadvisor_client.py
index f84892d..3a65ff1 100644 (file)
@@ -12,7 +12,8 @@ import yaml
 import utils.infra_setup.passwordless_SSH.ssh as ssh
 
 logger = logging.getLogger(__name__)
-cadvisor_install_sh = "/home/opnfv/bottlenecks/monitor/cadvisor_install.sh"
+cadvisor_client_install_sh =\
+    "/home/opnfv/bottlenecks/monitor/dispatch/install_cadvisor_client.sh"
 
 with open('/tmp/pod.yaml') as f:
     dataMap = yaml.safe_load(f)
@@ -27,13 +28,14 @@ with open('/tmp/pod.yaml') as f:
                     "cd /etc && mkdir cadvisor_config"
                 )
                 if status:
-                    raise Exception("Command failed with non-zero status.")
+                    print Exception(
+                        "Command: \"mkdir cadvisor_config\" failed.")
                     logger.info(stdout.splitlines())
-                with open(cadvisor_install_sh) as stdin_file:
+                with open(cadvisor_client_install_sh) as stdin_file:
                     ssh_d.run("cat > /etc/cadvisor_config/install.sh",
                               stdin=stdin_file)
                 status, stdout, stderr = ssh_d.execute(
-                    "sudo apt-get install docker.io"
+                    "sudo apt-get install -y docker.io"
                 )
                 if status:
                     raise Exception("Command for installing docker failed.")
similarity index 81%
rename from monitor/automate_collectd_client.py
rename to monitor/dispatch/automate_collectd_client.py
index 8358cfc..c4346e5 100644 (file)
@@ -13,7 +13,7 @@ import utils.infra_setup.passwordless_SSH.ssh as ssh
 
 logger = logging.getLogger(__name__)
 collectd_client_install_sh =\
-    "/home/opnfv/bottlenecks/monitor/install_collectd_client.sh"
+    "/home/opnfv/bottlenecks/monitor/dispatch/install_collectd_client.sh"
 collectd_client_install_conf =\
     "/home/opnfv/bottlenecks/monitor/config/collectd_client.conf"
 
@@ -30,16 +30,19 @@ with open('/tmp/pod.yaml') as f:
                     "cd /etc && mkdir collectd_config"
                 )
                 if status:
-                    raise Exception("Command failed with non-zero status.")
+                    print Exception(
+                        "Command: \"mkdir collectd_config\" failed.")
                     logger.info(stdout.splitlines())
                 with open(collectd_client_install_sh) as stdin_file:
                     ssh_d.run("cat > /etc/collectd_config/install.sh",
                               stdin=stdin_file)
                 with open(collectd_client_install_conf) as stdin_file:
-                    ssh_d.run("cat > /etc/collectd_config/collectd.conf",
-                              stdin=stdin_file)
+                    ssh_d.run(
+                        "cat > /etc/collectd_config/collectd_client.conf",
+                        stdin=stdin_file
+                    )
                 status, stdout, stderr = ssh_d.execute(
-                    "sudo apt-get install docker.io"
+                    "sudo apt-get install -y docker.io"
                 )
                 if status:
                     raise Exception("Command for installing docker failed.")
diff --git a/monitor/dispatch/install_barometer_client.sh b/monitor/dispatch/install_barometer_client.sh
new file mode 100644 (file)
index 0000000..491e824
--- /dev/null
@@ -0,0 +1,8 @@
+HOSTNAME=`hostname`
+
+docker pull opnfv/barometer
+sudo docker run  --name bottlenecks-barometer-${HOSTNAME} -tid --net=host \
+  -v /etc/barometer_config/barometer_client.conf:/src/barometer/src/collectd/collectd/src/collectd.conf \
+  -v /etc/barometer_config/barometer_client.conf:/opt/collectd/etc/collectd.conf \
+  -v /var/run:/var/run -v /tmp:/tmp \
+  --privileged opnfv/barometer /run_collectd.sh
\ No newline at end of file
similarity index 71%
rename from monitor/cadvisor_install.sh
rename to monitor/dispatch/install_cadvisor_client.sh
index 524e24d..bcd0e8a 100644 (file)
@@ -1,4 +1,7 @@
+HOSTNAME=`hostname`
+
 sudo docker run \
+  --name=bottlenecks-cadvisor-${HOSTNAME} \
   --volume=/:/rootfs:ro \
   --volume=/var/run:/var/run:rw \
   --volume=/sys:/sys:ro \
@@ -6,5 +9,4 @@ sudo docker run \
   --volume=/dev/disk/:/dev/disk:ro \
   --publish=8080:8080 \
   --detach=true \
-  --name=cadvisor \
-  google/cadvisor:v0.25.0 \ -storage_driver=Prometheus
+  google/cadvisor:v0.25.0
diff --git a/monitor/dispatch/install_collectd_client.sh b/monitor/dispatch/install_collectd_client.sh
new file mode 100644 (file)
index 0000000..4f08112
--- /dev/null
@@ -0,0 +1,8 @@
+MONITOR_CONFIG="/etc/collectd_config"
+HOSTNAME=`hostname`
+
+sudo docker run --name bottlenecks-collectd-${HOSTNAME} -d \
+  --privileged \
+  -v ${MONITOR_CONFIG}/collectd_client.conf:/etc/collectd/collectd.conf:ro \
+  -v /proc:/mnt/proc:ro \
+  fr3nd/collectd:5.5.0-1
diff --git a/monitor/install_collectd_client.sh b/monitor/install_collectd_client.sh
deleted file mode 100644 (file)
index 3861f98..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-MONITOR_CONFIG="/etc/collectd_config"
-
-# Collectd
-sudo docker run --name bottlenecks-automated-collectd -d \
-  --privileged \
-  -v ${MONITOR_CONFIG}:/etc/collectd:ro \
-  -v /proc:/mnt/proc:ro \
-  fr3nd/collectd:5.5.0-1
index 9abe49d..b42126b 100644 (file)
@@ -7,33 +7,41 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
+set -e
 
 MONITOR_CONFIG="/home/opnfv/bottlenecks/monitor/config"
-GRAFANA="/home/opnfv/bottlenecks/monitor/grafana"
-
-# Node-Exporter
-sudo docker run --name bottlenecks-node-exporter \
-  -d -p 9100:9100 \
-  -v "/proc:/host/proc:ro" \
-  -v "/sys:/host/sys:ro" \
-  -v "/:/rootfs:ro" \
-  --net="host" \
-  quay.io/prometheus/node-exporter:v0.14.0 \
-    -collector.procfs /host/proc \
-    -collector.sysfs /host/sys \
-    -collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"
-
-# Collectd
-sudo docker run --name bottlenecks-collectd -d \
-  --privileged \
-  -v ${MONITOR_CONFIG}:/etc/collectd:ro \
-  -v /proc:/mnt/proc:ro \
-  fr3nd/collectd:5.5.0-1
+DISPATCH="/home/opnfv/bottlenecks/monitor/dispatch"
 
+
+# INSTALL GRAFANA + PROMETHEUS + CADVISOR + BAROMETER on the JUMPERSERVER
+# # Node-Exporter
+# sudo docker run --name bottlenecks-node-exporter \
+#   -d -p 9100:9100 \
+#   -v "/proc:/host/proc:ro" \
+#   -v "/sys:/host/sys:ro" \
+#   -v "/:/rootfs:ro" \
+#   --net="host" \
+#   quay.io/prometheus/node-exporter:v0.14.0 \
+#     -collector.procfs /host/proc \
+#     -collector.sysfs /host/sys \
+#     -collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"
+
+# # 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
+
+echo == installation of monitoring module is started ==
+
+set +e
 # Collectd-Exporter
 sudo docker run --name bottlenecks-collectd-exporter \
-  -d -p 9103:9103 \
-  -p 25826:25826/udp prom/collectd-exporter:0.3.1 \
+  -d -p 9103:9103 -p 25826:25826/udp \
+  prom/collectd-exporter:0.3.1 \
   -collectd.listen-address=":25826"
 
 # Prometheus
@@ -45,9 +53,14 @@ sudo docker run --name bottlenecks-prometheus \
 # Grafana
 sudo  docker run --name bottlenecks-grafana \
   -d -p 3000:3000 \
-  -v ${GRAFANA}/config/grafana.ini:/etc/grafana/grafana.ini \
+  -v ${MONITOR_CONFIG}/grafana.ini:/etc/grafana/grafana.ini \
   grafana/grafana:4.5.0
+# Automate Prometheus Datasource and Grafana Dashboard creation
+
+set -e
+python dashboard/automated_dashboard_datasource.py
 
+set +e
 # Cadvisor
 sudo docker run \
   --volume=/:/rootfs:ro \
@@ -57,26 +70,40 @@ sudo docker run \
   --volume=/dev/disk/:/dev/disk:ro \
   --publish=8080:8080 \
   --detach=true \
-  --name=cadvisor \
-  google/cadvisor:v0.25.0 \ -storage_driver=Prometheus
-
-# Configure IP Address in barometer client configuration
-python client_ip_configure.py barometer_client.conf
+  --name=bottlenecks-cadvisor \
+  google/cadvisor:v0.25.0
 
+set -e
+# Barometer
 # Configure IP Address in barometer server configuration
-python server_ip_configure.py barometer_collectd.conf
+sleep 10
+python ${DISPATCH}/server_ip_configure.py ${MONITOR_CONFIG}/barometer_server.conf
 
-# Automate Collectd Client
-python automate_collectd_client.py
+set +e
+# Install on jumpserver
+docker pull opnfv/barometer
+sudo docker run  --name bottlenecks-barometer -tid --net=host \
+  -v ${MONITOR_CONFIG}/barometer_server.conf:/src/barometer/src/collectd/collectd/src/collectd.conf \
+  -v ${MONITOR_CONFIG}/barometer_server.conf:/opt/collectd/etc/collectd.conf \
+  -v /var/run:/var/run \
+  -v /tmp:/tmp \
+  --privileged opnfv/barometer /run_collectd.sh
 
-# Automate Cadvisor Client
-python automate_cadvisor_client.py
 
-# Automate Barometer installation for jump server
-bash ./barometer_install_script.sh
+set -e
+# INSTALL BAROMETER + CADVISOR (+ COLLECTD) CLIENTS on COMPUTE/CONTROL NODES
+# Configure IP Address in barometer client configuration
+python ${DISPATCH}/client_ip_configure.py ${MONITOR_CONFIG}/barometer_client.conf
 
-# Automate Barometer installation for compute/controller nodes
-python barometer_automated_client_install.py
+# Automate Barometer client installation
+python ${DISPATCH}/automate_barometer_client.py
 
-# Automate Prometheus Datasource and Grafana Dashboard creation
-python automated_dashboard_datasource.py
+# # Configure IP Address in collectd client configuration
+# python ${DISPATCH}/client_ip_configure.py ${MONITOR_CONFIG}/collectd_client.conf
+# # Automate Collectd Client installation
+# python ${DISPATCH}/automate_collectd_client.py
+
+# Automate Cadvisor Client
+python ${DISPATCH}/automate_cadvisor_client.py
+
+echo == installation of monitoring module is finished ==