File tree Expand file tree Collapse file tree 7 files changed +80
-0
lines changed Expand file tree Collapse file tree 7 files changed +80
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ DOCKER_COMPOSE_PATH=./.tmp/docker-compose.tmp.yml
4+ TEMPLATE_PATH=./.templates/prometheus
5+
6+ if [[ ! -f $DOCKER_COMPOSE_PATH ]]; then
7+ echo " [Prometheus] Warning: $DOCKER_COMPOSE_PATH does not exist."
8+ fi
9+
10+ # Configure Prometheus Add-ons
11+
12+ option_selection=$( whiptail --title " Select Prometheus Options" --checklist --separate-output \
13+ " Use the [SPACEBAR] to select add-on containers from the list below." 20 78 12 -- \
14+ " node-exporter" " monitor this computer " " ON" \
15+ " cadvisor-arm" " monitor full container stack " " ON" \
16+ 3>&1 1>&2 2>&3 )
17+
18+ mapfile -t selected_options <<< " $option_selection"
19+
20+ # (cat $TEMPLATE_PATH/service.yml; echo) >> $DOCKER_COMPOSE_PATH
21+
22+ for option in " ${selected_options[@]} " ; do
23+ # insert add-on service
24+ (cat $TEMPLATE_PATH /service_${option} .yml; echo) >> $DOCKER_COMPOSE_PATH
25+
26+ # include add-on in depends_on
27+ sed -i.bak -e " /depends_on:/a\\
28+ \\ \\ \\ \\ \\ \\ - ${option} " $DOCKER_COMPOSE_PATH
29+ done
30+
31+ # clean up
32+ rm ${DOCKER_COMPOSE_PATH} .bak
Original file line number Diff line number Diff line change 1+ global :
2+ scrape_interval : 10s
3+ evaluation_interval : 10s
4+
5+ # scrape_configs:
6+ # - job_name: iotstack
7+ # static_configs:
8+ # - targets:
9+ # - cadvisor:8080
10+ # - node-exporter:9100
Original file line number Diff line number Diff line change 1+ prometheus :
2+ container_name : prometheus
3+ image : prom/prometheus:latest
4+ restart : unless-stopped
5+ user : " 0"
6+ ports :
7+ - 9090:9090
8+ env_file :
9+ - ./services/prometheus/prometheus.env
10+ depends_on :
11+ volumes :
12+ - ./services/prometheus/config.yml:/etc/prometheus/config.yml
13+ - ./volumes/prometheus/data:/data
14+ command :
15+ - ' --config.file=/etc/prometheus/config.yml'
16+ - ' --storage.tsdb.path=/data'
17+
Original file line number Diff line number Diff line change 1+ cadvisor-arm :
2+ container_name : cadvisor
3+ image : budry/cadvisor-arm:latest
4+ restart : unless-stopped
5+ user : " 0"
6+ privileged : true
7+ ports :
8+ - 8080:8080
9+ volumes :
10+ - /:/rootfs:ro
11+ - /var/run:/var/run:rw
12+ - /sys:/sys:ro
13+ - /var/lib/docker/:/var/lib/docker:ro
Original file line number Diff line number Diff line change 1+ node-exporter :
2+ image : prom/node-exporter:latest
3+ container_name : node_exporter
4+ restart : unless-stopped
5+ expose :
6+ - 9100
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ declare -A cont_array=(
2525 [transmission]=" transmission"
2626 [grafana]=" Grafana"
2727 [mosquitto]=" Eclipse-Mosquitto"
28+ [prometheus]=" Prometheus"
2829 [postgres]=" Postgres"
2930 [timescaledb]=" Timescaledb"
3031 [mariadb]=" MariaDB (MySQL fork)"
@@ -61,6 +62,7 @@ declare -a armhf_keys=(
6162 " grafana"
6263 " mosquitto"
6364 " telegraf"
65+ " prometheus"
6466 " mariadb"
6567 " postgres"
6668 " timescaledb"
You can’t perform that action at this time.
0 commit comments