diff --git a/managed/services/agents/node.go b/managed/services/agents/node.go index 0189db757b..8f98fdf1b6 100644 --- a/managed/services/agents/node.go +++ b/managed/services/agents/node.go @@ -32,7 +32,7 @@ import ( // with the basic auth users. var v2_27_99 = version.MustParse("2.27.99") -func nodeExporterConfig(node *models.Node, exporter *models.Agent, agentVersion *version.Parsed) (*agentpb.SetStateRequest_AgentProcess, error) { +func nodeExporterConfig(node *models.Node, exporter *models.Agent, agentVersion *version.Parsed , listenInterface string) (*agentpb.SetStateRequest_AgentProcess, error) { tdp := models.TemplateDelimsPair( pointer.GetString(exporter.MetricsPath), ) @@ -44,8 +44,9 @@ func nodeExporterConfig(node *models.Node, exporter *models.Agent, agentVersion "--web.disable-exporter-metrics", // we enable them as a part of HR metrics - "--web.listen-address=:" + tdp.Left + " .listen_port " + tdp.Right, - } +// "--web.listen-address=:" + tdp.Left + " .listen_port " + tdp.Right, + "--web.listen-address=" + listenInterface + ":" + tdp.Left + " .listen_port " + tdp.Right, +} // do not tweak collectors on macOS as many (but not) of them are Linux-specific if node.Distro != "darwin" { diff --git a/managed/services/agents/state.go b/managed/services/agents/state.go index 1bf2dc043b..e42f058fb7 100644 --- a/managed/services/agents/state.go +++ b/managed/services/agents/state.go @@ -190,7 +190,9 @@ func (u *StateUpdater) sendSetStateRequest(ctx context.Context, agent *pmmAgentI return err } - params, err := nodeExporterConfig(node, row, pmmAgentVersion) + //params, err := nodeExporterConfig(node, row, pmmAgentVersion) + listenInterface := "127.0.0.1" // Change this to the desired IP address or interface + params, err := nodeExporterConfig(node, exporter, agentVersion, listenInterface) if err != nil { return err }