-
Notifications
You must be signed in to change notification settings - Fork 5
/
05_create-monitoring-configurations.sh
executable file
·90 lines (75 loc) · 2.81 KB
/
05_create-monitoring-configurations.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env bash
# Create the Prometheus driver config
printf "*********************************************************************************\n"
printf "Create the Prometheus driver config\n"
printf "*********************************************************************************\n"
install -m 644 /dev/null ./mynetwork/shared/drivers/config.yml
cat <<EOF >./mynetwork/shared/drivers/config.yml
{}
EOF
printf "Created in: ./mynetwork/shared/drivers/config.yml\n\n"
# Create the Prometheus configuration
printf "*********************************************************************************\n"
printf "Create the Prometheus configuration\n"
printf "*********************************************************************************\n\n"
install -m 644 /dev/null ./mynetwork/prometheus/prometheus.yml
cat <<EOF >./mynetwork/prometheus/prometheus.yml
global:
scrape_interval: 10s
external_labels:
monitor: "corda-network"
scrape_configs:
- job_name: "notary"
static_configs:
- targets: ["notary:8080"]
relabel_configs:
- source_labels: [__address__]
regex: "([^:]+):\\\d+"
target_label: instance
- job_name: "nodes"
static_configs:
- targets: ["partya:8080", "partyb:8080"]
relabel_configs:
- source_labels: [__address__]
regex: "([^:]+):\\\d+"
target_label: instance
EOF
printf "Created in: ./mynetwork/prometheus/prometheus.yml\n\n"
# Create the Filebeat configuration
printf "*********************************************************************************\n"
printf "Create the Filebeat configuration\n"
printf "*********************************************************************************\n\n"
install -m 644 /dev/null ./mynetwork/filebeat/filebeat.yml
cat <<EOF >./mynetwork/filebeat/filebeat.yml
filebeat.config:
modules:
path: \${path.config}/modules.d/*.yml
reload.enabled: false
filebeat.inputs:
- type: log
enabled: true
paths:
- "/var/log/partya/node-*"
- "/var/log/partyb/node-*"
- "/var/log/notary/node-*"
output.logstash:
hosts: ["elk:5044"]
EOF
printf "Created in: ./mynetwork/filebeat/filebeat.yml\n\n"
# Create the Logstash configuration
printf "*********************************************************************************\n"
printf "Create the Logstash configuration\n"
printf "*********************************************************************************\n\n"
install -m 644 /dev/null ./mynetwork/logstash/02-beats-input.conf
cat <<EOF >./mynetwork/logstash/02-beats-input.conf
input {
beats {
port => 5044
ssl => false
}
}
EOF
printf "Created in: ./mynetwork/logstash/02-beats-input.conf\n\n"
printf "*********************************************************************************\n"
printf "COMPLETE\n"
printf "*********************************************************************************\n"