-
Notifications
You must be signed in to change notification settings - Fork 2
/
telegraf.yml
47 lines (40 loc) · 1.49 KB
/
telegraf.yml
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
- name: Copia los paquetes en /opt/packages
copy:
src: packages
dest: /opt
owner: root
group: root
- name: Instala telegraf de /opt/packages
action: apt deb={{ item }} state=present
with_items:
- /opt/packages/telegraf_1.5.1-1_amd64.deb
- name: Configura Telegraf con la IP de InfluxDB
replace:
dest: /etc/telegraf/telegraf.conf
regexp: '^ urls \= \[\"http\:\/\/127\.0\.0\.1\:8086\"\] \# required$'
replace: ' urls = ["http://192.168.0.114:8086"] # required'
- name: Activa la salida a Graphite
replace:
dest: /etc/telegraf/telegraf.conf
regexp: '^\# \[\[outputs.graphite\]\]$'
replace: '[[outputs.graphite]]'
- name: Configura Telegraf con la IP de Graphite
replace:
dest: /etc/telegraf/telegraf.conf
regexp: '^\# servers \= \[\"localhost\:2003\"\]$'
replace: ' servers = ["192.168.0.118:2003"]'
- name: Activa en Telegraf las métricas de red
replace:
dest: /etc/telegraf/telegraf.conf
regexp: '^\# \[\[inputs.net\]\]$'
replace: '[[inputs.net]]'
- name: Añade squashfs a ignore_fs para no guardar métricas de los snaps
replace:
dest: /etc/telegraf/telegraf.conf
regexp: '^ ignore_fs \= \[\"tmpfs\", \"devtmpfs\", \"devfs\"\]$'
replace: ' ignore_fs = ["tmpfs", "devtmpfs", "devfs", "squashfs"]'
- name: Enumera sda y sdb en diskio para no guardar métricas de los loop
replace:
dest: /etc/telegraf/telegraf.conf
regexp: '^ \# devices \= \[\"sda\", \"sdb\"\]$'
replace: ' devices = ["sda", "sdb"]'