Skip to content

Commit

Permalink
fix: top info
Browse files Browse the repository at this point in the history
  • Loading branch information
DVKunion committed Mar 7, 2023
1 parent c6c241f commit 7c3bbf2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Collar 作为 Collie 牧羊犬的项圈,希望能让用户更加舒适的管

目前已支持的功能模块:

+ 主机列表
+ 进程列表
+ shell终端
+ 主机列表(输出优化中)
+ 进程列表(输出优化中)

## 开始使用

Expand Down Expand Up @@ -43,6 +43,7 @@ Collar 作为 Collie 牧羊犬的项圈,希望能让用户更加舒适的管
获取主机列表信息。

### 进程列表

`collar top [hostId/host_name/host_ip/host_inner_ip]`

获取主机进程信息, 每3s更新一次。
Expand All @@ -51,7 +52,7 @@ Collar 作为 Collie 牧羊犬的项圈,希望能让用户更加舒适的管

`collar shell [hostId/host_name/host_ip/host_inner_ip]`

可以通过 主机ID/主机名/主机IP/主机内网IP 进行登录。
可以通过 主机ID/主机名/主机IP/主机内网IP 进行登录。

**使用自动登陆模式**

Expand Down
6 changes: 5 additions & 1 deletion cmd/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ func hosts(cmd *cobra.Command, args []string) error {
}

func process(cmd *cobra.Command, args []string) error {
resp, err := sdk.GetProcessList(args[0])
hostId := utils.Trans2HostId(args[0])
if hostId == "" {
return errors.New("host offline or not exists,use `collar hosts` to check host status。")
}
resp, err := sdk.GetProcessList(hostId)
if err != nil {
return err
}
Expand Down

0 comments on commit 7c3bbf2

Please sign in to comment.