Skip to content

Commit

Permalink
Made the apache input’s urls parameter optional by using a reasonable…
Browse files Browse the repository at this point in the history
… default for most users (influxdata#1288)
  • Loading branch information
martinseener authored and sparrc committed May 27, 2016
1 parent ca504a1 commit 984b6cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions etc/telegraf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@
# # Read Apache status information (mod_status)
# [[inputs.apache]]
# ## An array of Apache status URI to gather stats.
# ## Default is "http://localhost/server-status?auto".
# urls = ["http://localhost/server-status?auto"]


Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/apache/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Telegraf plugin: Apache

#### Plugin arguments:
- **urls** []string: List of apache-status URLs to collect from.
- **urls** []string: List of apache-status URLs to collect from. Default is "http://localhost/server-status?auto".

#### Description

Expand Down
5 changes: 5 additions & 0 deletions plugins/inputs/apache/apache.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Apache struct {

var sampleConfig = `
## An array of Apache status URI to gather stats.
## Default is "http://localhost/server-status?auto".
urls = ["http://localhost/server-status?auto"]
`

Expand All @@ -33,6 +34,10 @@ func (n *Apache) Description() string {
}

func (n *Apache) Gather(acc telegraf.Accumulator) error {
if len(n.Urls) == 0 {
n.Urls = []string{"http://localhost/server-status?auto"}
}

var wg sync.WaitGroup
var outerr error

Expand Down

0 comments on commit 984b6cb

Please sign in to comment.