Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and use rtop in Linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

In this article Xiaobian introduces in detail "how to install and use rtop in Linux", the content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to install and use rtop in Linux" can help you solve your doubts.

Rtop is a simple agentless remote server monitoring tool that works based on SSH connections. There is no need to install any software on the monitored server. Rtop connects to the server to be monitored directly through SSH, and then executes commands to collect monitoring data.

System environment

Centos8

Install golang

Check to see if the system has golang installed:

[root@server1 ~] # rpm-qa | grep golang

If it is found that it has not been installed, use the yum list golang command to check whether there is a modified installation package in the remote warehouse:

[root@server1] # yum list golangRepository AppStream is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository PowerTools is listed more than once in the configurationRepository centosplus is listed more than once in the configurationAvailable Packagesgolang.x86_64 1.14.12-1.module_el8.3.0+605+410c5674 AppStream

It is found that there is a golang installation package in the AppStream source, so let's start the installation:

[root@server1 ~] # yum-y install golang

To use the Go language, create a workspace under the user's home directory. The Go language saves all files here:

[root@server1] # mkdir-p / go_proj/bin

Set the GOPATH and GOBIN environment variables. GOPATH is the project workspace, add the following two lines to the ~ / .bashrc configuration file:

[root@server1 ~] # vim ~ / .bashrcexport GOPATH=$HOME/go_projexport GOBIN=$GOPATH/bin install rtop

Run the go get command to build the rtop. The rtop binaries are automatically saved under $GOPATH/bin. Before running go get, make sure that the git tools are installed on the system:

[root@server1 ~] # yum-y install git [root@server1 ~] # go get github.com/rapidloop/rtoppackage git:/github.com/rapidloop/rtop: git:/github.com/rapidloop/rtop: invalid import path: malformed import path "git:/github.com/rapidloop/rtop": invalid char':'[root@server1 ~] # go get github.com/rapidloop/rtoppackage golang.org/x/crypto/ssh: unrecognized import path "golang.org/x/crypto/ssh": https fetch: Get "https://golang.org/x/crypto/ssh?go-get=1": dial tcp 216.239.37.1 https://golang.org/x/crypto/ssh?go-get=1": 443: connect: connection refusedpackage golang.org/x/crypto/ssh/agent: unrecognized import path" golang.org/x/crypto/ssh/agent ": https fetch: Get" https://golang.org/x/crypto/ssh/agent?go-get=1": dial tcp 216.239.37.1 Visu 443: connect: connection refusedpackage golang.org/x/crypto/ssh/terminal: unrecognized Import path "golang.org/x/crypto/ssh/terminal": https fetch: Get "https://golang.org/x/crypto/ssh/terminal?go-get=1": dial tcp 216.239.37.1 https://golang.org/x/crypto/ssh/terminal?go-get=1": 443: connect: connection refused

After running go get, I found that the dependency package could not be downloaded.

Do the following to create a directory and manually git to download related dependencies:

[root@server1 ~] # mkdir-p $GOPATH/src/golang.org/x/ [root@server1 x] # git clone https://github.com/golang/crypto.git[root@server1 x] # git clone https://github.com/golang/term.git[root@server1 x] # git clone https://github.com/golang/sys.git

Just run go get again:

[root@server1 x] # go get github.com/rapidloop/rtop

You can see below that rtop is working properly.

How to use rtop

The rtop binaries exist in, so just run GOBIN/ rtop`. Just add the remote host information and use the rtop command to monitor. The refresh interval defaults to 5 seconds.

[root@server1 ~] # $GOBIN/rtop root@192.168.43.131

Manually set the refresh interval for better monitoring. The 2-second refresh interval is set here.

[root@server1 ~] # $GOBIN/rtop root@192.168.43.131 2

After reading this, the article "how to install and use rtop in Linux" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it yourself. If you want to know more about the article, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report