diff --git a/agent/config/config.go b/agent/config/config.go index 5b49ca6cf4..bc416b822f 100644 --- a/agent/config/config.go +++ b/agent/config/config.go @@ -231,6 +231,7 @@ func get(args []string, cfg *Config, l *logrus.Entry) (string, error) { //nolint &cfg.Paths.PTPGSummary: "tools/pt-pg-summary", &cfg.Paths.PTMongoDBSummary: "tools/pt-mongodb-summary", &cfg.Paths.PTMySQLSummary: "tools/pt-mysql-summary", + &cfg.Paths.Nomad: "tools/nomad", } { if *sp == "" { *sp = v @@ -396,6 +397,8 @@ func Application(cfg *Config) (*kingpin.Application, *string) { Envar("PMM_AGENT_PATHS_PT_MONGODB_SUMMARY").StringVar(&cfg.Paths.PTMongoDBSummary) app.Flag("paths-pt-mysql-summary", "Path to pt my sql summary to use [PMM_AGENT_PATHS_PT_MYSQL_SUMMARY]"). Envar("PMM_AGENT_PATHS_PT_MYSQL_SUMMARY").StringVar(&cfg.Paths.PTMySQLSummary) + app.Flag("paths-nomad", "Path to nomad to use [PMM_AGENT_PATHS_NOMAD]"). + Envar("PMM_AGENT_PATHS_NOMAD").StringVar(&cfg.Paths.Nomad) app.Flag("paths-tempdir", "Temporary directory for exporters [PMM_AGENT_PATHS_TEMPDIR]"). Envar("PMM_AGENT_PATHS_TEMPDIR").StringVar(&cfg.Paths.TempDir) // no flag for SlowLogFilePrefix - it is only for development and testing diff --git a/agent/config/config_test.go b/agent/config/config_test.go index 0533a7c7b3..554bf9690d 100644 --- a/agent/config/config_test.go +++ b/agent/config/config_test.go @@ -120,6 +120,7 @@ func TestGet(t *testing.T) { PTPGSummary: "/usr/local/percona/pmm/tools/pt-pg-summary", PTMySQLSummary: "/usr/local/percona/pmm/tools/pt-mysql-summary", PTMongoDBSummary: "/usr/local/percona/pmm/tools/pt-mongodb-summary", + Nomad: "/usr/local/percona/pmm/tools/nomad", }, WindowConnectedTime: defaultWindowPeriod, Ports: Ports{ @@ -180,6 +181,7 @@ func TestGet(t *testing.T) { PTPGSummary: "/usr/local/percona/pmm/tools/pt-pg-summary", PTMongoDBSummary: "/usr/local/percona/pmm/tools/pt-mongodb-summary", PTMySQLSummary: "/usr/local/percona/pmm/tools/pt-mysql-summary", + Nomad: "/usr/local/percona/pmm/tools/nomad", }, WindowConnectedTime: defaultWindowPeriod, Ports: Ports{ @@ -239,6 +241,7 @@ func TestGet(t *testing.T) { PTPGSummary: "/usr/local/percona/pmm/tools/pt-pg-summary", PTMySQLSummary: "/usr/local/percona/pmm/tools/pt-mysql-summary", PTMongoDBSummary: "/usr/local/percona/pmm/tools/pt-mongodb-summary", + Nomad: "/usr/local/percona/pmm/tools/nomad", }, WindowConnectedTime: defaultWindowPeriod, Ports: Ports{ @@ -306,6 +309,7 @@ func TestGet(t *testing.T) { PTPGSummary: "/usr/local/percona/pmm/tools/pt-pg-summary", PTMongoDBSummary: "/usr/local/percona/pmm/tools/pt-mongodb-summary", PTMySQLSummary: "/usr/local/percona/pmm/tools/pt-mysql-summary", + Nomad: "/usr/local/percona/pmm/tools/nomad", }, WindowConnectedTime: defaultWindowPeriod, Ports: Ports{ @@ -371,6 +375,7 @@ func TestGet(t *testing.T) { PTPGSummary: "/base/tools/pt-pg-summary", PTMongoDBSummary: "/base/tools/pt-mongodb-summary", PTMySQLSummary: "/base/tools/pt-mysql-summary", + Nomad: "/base/tools/nomad", }, WindowConnectedTime: defaultWindowPeriod, Ports: Ports{ @@ -434,6 +439,7 @@ func TestGet(t *testing.T) { PTPGSummary: "/base/tools/pt-pg-summary", PTMongoDBSummary: "/base/tools/pt-mongodb-summary", PTMySQLSummary: "/base/tools/pt-mysql-summary", + Nomad: "/base/tools/nomad", }, WindowConnectedTime: defaultWindowPeriod, Ports: Ports{ @@ -482,6 +488,7 @@ func TestGet(t *testing.T) { PTPGSummary: "/usr/local/percona/pmm/tools/pt-pg-summary", PTMongoDBSummary: "/usr/local/percona/pmm/tools/pt-mongodb-summary", PTMySQLSummary: "/usr/local/percona/pmm/tools/pt-mysql-summary", + Nomad: "/usr/local/percona/pmm/tools/nomad", }, WindowConnectedTime: defaultWindowPeriod, Ports: Ports{