Removed extra url variable for the existence check and added CHANGELOG feature line as well as removed #required tag in the sample config

This commit is contained in:
Martin Seener 2016-05-26 12:28:30 +02:00
parent e04e1a4e3b
commit 83ab52a231
3 changed files with 5 additions and 5 deletions

View File

@ -24,6 +24,7 @@ time before a new metric is included by the plugin.
- [#1264](https://github.com/influxdata/telegraf/pull/1264): Add SSL config options to http_response plugin. - [#1264](https://github.com/influxdata/telegraf/pull/1264): Add SSL config options to http_response plugin.
- [#1272](https://github.com/influxdata/telegraf/pull/1272): graphite parser: add ability to specify multiple tag keys, for consistency with influxdb parser. - [#1272](https://github.com/influxdata/telegraf/pull/1272): graphite parser: add ability to specify multiple tag keys, for consistency with influxdb parser.
- [#1265](https://github.com/influxdata/telegraf/pull/1265): Make dns lookups for chrony configurable. Thanks @zbindenren! - [#1265](https://github.com/influxdata/telegraf/pull/1265): Make dns lookups for chrony configurable. Thanks @zbindenren!
- [#1278](https://github.com/influxdata/telegraf/pull/1278): RabbitMQ input: made url parameter optional by using DefaultURL (http://localhost:15672) if not specified
### Bugfixes ### Bugfixes

View File

@ -1176,7 +1176,7 @@
# # Read metrics from one or many RabbitMQ servers via the management API # # Read metrics from one or many RabbitMQ servers via the management API
# [[inputs.rabbitmq]] # [[inputs.rabbitmq]]
# url = "http://localhost:15672" # required # # url = "http://localhost:15672"
# # name = "rmq-server-1" # optional tag # # name = "rmq-server-1" # optional tag
# # username = "guest" # # username = "guest"
# # password = "guest" # # password = "guest"

View File

@ -146,13 +146,12 @@ func (r *RabbitMQ) Gather(acc telegraf.Accumulator) error {
} }
func (r *RabbitMQ) requestJSON(u string, target interface{}) error { func (r *RabbitMQ) requestJSON(u string, target interface{}) error {
url := r.URL if r.URL == "" {
if url == "" { r.URL = DefaultURL
url = DefaultURL
} }
u = fmt.Sprintf("%s%s", url, u) u = fmt.Sprintf("%s%s", url, u)
req, err := http.NewRequest("GET", u, nil) req, err := http.NewRequest("GET", r.URL, nil)
if err != nil { if err != nil {
return err return err
} }