Initial commit

This commit is contained in:
2021-04-09 19:57:32 +02:00
commit fecc1d77d4
25 changed files with 637 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
- name: Restart telegraf
service:
name=telegraf
state=restarted
+33
View File
@@ -0,0 +1,33 @@
---
- name: Add repository
yum_repository:
name: influxrepo
description: InfluxDB Repository - RHEL
baseurl: https://repos.influxdata.com/rhel/8/x86_64/stable/
gpgkey: https://repos.influxdata.com/influxdb.key
gpgcheck: yes
- name: Install influx packages
yum:
name: "{{ item }}"
loop:
- telegraf
- influxdb2
- name: enable telegraf
systemd:
name: telegraf
enabled: yes
- name: enable influxdb
systemd:
name: influxdb
enabled: yes
state: started
- name: create telegraf config from template
template:
src: telegraf.conf.j2
dest: /etc/telegraf/telegraf.conf
mode: '0644'
notify: Restart telegraf
@@ -0,0 +1,31 @@
[global_tags]
# Configuration for telegraf agent
[agent]
interval = "10s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 100000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
debug = false
quiet = false
logfile = ""
hostname = ""
omit_hostname = false
[[inputs.tail]]
files = ["/home/beieli/mini-beieli-lorahandler/mini-beieli-lorahandler.log"]
from_beginning = false
pipe = false
tagexclude = ["path","host"]
data_format = "influx"
# Configuration for sending metrics to InfluxDB 2.0
[[outputs.influxdb_v2]]
urls = ["http://127.0.0.1:8086"]
token = "{{ influx_token }}"
organization = "minibeieliorg"
bucket = "minibeielibucket"