From 9c7bf9c9958512d84cd31ca8da7038649950aeb7 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Tue, 20 Nov 2018 14:32:18 -0500 Subject: [PATCH] Common Module - Telegraf Logic --- salt/common/telegraf/etc/telegraf.conf | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/salt/common/telegraf/etc/telegraf.conf b/salt/common/telegraf/etc/telegraf.conf index 9d3f57807..bbc8d0a54 100644 --- a/salt/common/telegraf/etc/telegraf.conf +++ b/salt/common/telegraf/etc/telegraf.conf @@ -563,11 +563,14 @@ # # Read stats from one or more Elasticsearch servers or clusters +{% if grains['role'] == 'so-master' or grains['role'] == 'so-eval' %} [[inputs.elasticsearch]] + # ## specify a list of one or more Elasticsearch servers # # you can add username and password to your url to use basic authentication: # # servers = ["http://user:pass@localhost:9200"] servers = ["http://{{ MASTER }}:9200"] +{% endif %} # # ## Timeout for HTTP requests to the elastic search server(s) # http_timeout = "5s" @@ -604,11 +607,30 @@ # # Read metrics from one or more commands that can output to stdout - [[inputs.exec]] + # ## Commands array +{% if grains['role'] == 'so-master' %} +[[inputs.exec]] + commands = [ + "/scripts/redis.sh" + ] + data_format = "influx" +{% elseif grains['role'] == 'so-SENSOR' %} +[[inputs.exec]] commands = [ "/scripts/stenoloss.sh" ] + data_format = "influx" + +{% elseif grains['role'] == 'so-eval' %} +[[inputs.exec]] + commands = [ + "/scripts/redis.sh", + "/scripts/stenoloss.sh" + ] + data_format = "influx" +{% endif %} + # # ## Timeout for each command to complete. # timeout = "5s" @@ -620,7 +642,7 @@ # ## Each data format has its own unique set of configuration options, read # ## more about them here: # ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md - data_format = "influx" + # # Read metrics from fail2ban.