Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made the apache input’s urls parameter optional by using a reasonable default user input #1288

Merged
merged 1 commit into from
May 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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