Add test monitoring module
[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
13 # Node-Exporter
14 sudo docker run -d -p 9100:9100 \
15   -v "/proc:/host/proc:ro" \
16   -v "/sys:/host/sys:ro" \
17   -v "/:/rootfs:ro" \
18   --net="host" \
19   quay.io/prometheus/node-exporter \
20     -collector.procfs /host/proc \
21     -collector.sysfs /host/sys \
22     -collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"
23
24 # Collectd
25 sudo docker run -d \
26   --privileged \
27   -v ${MONITOR_CONFIG}:/etc/collectd:ro \
28   -v /proc:/mnt/proc:ro \
29   fr3nd/collectd
30
31 # Collectd-Exporter
32 sudo docker run -d -p 9103:9103 \
33   -p 25826:25826/udp prom/collectd-exporter \
34   -collectd.listen-address=":25826"
35
36 # Prometheus
37 sudo docker run -d -p 9090:9090 \
38   -v ${MONITOR_CONFIG}/prometheus.yaml:/etc/prometheus/prometheus.yaml \
39   prom/prometheus