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

@@ -146,13 +146,12 @@ func (r *RabbitMQ) Gather(acc telegraf.Accumulator) error {
}
func (r *RabbitMQ) requestJSON(u string, target interface{}) error {
url := r.URL
if url == "" {
url = DefaultURL
if r.URL == "" {
r.URL = DefaultURL
}
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 {
return err
}