Skip to content

Commit

Permalink
fix(cli): check the account has agents to display
Browse files Browse the repository at this point in the history
Signed-off-by: Salim Afiune Maya <[email protected]>
  • Loading branch information
afiune committed Feb 9, 2022
1 parent 8b056f5 commit 7e4ca27
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli/cmd/agent_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ func listAgents(_ *cobra.Command, _ []string) error {
return cli.OutputJSON(machines)
}

if len(machines) == 0 {
cli.OutputHuman(
"There are no agents running in your account.\n\nTry installing one with 'lacework agent install <host>%s'\n",
cli.OutputNonDefaultProfileFlag(),
)
return nil
}

cli.OutputHuman(
renderSimpleTable(
[]string{"MID", "Short Agent Token", "Hostname", "Name", "IP Address", "External IP", "OS Arch", "Last Checkin"},
Expand Down

0 comments on commit 7e4ca27

Please sign in to comment.