diff --git a/pkg/hostman/hostmetrics/hostmetrics.go b/pkg/hostman/hostmetrics/hostmetrics.go index f75923e750..faab9b0f9d 100644 --- a/pkg/hostman/hostmetrics/hostmetrics.go +++ b/pkg/hostman/hostmetrics/hostmetrics.go @@ -39,7 +39,7 @@ import ( ) const ( - TelegrafServer = "http://localhost:8087/write" + TelegrafServer = "http://127.0.0.1:8087/write" MeasurementsPrefix = "vm_" ) diff --git a/pkg/hostman/system_service/system_service.go b/pkg/hostman/system_service/system_service.go index 852d0eb138..1576f50f4f 100644 --- a/pkg/hostman/system_service/system_service.go +++ b/pkg/hostman/system_service/system_service.go @@ -100,6 +100,8 @@ func (s *SBaseSystemService) reloadConf(conf, conFile string) (bool, error) { oldConf := string(output) if strings.TrimSpace(conf) != strings.TrimSpace(oldConf) { log.Debugf("Reload service %s ...", s.name) + log.Debugf("oldConf: [%s]", oldConf) + log.Debugf("newConf: [%s]", conf) err := procutils.NewRemoteCommandAsFarAsPossible("rm", "-f", conFile).Run() if err != nil { return false, err diff --git a/pkg/hostman/system_service/telegraf.go b/pkg/hostman/system_service/telegraf.go index cf333ad7d9..3802d09206 100644 --- a/pkg/hostman/system_service/telegraf.go +++ b/pkg/hostman/system_service/telegraf.go @@ -177,7 +177,7 @@ func (s *STelegraf) GetConfig(kwargs map[string]interface{}) string { conf += " collect_memstats = false\n" conf += "\n" conf += "[[inputs.http_listener]]\n" - conf += " service_address = \"localhost:8087\"\n" + conf += " service_address = \"127.0.0.1:8087\"\n" conf += "\n" return conf } @@ -211,7 +211,7 @@ func (s *STelegraf) BgReloadConf(kwargs map[string]interface{}) { func (s *STelegraf) ReloadTelegraf() error { log.Infof("Start reolad telegraf...") - telegrafReoladUrl := "http://localhost:8087/reload" + telegrafReoladUrl := "http://127.0.0.1:8087/reload" _, _, err := httputils.JSONRequest( httputils.GetDefaultClient(), context.Background(), "POST", telegrafReoladUrl, nil, nil, false,