From 77ff6d2c82537762f1967a8f27307623c266679d Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Mon, 30 Mar 2020 16:35:48 +0200 Subject: [PATCH] influx config --- global/overlay/etc/hiera/data/common.yaml | 3 +++ .../etc/puppet/modules/eid/manifests/telegraf.pp | 4 +++- .../etc/telegraf/telegraf.conf.d/99-influxdb2.conf | 13 +++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 global/overlay/etc/telegraf/telegraf.conf.d/99-influxdb2.conf diff --git a/global/overlay/etc/hiera/data/common.yaml b/global/overlay/etc/hiera/data/common.yaml index 4e3c1200..02288df3 100644 --- a/global/overlay/etc/hiera/data/common.yaml +++ b/global/overlay/etc/hiera/data/common.yaml @@ -73,3 +73,6 @@ redis_sentinel_ips: - 94.176.224.138 - 94.176.224.9 - 94.176.224.10 + +influxdb2_org: SwedenConnect +influxdb2_bucket: eidas diff --git a/global/overlay/etc/puppet/modules/eid/manifests/telegraf.pp b/global/overlay/etc/puppet/modules/eid/manifests/telegraf.pp index 859ff6e2..0745a194 100644 --- a/global/overlay/etc/puppet/modules/eid/manifests/telegraf.pp +++ b/global/overlay/etc/puppet/modules/eid/manifests/telegraf.pp @@ -2,7 +2,9 @@ require stdlib require concat class eid::telegraf(String $version = "stable") { - $influxdb2_token = hiera("influxdb2_token","NOT_SET_IN_HIERA") + $influxdb2_token = hiera("influxdb2_token","NOT_SET_IN_HIERA"); + $influxdb2_org = hiera("influxdb2_org","NOT_SET_IN_HIERA"); + $influxdb2_bucket = hiera("influxdb2_bucket","NOT_SET_IN_HIERA"); file {['/etc/telegraf','/etc/telegraf/telegraf.conf.d']: ensure => directory } concat {'/etc/telegraf/telegraf.conf': owner => 'root', diff --git a/global/overlay/etc/telegraf/telegraf.conf.d/99-influxdb2.conf b/global/overlay/etc/telegraf/telegraf.conf.d/99-influxdb2.conf new file mode 100644 index 00000000..8c5d9f61 --- /dev/null +++ b/global/overlay/etc/telegraf/telegraf.conf.d/99-influxdb2.conf @@ -0,0 +1,13 @@ +[[outputs.influxdb_v2]] + ## The URLs of the InfluxDB cluster nodes. + ## + ## Multiple URLs can be specified for a single cluster, only ONE of the + ## urls will be written to each interval. + ## urls exp: http://127.0.0.1:9999 + urls = ["https://metrics.sunet.se:9999"] + ## Token for authentication. + token = "${INFLUXDB2_TOKEN}" + ## Organization is the name of the organization you wish to write to; must exist. + organization = "${INFLUXDB2_ORG}" + ## Destination bucket to write into. + bucket = "${INFLUXDB2_BUCKET}"