forked from msimerson/Mail-Toaster-6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovision-grafana.sh
executable file
·54 lines (45 loc) · 1.07 KB
/
provision-grafana.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
#!/bin/sh
# shellcheck disable=1091
. mail-toaster.sh || exit
export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
install_grafana()
{
tell_status "installing Grafana"
stage_pkg_install influxdb telegraf statsd grafana3 || exit
tell_status "Enable Influxd 3, Grafana 3, telegraf, and statsd"
stage_sysrc influxd_enable=YES
stage_sysrc grafana3_enable=YES
stage_sysrc statsd_enable=YES
stage_sysrc telegraf_enable=YES
mkdir "$STAGE_MNT/var/lib"
chown 907:907 "$STAGE_MNT/var/lib"
sed -i '' \
-e "s/ process\./ require('events')\./" \
"$STAGE_MNT/usr/local/share/statsd/lib/config.js"
}
start_grafana()
{
stage_exec service influxd start
stage_exec service telegraf start
stage_exec service grafana3 start
stage_exec service statsd start
}
test_grafana()
{
stage_test_running grafana
sleep 1
stage_test_running telegraf
sleep 1
stage_test_running influxd
sleep 1
stage_listening 8125
# stage_test_running statsd
}
base_snapshot_exists || exit
create_staged_fs grafana
start_staged_jail grafana
install_grafana
start_grafana
test_grafana
promote_staged_jail grafana