Browse code

[monitoring] FEATBL-416 Feat: configure chronograf and nginx. restart services.

Thomas Cataldo authored on 14/05/2018 08:37:29
Showing 4 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,5 @@
0
+INFLUXDB_USERNAME=root
1
+INFLUXDB_PASSWORD=root
2
+KAPACITOR_USERNAME=root
3
+KAPACITOR_PASSWORD=root
4
+CHRONOGRAF_OPTS="--basepath=/tick --influxdb-url=http://127.0.0.1:8086 --kapacitor-url=http://127.0.0.1:9092"
0 5
new file mode 100644
... ...
@@ -0,0 +1,6 @@
0
+location /tick/ {
1
+   auth_basic            "Blue Mind TICK";
2
+   auth_basic_user_file  /etc/nginx/sw.htpasswd;
3
+   proxy_http_version 1.1;
4
+   proxy_pass http://127.0.0.1:8888/;
5
+}
0 6
new file mode 100755
... ...
@@ -0,0 +1,12 @@
0
+#!/bin/bash
1
+
2
+tick_conf=/usr/share/bm-tick-config
3
+
4
+cp ${tick_conf}/chronograf.default /etc/default/chronograf
5
+cp ${tick_conf}/tick.conf /etc/nginx/bm-local.d/
6
+
7
+invoke-rc.d bm-nginx restart 0>/dev/null 1>/dev/null 2>/dev/null 3>/dev/null || true
8
+invoke-rc.d influxdb restart 0>/dev/null 1>/dev/null 2>/dev/null 3>/dev/null || true
9
+invoke-rc.d telegraf restart 0>/dev/null 1>/dev/null 2>/dev/null 3>/dev/null || true
10
+invoke-rc.d kapacitor restart 0>/dev/null 1>/dev/null 2>/dev/null 3>/dev/null || true
11
+invoke-rc.d chronograf restart 0>/dev/null 1>/dev/null 2>/dev/null 3>/dev/null || true
... ...
@@ -17,4 +17,17 @@ Installs TICK stack for BlueMind
17 17
 %prep
18 18
 rm -rf %{buildroot}/*
19 19
 
20
+%post
21
+if [ $1 -eq 1 ]; then
22
+    # Installation
23
+    tick_conf=/usr/share/bm-tick-config
24
+    cp ${tick_conf}/chronograf.default /etc/default/chronograf
25
+    cp ${tick_conf}/tick.conf /etc/nginx/bm-local.d/
26
+    service bm-nginx restart
27
+    service influxdb restart
28
+    service kapacitor restart
29
+    service telegraf restart
30
+    service chronograf restart
31
+fi
32
+
20 33
 %files