Also added reasonable default for influxdb input plugin

to simplify configuration for most users

closes #1295
This commit is contained in:
Martin Seener
2016-05-30 14:45:21 +02:00
committed by Cameron Sparr
parent 9ff536d94d
commit e809c4e445
4 changed files with 7 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ InfluxDB-formatted endpoints. See below for more information.
## See the influxdb plugin's README for more details.
## Multiple URLs from which to read InfluxDB-formatted JSON
## Default is "http://localhost:8086/debug/vars".
urls = [
"http://localhost:8086/debug/vars"
]

View File

@@ -28,6 +28,7 @@ func (*InfluxDB) SampleConfig() string {
## See the influxdb plugin's README for more details.
## Multiple URLs from which to read InfluxDB-formatted JSON
## Default is "http://localhost:8086/debug/vars".
urls = [
"http://localhost:8086/debug/vars"
]
@@ -35,6 +36,9 @@ func (*InfluxDB) SampleConfig() string {
}
func (i *InfluxDB) Gather(acc telegraf.Accumulator) error {
if len(i.URLs) == 0 {
i.URLs = []string{"http://localhost:8086/debug/vars"}
}
errorChannel := make(chan error, len(i.URLs))
var wg sync.WaitGroup