要安裝 rtop 確定你已經在 linux 中安裝了 go(golang)1.2 或更高版本,否則請點選下面的連結根據步驟安裝 golang:
<a href="http://www.tecmint.com/install-go-in-linux/" target="_blank">在 linux 中安裝 golang (go 程式設計語言)</a>
<a target="_blank"></a>
如果你已經安裝了 go,運作下面的指令建構 rtop:
<code>$ go get github.com/rapidloop/rtop</code>
指令完成後 rtop 可執行程式會儲存在 $gopath/bin 或者 $gobin 中。

在 linux 中建構 rtop
注意:使用 rtop 不需要任何運作時環境或配置。
嘗試不用任何标志或參數運作 rtop, 會顯示如下資訊:
<code>$ $gobin/rtop</code>
示例輸出:
<code>rtop 1.0 - (c) 2015 rapidloop - mit licensed - http://rtop-monitor.org</code>
<code>rtop monitors server statistics over an ssh connection</code>
<code>usage: rtop [-i private-key-file] [user@]host[:port] [interval]</code>
<code>-i private-key-file</code>
<code>pem-encoded private key file to use (default: ~/.ssh/id_rsa if present)</code>
<code>[user@]host[:port]</code>
<code>the ssh server to connect to, with optional username and port</code>
<code>interval</code>
<code>refresh interval in seconds (default: 5)</code>
現在讓我們用 rtop 監控遠端 linux 伺服器,預設每 5 秒重新整理收集到的資訊:
<code>$ $gobin/rtop [email protected]</code>
rtop – 監控遠端 linux 主機
指令會每隔 10 秒重新整理系統性能名額:
<code>$ $gobin/rtop [email protected] 10</code>
原文釋出時間為:2017-02-13
本文來自雲栖社群合作夥伴“linux中國”