From e04e1a4e3b78e09584afe564c47782723762f4a4 Mon Sep 17 00:00:00 2001 From: Martin Seener Date: Thu, 26 May 2016 11:25:21 +0200 Subject: [PATCH] Fixes #1277 Use the DefaultURL parameter if no url is explicitly set by the user --- plugins/inputs/rabbitmq/rabbitmq.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/inputs/rabbitmq/rabbitmq.go b/plugins/inputs/rabbitmq/rabbitmq.go index 4d119282d..6d5379438 100644 --- a/plugins/inputs/rabbitmq/rabbitmq.go +++ b/plugins/inputs/rabbitmq/rabbitmq.go @@ -146,7 +146,11 @@ func (r *RabbitMQ) Gather(acc telegraf.Accumulator) error { } func (r *RabbitMQ) requestJSON(u string, target interface{}) error { - u = fmt.Sprintf("%s%s", r.URL, u) + url := r.URL + if url == "" { + url = DefaultURL + } + u = fmt.Sprintf("%s%s", url, u) req, err := http.NewRequest("GET", u, nil) if err != nil {