2 ##############################################################################
3 # Copyright (c) 2017 Huawei Tech and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
12 MONITOR_CONFIG="/home/opnfv/bottlenecks/monitor/config"
13 DISPATCH="/home/opnfv/bottlenecks/monitor/dispatch"
16 # INSTALL GRAFANA + PROMETHEUS + CADVISOR + BAROMETER on the JUMPERSERVER
18 # sudo docker run --name bottlenecks-node-exporter \
20 # -v "/proc:/host/proc:ro" \
21 # -v "/sys:/host/sys:ro" \
24 # quay.io/prometheus/node-exporter:v0.14.0 \
25 # -collector.procfs /host/proc \
26 # -collector.sysfs /host/sys \
27 # -collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"
30 # # Configure IP Address in collectd server configuration
31 # python ${DISPATCH}/server_ip_configure.py ${MONITOR_CONFIG}/collectd_server.conf
32 # sudo docker run --name bottlenecks-collectd -d \
34 # -v ${MONITOR_CONFIG}/collectd_server.conf:/etc/collectd/collectd.conf:ro \
35 # -v /proc:/mnt/proc:ro \
36 # fr3nd/collectd:5.5.0-1
38 echo == installation of monitoring module is started ==
42 sudo docker run --name bottlenecks-collectd-exporter \
43 -d -p 9103:9103 -p 25826:25826/udp \
44 prom/collectd-exporter:0.3.1 \
45 -collectd.listen-address=":25826"
48 sudo docker run --name bottlenecks-prometheus \
50 -v ${MONITOR_CONFIG}/prometheus.yaml:/etc/prometheus/prometheus.yml \
51 prom/prometheus:v1.7.1
54 sudo docker run --name bottlenecks-grafana \
56 -v ${MONITOR_CONFIG}/grafana.ini:/etc/grafana/grafana.ini \
58 # Automate Prometheus Datasource and Grafana Dashboard creation
61 python dashboard/automated_dashboard_datasource.py
66 --volume=/:/rootfs:ro \
67 --volume=/var/run:/var/run:rw \
68 --volume=/sys:/sys:ro \
69 --volume=/var/lib/docker/:/var/lib/docker:ro \
70 --volume=/dev/disk/:/dev/disk:ro \
73 --name=bottlenecks-cadvisor \
74 google/cadvisor:v0.25.0
78 # Configure IP Address in barometer server configuration
80 python ${DISPATCH}/server_ip_configure.py ${MONITOR_CONFIG}/barometer_server.conf
83 # Install on jumpserver
84 docker pull opnfv/barometer
85 sudo docker run --name bottlenecks-barometer -tid --net=host \
86 -v ${MONITOR_CONFIG}/barometer_server.conf:/src/barometer/src/collectd/collectd/src/collectd.conf \
87 -v ${MONITOR_CONFIG}/barometer_server.conf:/opt/collectd/etc/collectd.conf \
88 -v /var/run:/var/run \
90 --privileged opnfv/barometer /run_collectd.sh
94 # INSTALL BAROMETER + CADVISOR (+ COLLECTD) CLIENTS on COMPUTE/CONTROL NODES
95 # Configure IP Address in barometer client configuration
96 python ${DISPATCH}/client_ip_configure.py ${MONITOR_CONFIG}/barometer_client.conf
98 # Automate Barometer client installation
99 python ${DISPATCH}/automate_barometer_client.py
101 # # Configure IP Address in collectd client configuration
102 # python ${DISPATCH}/client_ip_configure.py ${MONITOR_CONFIG}/collectd_client.conf
103 # # Automate Collectd Client installation
104 # python ${DISPATCH}/automate_collectd_client.py
106 # Automate Cadvisor Client
107 python ${DISPATCH}/automate_cadvisor_client.py
109 echo == installation of monitoring module is finished ==