Added telegraf role
This commit is contained in:
parent
5a211c975a
commit
01adf37d9c
|
@ -0,0 +1,11 @@
|
|||
[tags]
|
||||
|
||||
# Configuration for telegraf agent
|
||||
[agent]
|
||||
debug = false
|
||||
flush_buffer_when_full = true
|
||||
flush_interval = "15s"
|
||||
flush_jitter = "0s"
|
||||
hostname = "planet-casio.com"
|
||||
interval = "15s"
|
||||
round_interval = true
|
|
@ -0,0 +1,5 @@
|
|||
# Read metrics about CPU usage
|
||||
[[inputs.cpu]]
|
||||
percpu = false
|
||||
totalcpu = true
|
||||
fieldpass = [ "usage*" ]
|
|
@ -0,0 +1,3 @@
|
|||
# Read metrics about disk usagee
|
||||
[[inputs.disk]]
|
||||
mount_points=["/"]
|
|
@ -0,0 +1,4 @@
|
|||
# Read metrics about diskio usage
|
||||
[[inputs.diskio]]
|
||||
devices = ["vda1"]
|
||||
skip_serial_number = true
|
|
@ -0,0 +1,3 @@
|
|||
# Read metrics about memory usage
|
||||
[[inputs.mem]]
|
||||
# no configuration
|
|
@ -0,0 +1,4 @@
|
|||
# Read metrics about network usage
|
||||
[[inputs.net]]
|
||||
interfaces = [ "eth0" ]
|
||||
fielddrop = [ "icmp*", "ip*", "tcp*", "udp*" ]
|
|
@ -0,0 +1,3 @@
|
|||
# Read metrics about Nginx requests
|
||||
[[inputs.nginx]]
|
||||
urls = ["http://127.0.0.1:8080/nginx-status"]
|
|
@ -0,0 +1,3 @@
|
|||
# Read metrics about swap memory usage
|
||||
[[inputs.swap]]
|
||||
# no configuration
|
|
@ -0,0 +1,3 @@
|
|||
# Read metrics about system load & uptime
|
||||
[[inputs.system]]
|
||||
# no configuration
|
|
@ -0,0 +1,3 @@
|
|||
# Read metrics about systemd services
|
||||
[[inputs.systemd_units]]
|
||||
# no configuration
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
- name: "Install telegraf" # Yeah I know, quite useless
|
||||
pacman:
|
||||
name: "telegraf"
|
||||
state: present
|
||||
|
||||
- name: "Make configuration structure"
|
||||
file:
|
||||
path: "/etc/telegraf/telegraf.d"
|
||||
state: directory
|
||||
|
||||
- name: "Copy main configuration"
|
||||
file:
|
||||
src: 'telegraf.conf'
|
||||
dest: '/etc/telegraf/'
|
||||
owner: 'telegraf'
|
||||
mode: 0644
|
||||
|
||||
- name: "Copy telegraf.d files"
|
||||
file:
|
||||
src: '{{ item }}'
|
||||
dest: '/etc/telegraf/telegraf.d/'
|
||||
owner: 'telegraf'
|
||||
mode: 0644
|
||||
with_fileglob: 'telegraf.d/*.conf'
|
||||
|
||||
- name: "Copy outputs.conf with influxdb password"
|
||||
template:
|
||||
src: 'outputs.conf'
|
||||
dest: '/etc/telegraf/telegraf.d/'
|
||||
owner: 'telegraf'
|
||||
mode: 0600
|
||||
|
||||
- name: "Reloading telegraf"
|
||||
service:
|
||||
name: "telegraf"
|
||||
state: reloaded
|
|
@ -0,0 +1,7 @@
|
|||
# Setup outputs
|
||||
[[outputs.influxdb]]
|
||||
database = "telegraf"
|
||||
precision = "s"
|
||||
urls = [ "http://127.0.0.1:8086" ]
|
||||
username = "telegraf"
|
||||
password = "{{ lookup('passwordstore', 'PCv5/telegraf_influxdb') }}"
|
Loading…
Reference in New Issue