Fix the version of more-itertools to be 5.0.0
[bottlenecks.git] / monitor / monitoring.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2017 Huawei Tech and others.
4 #
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
11 MONITOR_CONFIG="/home/opnfv/bottlenecks/monitor/config"
12 GRAFANA="/home/opnfv/bottlenecks/monitor/grafana"
13
14 # Node-Exporter
15 sudo docker run --name bottlenecks-node-exporter \
16   -d -p 9100:9100 \
17   -v "/proc:/host/proc:ro" \
18   -v "/sys:/host/sys:ro" \
19   -v "/:/rootfs:ro" \
20   --net="host" \
21   quay.io/prometheus/node-exporter \
22     -collector.procfs /host/proc \
23     -collector.sysfs /host/sys \
24     -collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"
25
26 # Collectd
27 sudo docker run --name bottlenecks-collectd -d \
28   --privileged \
29   -v ${MONITOR_CONFIG}:/etc/collectd:ro \
30   -v /proc:/mnt/proc:ro \
31   fr3nd/collectd
32
33 # Collectd-Exporter
34 sudo docker run --name bottlenecks-collectd-exporter \
35   -d -p 9103:9103 \
36   -p 25826:25826/udp prom/collectd-exporter \
37   -collectd.listen-address=":25826"
38
39 # Prometheus
40 sudo docker run --name bottlenecks-prometheus \
41   -d -p 9090:9090 \
42   -v ${MONITOR_CONFIG}/prometheus.yaml:/etc/prometheus/prometheus.yml \
43   prom/prometheus
44
45 $ Grafana
46 sudo  docker run --name bottlenecks-grafana \
47   -d -p 3000:3000 \
48   grafana/grafana