From cd40999225dd51edaee918012deda147bb1c5d97 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Tue, 5 Sep 2017 12:55:21 -0700 Subject: [PATCH] Use ip address for default InfluxDB ip in config Helps with initial setup if localhost cannot be resolved due to the pure go resolver. --- etc/telegraf.conf | 42 ++++++++++++++++++++-------- etc/telegraf_windows.conf | 4 +-- plugins/inputs/fluentd/README.md | 4 +-- plugins/inputs/fluentd/fluentd.go | 4 +-- plugins/outputs/influxdb/README.md | 4 +-- plugins/outputs/influxdb/influxdb.go | 4 +-- 6 files changed, 41 insertions(+), 21 deletions(-) diff --git a/etc/telegraf.conf b/etc/telegraf.conf index ee0c00be0..4831f934b 100644 --- a/etc/telegraf.conf +++ b/etc/telegraf.conf @@ -90,8 +90,8 @@ ## ## Multiple urls can be specified as part of the same cluster, ## this means that only ONE of the urls will be written to each interval. - # urls = ["udp://localhost:8089"] # UDP endpoint example - urls = ["http://localhost:8086"] # required + # urls = ["udp://127.0.0.1:8089"] # UDP endpoint example + urls = ["http://127.0.0.1:8086"] # required ## The target database for metrics (telegraf will create it if not exists). database = "telegraf" # required @@ -121,6 +121,9 @@ ## HTTP Proxy Config # http_proxy = "http://corporate.proxy:3128" + ## Optional HTTP headers + # http_headers = {"X-Special-Header" = "Special-Value"} + ## Compress each HTTP request payload using GZIP. # content_encoding = "gzip" @@ -382,12 +385,32 @@ # # ## Kinesis StreamName must exist prior to starting telegraf. # streamname = "StreamName" -# ## PartitionKey as used for sharding data. +# ## DEPRECATED: PartitionKey as used for sharding data. # partitionkey = "PartitionKey" -# ## If set the paritionKey will be a random UUID on every put. +# ## DEPRECATED: If set the paritionKey will be a random UUID on every put. # ## This allows for scaling across multiple shards in a stream. # ## This will cause issues with ordering. # use_random_partitionkey = false +# ## The partition key can be calculated using one of several methods: +# ## +# ## Use a static value for all writes: +# # [outputs.kinesis.partition] +# # method = "static" +# # key = "howdy" +# # +# ## Use a random partition key on each write: +# # [outputs.kinesis.partition] +# # method = "random" +# # +# ## Use the measurement name as the partition key: +# # [outputs.kinesis.partition] +# # method = "measurement" +# # +# ## Use the value of a tag for all writes, if the tag is not set the empty +# ## string will be used: +# # [outputs.kinesis.partition] +# # method = "tag" +# # key = "host" # # # ## Data format to output. @@ -1095,10 +1118,7 @@ # # Read metrics from fail2ban. # [[inputs.fail2ban]] -# ## fail2ban-client require root access. -# ## Setting 'use_sudo' to true will make use of sudo to run fail2ban-client. -# ## Users must configure sudo to allow telegraf user to run fail2ban-client with no password. -# ## This plugin run only "fail2ban-client status". +# ## Use sudo to run fail2ban-client # use_sudo = false @@ -1126,7 +1146,7 @@ # ## - only one URI is allowed # ## - https is not supported # endpoint = "http://localhost:24220/api/plugins.json" -# +# # ## Define which plugins have to be excluded (based on "type" field - e.g. monitor_agent) # exclude = [ # "monitor_agent", @@ -2382,10 +2402,10 @@ # ## Use SSL but skip chain & host verification # # insecure_skip_verify = false # -# ## Data format to output. +# ## Data format to consume. # ## 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_OUTPUT.md +# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md # data_format = "influx" diff --git a/etc/telegraf_windows.conf b/etc/telegraf_windows.conf index 535b0f414..ed5ce1fba 100644 --- a/etc/telegraf_windows.conf +++ b/etc/telegraf_windows.conf @@ -63,8 +63,8 @@ # The full HTTP or UDP endpoint URL for your InfluxDB instance. # Multiple urls can be specified but it is assumed that they are part of the same # cluster, this means that only ONE of the urls will be written to each interval. - # urls = ["udp://localhost:8089"] # UDP endpoint example - urls = ["http://localhost:8086"] # required + # urls = ["udp://127.0.0.1:8089"] # UDP endpoint example + urls = ["http://127.0.0.1:8086"] # required # The target database for metrics (telegraf will create it if not exists) database = "telegraf" # required # Precision of writes, valid values are "ns", "us" (or "µs"), "ms", "s", "m", "h". diff --git a/plugins/inputs/fluentd/README.md b/plugins/inputs/fluentd/README.md index e316bddf2..e46428417 100644 --- a/plugins/inputs/fluentd/README.md +++ b/plugins/inputs/fluentd/README.md @@ -22,11 +22,11 @@ example configuratio with `@id` parameter for http plugin: [[inputs.fluentd]] ## This plugin reads information exposed by fluentd (using /api/plugins.json endpoint). ## - ## Endpoint: + ## Endpoint: ## - only one URI is allowed ## - https is not supported endpoint = "http://localhost:24220/api/plugins.json" - + ## Define which plugins have to be excluded (based on "type" field - e.g. monitor_agent) exclude = [ "monitor_agent", diff --git a/plugins/inputs/fluentd/fluentd.go b/plugins/inputs/fluentd/fluentd.go index fdb6dbaa5..ba8dba802 100644 --- a/plugins/inputs/fluentd/fluentd.go +++ b/plugins/inputs/fluentd/fluentd.go @@ -18,11 +18,11 @@ const ( sampleConfig = ` ## This plugin reads information exposed by fluentd (using /api/plugins.json endpoint). ## - ## Endpoint: + ## Endpoint: ## - only one URI is allowed ## - https is not supported endpoint = "http://localhost:24220/api/plugins.json" - + ## Define which plugins have to be excluded (based on "type" field - e.g. monitor_agent) exclude = [ "monitor_agent", diff --git a/plugins/outputs/influxdb/README.md b/plugins/outputs/influxdb/README.md index 31326c918..c6ddf3586 100644 --- a/plugins/outputs/influxdb/README.md +++ b/plugins/outputs/influxdb/README.md @@ -13,8 +13,8 @@ This plugin writes to [InfluxDB](https://www.influxdb.com) via HTTP or UDP. ## ## Multiple urls can be specified as part of the same cluster, ## this means that only ONE of the urls will be written to each interval. - # urls = ["udp://localhost:8089"] # UDP endpoint example - urls = ["http://localhost:8086"] # required + # urls = ["udp://127.0.0.1:8089"] # UDP endpoint example + urls = ["http://127.0.0.1:8086"] # required ## The target database for metrics (telegraf will create it if not exists). database = "telegraf" # required diff --git a/plugins/outputs/influxdb/influxdb.go b/plugins/outputs/influxdb/influxdb.go index f2f946513..5780cb72c 100644 --- a/plugins/outputs/influxdb/influxdb.go +++ b/plugins/outputs/influxdb/influxdb.go @@ -59,8 +59,8 @@ var sampleConfig = ` ## ## Multiple urls can be specified as part of the same cluster, ## this means that only ONE of the urls will be written to each interval. - # urls = ["udp://localhost:8089"] # UDP endpoint example - urls = ["http://localhost:8086"] # required + # urls = ["udp://127.0.0.1:8089"] # UDP endpoint example + urls = ["http://127.0.0.1:8086"] # required ## The target database for metrics (telegraf will create it if not exists). database = "telegraf" # required