Skip to content

Commit

Permalink
wip: change alertsUrl endPoint in commands and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gdiazlo committed Mar 19, 2019
1 parent baa047d commit 6cbe080
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/agent_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ func newAgentMonitorCommand(ctx *cmdContext, config gossip.Config, agentPreRun f
// Bindings
monitorConfig.MetricsAddr = config.BindAddr // TODO: make MetricsAddr configurable
monitorConfig.QEDUrls = v.GetStringSlice("agent.server_urls")
monitorConfig.PubUrls = v.GetStringSlice("agent.alert_urls")
monitorConfig.AlertsUrls = v.GetStringSlice("agent.alerts_urls")

markSliceStringRequired(monitorConfig.QEDUrls, "qedUrls")
markSliceStringRequired(monitorConfig.PubUrls, "pubUrls")
markSliceStringRequired(monitorConfig.AlertsUrls, "alertsUrls")
},
Run: func(cmd *cobra.Command, args []string) {

config.Role = member.Monitor
monitorConfig.APIKey = ctx.apiKey

monitor, err := monitor.NewMonitor(*monitorConfig)
monitor, err := monitor.NewMonitor(monitorConfig)
if err != nil {
log.Fatalf("Failed to start the QED monitor: %v", err)
}
Expand All @@ -77,7 +77,7 @@ func newAgentMonitorCommand(ctx *cmdContext, config gossip.Config, agentPreRun f

f := cmd.Flags()
f.StringSliceVarP(&monitorConfig.QEDUrls, "qedUrls", "", []string{}, "Comma-delimited list of QED servers ([host]:port), through which a monitor can make queries")
f.StringSliceVarP(&monitorConfig.PubUrls, "pubUrls", "", []string{}, "Comma-delimited list of QED servers ([host]:port), through which an monitor can publish alerts")
f.StringSliceVarP(&monitorConfig.AlertsUrls, "alertsUrls", "", []string{}, "Comma-delimited list of QED servers ([host]:port), through which an monitor can publish alerts")

// Lookups
v.BindPFlag("agent.server_urls", f.Lookup("qedUrls"))
Expand Down

0 comments on commit 6cbe080

Please sign in to comment.