diff --git a/api/agent.go b/api/agent.go index 936ac1e4c19..fdd5ff891d9 100644 --- a/api/agent.go +++ b/api/agent.go @@ -244,7 +244,6 @@ type MonitorFrame struct { // Monitor returns a channel which will receive streaming logs from the agent // Providing a non-nil stopCh can be used to close the connection and stop log streaming func (a *Agent) Monitor(stopCh <-chan struct{}, q *QueryOptions) (<-chan *StreamFrame, <-chan error) { - errCh := make(chan error, 1) r, err := a.client.newRequest("GET", "/v1/agent/monitor") if err != nil { diff --git a/command/agent/monitor/monitor_test.go b/command/agent/monitor/monitor_test.go index bb6cedaf224..edf1f84f5c0 100644 --- a/command/agent/monitor/monitor_test.go +++ b/command/agent/monitor/monitor_test.go @@ -61,7 +61,6 @@ func TestMonitor_DroppedMessages(t *testing.T) { } received := "" - passed := make(chan struct{}) go func() { for { diff --git a/command/agent_monitor.go b/command/agent_monitor.go index ba5dbd0dfc2..3fc86d48cd7 100644 --- a/command/agent_monitor.go +++ b/command/agent_monitor.go @@ -74,6 +74,13 @@ func (c *MonitorCommand) Run(args []string) int { return 1 } + args = flags.Args() + if l := len(args); l != 0 { + c.Ui.Error("This command takes no arguments") + c.Ui.Error(commandErrorText(c)) + return 1 + } + client, err := c.Meta.Client() if err != nil { c.Ui.Error(fmt.Sprintf("Error initializing client: %s", err))