Ver código fonte

some fixes in iot role

Thomas Buck 3 anos atrás
pai
commit
6fa91085c0

+ 9
- 2
roles/iot/tasks/influx.yml Ver arquivo

@@ -51,14 +51,21 @@
51 51
     group=root
52 52
   notify: restart telegraf
53 53
 
54
+- name: Set firewall rules for InfluxDB
55
+  ufw: rule=allow port={{ item }} proto=tcp
56
+  with_items:
57
+    - 8086  # http
58
+    - 8088  # rpc
59
+  tags: ufw
60
+
54 61
 - name: Register new InfluxDB and Telegraf service
55
-  systemd: name={{ item }} daemon_reload=yes enabled=yes
62
+  systemd: name={{ item }} daemon_reload=yes enabled=yes
56 63
   with_items:
57 64
     - influxdb
58 65
     - telegraf
59 66
 
60 67
 - name: Start new InfluxDB and Telegraf instance
61
-  service: name={{ item }} state=started
68
+  service: name={{ item }} state=started
62 69
   with_items:
63 70
     - influxdb
64 71
     - telegraf

+ 2
- 0
roles/iot/templates/etc_apache2_sites-available_grafana.j2 Ver arquivo

@@ -1,11 +1,13 @@
1 1
 <VirtualHost *:80>
2 2
     ServerName {{ grafana_subdomain }}.{{ item.name }}
3
+    ServerAlias {{ grafana_subdomain }}
3 4
 
4 5
     Redirect temp / https://{{ grafana_subdomain }}.{{ item.name }}/
5 6
 </VirtualHost>
6 7
 
7 8
 <VirtualHost *:443>
8 9
     ServerName {{ grafana_subdomain }}.{{ item.name }}
10
+    ServerAlias {{ grafana_subdomain }}
9 11
 
10 12
     SSLEngine               On
11 13
     DocumentRoot            "{{ item.doc_root }}"

+ 13
- 13
roles/iot/templates/etc_telegraf_telegraf.j2 Ver arquivo

@@ -1402,7 +1402,7 @@
1402 1402
   ## If true, collect raw CPU time metrics.
1403 1403
   collect_cpu_time = false
1404 1404
   ## If true, compute and report the sum of all non-idle CPU states.
1405
-  report_active = false
1405
+  report_active = true
1406 1406
 
1407 1407
 
1408 1408
 # Read metrics about disk usage by mount point
@@ -3017,18 +3017,18 @@
3017 3017
 
3018 3018
 
3019 3019
 # # Read metrics about network interface usage
3020
-# [[inputs.net]]
3021
-#   ## By default, telegraf gathers stats from any up interface (excluding loopback)
3022
-#   ## Setting interfaces will tell it to gather these explicit interfaces,
3023
-#   ## regardless of status.
3024
-#   ##
3025
-#   # interfaces = ["eth0"]
3026
-#   ##
3027
-#   ## On linux systems telegraf also collects protocol stats.
3028
-#   ## Setting ignore_protocol_stats to true will skip reporting of protocol metrics.
3029
-#   ##
3030
-#   # ignore_protocol_stats = false
3031
-#   ##
3020
+[[inputs.net]]
3021
+  ## By default, telegraf gathers stats from any up interface (excluding loopback)
3022
+  ## Setting interfaces will tell it to gather these explicit interfaces,
3023
+  ## regardless of status.
3024
+  ##
3025
+  # interfaces = ["eth0"]
3026
+  ##
3027
+  ## On linux systems telegraf also collects protocol stats.
3028
+  ## Setting ignore_protocol_stats to true will skip reporting of protocol metrics.
3029
+  ##
3030
+  # ignore_protocol_stats = false
3031
+  ##
3032 3032
 
3033 3033
 
3034 3034
 # # Collect response time of a TCP or UDP connection

Carregando…
Cancelar
Salvar