Made the apache input’s urls parameter optional by using a reasonable default for most users (#1288)
This commit is contained in:
parent
ca504a19ec
commit
984b6cb0fb
|
@ -454,6 +454,7 @@
|
||||||
# # Read Apache status information (mod_status)
|
# # Read Apache status information (mod_status)
|
||||||
# [[inputs.apache]]
|
# [[inputs.apache]]
|
||||||
# ## An array of Apache status URI to gather stats.
|
# ## An array of Apache status URI to gather stats.
|
||||||
|
# ## Default is "http://localhost/server-status?auto".
|
||||||
# urls = ["http://localhost/server-status?auto"]
|
# urls = ["http://localhost/server-status?auto"]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Telegraf plugin: Apache
|
# Telegraf plugin: Apache
|
||||||
|
|
||||||
#### Plugin arguments:
|
#### 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
|
#### Description
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ type Apache struct {
|
||||||
|
|
||||||
var sampleConfig = `
|
var sampleConfig = `
|
||||||
## An array of Apache status URI to gather stats.
|
## An array of Apache status URI to gather stats.
|
||||||
|
## Default is "http://localhost/server-status?auto".
|
||||||
urls = ["http://localhost/server-status?auto"]
|
urls = ["http://localhost/server-status?auto"]
|
||||||
`
|
`
|
||||||
|
|
||||||
|
@ -33,6 +34,10 @@ func (n *Apache) Description() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Apache) Gather(acc telegraf.Accumulator) error {
|
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 wg sync.WaitGroup
|
||||||
var outerr error
|
var outerr error
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue