Fixes #1277 Use the DefaultURL parameter if no url is explicitly set by the user
This commit is contained in:
parent
a8334c3261
commit
e04e1a4e3b
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue