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 ##############################################################################
10 MONITOR_CONFIG="/home/opnfv/bottlenecks/monitor/config"
11 DISPATCH="/home/opnfv/bottlenecks/monitor/dispatch"
13 # INSTALL GRAFANA + PROMETHEUS + CADVISOR + BAROMETER on the JUMPERSERVER
15 echo == installation of monitoring module is started ==
18 # # Configure IP Address in collectd server configuration
19 # python ${DISPATCH}/server_ip_configure.py ${MONITOR_CONFIG}/collectd_server.conf
20 # sudo docker run --name bottlenecks-collectd -d \
22 # -v ${MONITOR_CONFIG}/collectd_server.conf:/etc/collectd/collectd.conf:ro \
23 # -v /proc:/mnt/proc:ro \
24 # fr3nd/collectd:5.5.0-1
28 sudo docker run --name bottlenecks-prometheus \
30 -v ${MONITOR_CONFIG}/prometheus.yaml:/etc/prometheus/prometheus.yml \
31 prom/prometheus:v1.7.1
34 sudo docker run --name bottlenecks-collectd-exporter \
35 -d -p 9103:9103 -p 25826:25826/udp \
36 prom/collectd-exporter:0.3.1 \
37 -collectd.listen-address=":25826"
39 sudo docker run --name bottlenecks-node-exporter \
41 -v "/proc:/host/proc:ro" \
42 -v "/sys:/host/sys:ro" \
45 quay.io/prometheus/node-exporter:v0.14.0 \
46 -collector.procfs /host/proc \
47 -collector.sysfs /host/sys \
48 -collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"
51 sudo docker run --name bottlenecks-openstack-exporter \
53 -p 9104:9104 --env-file ${MONITOR_CONFIG}/openstack_exporter.conf \
54 -d gabrielyuyang/att-prometheus-openstack-exporter:latest
57 sudo docker run --name bottlenecks-grafana \
59 -v ${MONITOR_CONFIG}/grafana.ini:/etc/grafana/grafana.ini \
61 # Automate Prometheus Datasource and Grafana Dashboard creation
65 python ${DISPATCH}/../dashboard/automated_dashboard_datasource.py
70 --volume=/:/rootfs:ro \
71 --volume=/var/run:/var/run:rw \
72 --volume=/sys:/sys:ro \
73 --volume=/var/lib/docker/:/var/lib/docker:ro \
74 --volume=/dev/disk/:/dev/disk:ro \
77 --name=bottlenecks-cadvisor \
78 google/cadvisor:v0.25.0
83 # Configure IP Address in barometer server configuration
85 python ${DISPATCH}/server_ip_configure.py ${MONITOR_CONFIG}/barometer_server.conf
88 # Install on jumpserver
89 docker pull opnfv/barometer
90 sudo docker run --name bottlenecks-barometer -d --net=host \
91 -v ${MONITOR_CONFIG}/barometer_server.conf:/src/barometer/src/collectd/collectd/src/collectd.conf \
92 -v ${MONITOR_CONFIG}/barometer_server.conf:/opt/collectd/etc/collectd.conf \
93 -v /var/run:/var/run \
95 --privileged opnfv/barometer /run_collectd.sh
98 # INSTALL BAROMETER + CADVISOR (+ COLLECTD) CLIENTS on COMPUTE/CONTROL NODES
99 # Configure IP Address in barometer client configuration
100 python ${DISPATCH}/client_ip_configure.py ${MONITOR_CONFIG}/barometer_client.conf
103 # Automate Barometer client installation
104 python ${DISPATCH}/automate_barometer_client.py
106 # # Configure IP Address in collectd client configuration
107 # python ${DISPATCH}/client_ip_configure.py ${MONITOR_CONFIG}/collectd_client.conf
108 # # Automate Collectd Client installation
109 # python ${DISPATCH}/automate_collectd_client.py
111 # Automate Cadvisor Client
112 python ${DISPATCH}/automate_cadvisor_client.py
114 echo == installation of monitoring module is finished ==