Update telegraf to use influx2

This commit is contained in:
Wilfried OLLIVIER 2022-06-01 20:34:48 +02:00
parent f91c55e3e1
commit 32f9eda9b6
6 changed files with 4584 additions and 617 deletions

View File

@ -1,9 +1,7 @@
---
db_name: telegraf
db_user: telegraf
db_pass: not24get
influx_host: localhost
influx_proto: http
influx_port: 8086
bucket_name: telegraf-bucket
org_name: papey

View File

@ -5,13 +5,12 @@ galaxy_info:
license: WTFPL
min_ansible_version: 2.4
min_ansible_version: "2.4"
platforms:
- name: Debian
versions:
- Stretch
- Buster
- name: Debian
versions:
- "bullseye"
galaxy_tags:
- telegraf

View File

@ -1,5 +1,4 @@
---
# https://docs.influxdata.com/telegraf/v1.11/introduction/installation/
- name: Ensure apt-transport-https
@ -8,17 +7,12 @@
state: present
update_cache: yes
- name: Ensure python dependencies
apt:
name: [ 'python-requests', 'python-pip' ]
state: present
- name: Ensure Influx Data signing key
- name: Ensure influxdata signing key
apt_key:
url: "{{ influx.repo }}"
state: present
- name: Ensure Influx Data repo
- name: Ensure influxdata repo
apt_repository:
repo: deb https://repos.influxdata.com/debian {{ ansible_distribution_release }} stable
state: present
@ -54,7 +48,7 @@
- name: Ensure Telegraf can access Docker socket
user: name=telegraf
group=telegraf
groups=docker
append=yes
group=telegraf
groups=docker
append=yes
when: "'docker' in services"

View File

@ -31,10 +31,6 @@
## Timeout for docker list, info, and stats commands
timeout = "5s"
## Whether to report for each container per-device blkio (8:0, 8:1...) and
## network (eth0, eth1, ...) stats or not
perdevice = true
## Whether to report for each container total blkio and network stats or not
total = false

View File

@ -91,77 +91,12 @@
# OUTPUT PLUGINS #
###############################################################################
# Configuration for sending metrics to InfluxDB
[[outputs.influxdb]]
## The full HTTP or UDP URL for your InfluxDB instance.
##
## Multiple URLs can be specified for a single cluster, only ONE of the
## urls will be written to each interval.
# urls = ["unix:///var/run/influxdb.sock"]
# urls = ["udp://127.0.0.1:8089"]
# urls = ["http://127.0.0.1:8086"]
# Configuration for sending metrics to InfluxDB v2
[[outputs.influxdb_v2]]
urls = ["{{ influx_proto }}://{{ influx_host }}:{{ influx_port }}"]
## The target database for metrics; will be created as needed.
## For UDP url endpoint database needs to be configured on server side.
database = "{{ db_name }}"
## The value of this tag will be used to determine the database. If this
## tag is not set the 'database' option is used as the default.
# database_tag = ""
## If true, no CREATE DATABASE queries will be sent. Set to true when using
## Telegraf with a user without permissions to create databases or when the
## database already exists.
skip_database_creation = true
## Name of existing retention policy to write to. Empty string writes to
## the default retention policy. Only takes effect when using HTTP.
# retention_policy = ""
## Write consistency (clusters only), can be: "any", "one", "quorum", "all".
## Only takes effect when using HTTP.
write_consistency = "any"
## Timeout for HTTP messages.
timeout = "5s"
## HTTP Basic Auth
username = "{{ db_user }}"
password = "{{ db_pass }}"
## HTTP User-Agent
# user_agent = "telegraf"
## UDP payload size is the maximum packet size to send.
# udp_payload = "512B"
## Optional TLS Config for use on HTTP connections.
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
## HTTP Proxy override, if unset values the standard proxy environment
## variables are consulted to determine which proxy, if any, should be used.
# http_proxy = "http://corporate.proxy:3128"
## Additional HTTP headers
# http_headers = {"X-Special-Header" = "Special-Value"}
## HTTP Content-Encoding for write request body, can be set to "gzip" to
## compress body or "identity" to apply no encoding.
# content_encoding = "identity"
## When true, Telegraf will output unsigned integers as unsigned values,
## i.e.: "42u". You will need a version of InfluxDB supporting unsigned
## integer values. Enabling this option will result in field type errors if
## existing data has been written.
# influx_uint_support = false
token = "{{ _telegraf_token }}"
organization = "{{ org_name }}"
bucket = "{{ bucket_name }}"
# # Configuration for Amon Server to send metrics to.
# [[outputs.amon]]

File diff suppressed because it is too large Load Diff