Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Commit

Permalink
info: use bind_host when querying /debug/vars (#428)
Browse files Browse the repository at this point in the history
This fixes a problem where the `info` command was failing due to a
non-standard `bind_host` setting. The `info` command was always
attempting to reach the /debug/vars endpoint on `localhost`. This would
of course not work when the `bind_host` value was different.

Fixes DataDog/dd-agent#3653
  • Loading branch information
gbbr authored Jun 1, 2018
1 parent 0e3db25 commit 47ab0e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions info/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"net/http"
"os"
"regexp"
"strconv"
"strings"
"sync"
"text/template"
Expand Down Expand Up @@ -332,7 +331,7 @@ func Info(w io.Writer, conf *config.AgentConfig) error {
if host == "0.0.0.0" {
host = "127.0.0.1" // [FIXME:christian] not fool-proof
}
url := "http://localhost:" + strconv.Itoa(conf.ReceiverPort) + "/debug/vars"
url := fmt.Sprintf("http://%s:%d/debug/vars", conf.ReceiverHost, conf.ReceiverPort)
client := http.Client{Timeout: 3 * time.Second}
resp, err := client.Get(url)
if err != nil {
Expand Down

0 comments on commit 47ab0e3

Please sign in to comment.