linux 浏览器访问摄像头,Linux奇技淫巧:如何从浏览器监视Linux服务器资源

过去,我们介绍了许多用于监视Linux性能的基于命令行的工具,这里仅举几个例子。例如top,htop,atop,glance等,以及许多基于Web的工具,例如cockpit,pydash,linux-dash。你还可以在web服务器模式下运行glance来监视远程服务器。除此之外,我们还发现了另一个我们希望与您共享的简单服务器监视工具,名为Scout_Realtime。

Scout_Realtime是一个简单,易于使用的基于Web的工具,用于以一种类似top的方式实时监视Linux服务器指标。它显示了有关从CPU,内存,磁盘,网络和进程(前10名)实时收集的指标的流畅图表。

98a689a13ca1838aa1358d251c34803d.png

实时Linux服务器进程监控

在本文中,我们将向您展示如何在Linux系统上安装scout_realtime监视工具以监视远程服务器。

在Linux中安装Scout_Realtime监控工具

1、要在Linux服务器上安装scout_realtime,必须使用以下命令在服务器上安装Ruby 1.9.3+。

linuxmi@linuxmi:~/www.linuxmi.com$ sudo apt-get install rubygems [在 Debian/Ubuntu 上]

linuxmi@linuxmi:~/www.linuxmi.com$ sudo yum -y install rubygems-devel [在 RHEL/CentOS 上]

linuxmi@linuxmi:~/www.linuxmi.com$ sudo dnf -y install rubygems-devel [在 Fedora 22+ 上]

93ab58359aa7e7abf00c8896d8fc794d.png

来自:https://www.linuxmi.com/linux-scout_realtime-top.html

2、在Linux系统上安装了Ruby之后,现在可以使用以下命令安装scout_realtime包。

linuxmi@linuxmi:~/www.linuxmi.com$ sudo gem install scout_realtime

38313b9453da4888374a84715282cec6.png

3、成功安装scout_realtime软件包后,接下来,您需要启动scout_realtime守护程序,该守护程序将实时收集服务器指标,如图所示。

linuxmi@linuxmi:~/www.linuxmi.com$ scout_realtime

/var/lib/gems/2.7.0/gems/scout_realtime-1.0.5/lib/vendor/sinatra-1.4.4/lib/sinatra/base.rb:1208: warning: constant ::Fixnum is deprecated

/var/lib/gems/2.7.0/gems/scout_realtime-1.0.5/lib/vendor/sinatra-1.4.4/lib/sinatra/base.rb:1208: warning: constant ::Fixnum is deprecated

/var/lib/gems/2.7.0/gems/scout_realtime-1.0.5/lib/vendor/sinatra-1.4.4/lib/sinatra/base.rb:1208: warning: constant ::Fixnum is deprecated

/var/lib/gems/2.7.0/gems/scout_realtime-1.0.5/lib/vendor/sinatra-1.4.4/lib/sinatra/base.rb:1208: warning: constant ::Fixnum is deprecated

/var/lib/gems/2.7.0/gems/scout_realtime-1.0.5/lib/vendor/sinatra-1.4.4/lib/sinatra/base.rb:1208: warning: constant ::Fixnum is deprecated

Daemon has started successfully

To view in your browser, do ONE of the following:

A) create an SSH tunnel: ssh -NL 5555:localhost:5555 user@ip_or_hostname (run that command on your own computer, not the server)

then point your browser to: http://localhost:5555

--- OR ---

B) open a port in your firewall: sudo iptables -A INPUT -p tcp --dport 5555 -j ACCEPT (run that command on your server)

then point your browser to: http://your-ip-or-hostname:5555

* FYI, the log file is: /home/linuxmi/.scout/scout_realtime.log

* "scout_realtime stop" to stop the daemon

d5b9ead0332d40dfae0d8cf016f14138.png

在服务器上启动Scout Realtime

4、现在,scout_realtime守护程序正在您要在端口5555上进行远程监视的Linux服务器上运行。如果正在运行防火墙,则需要在防火墙中打开scout_realtime侦听的端口5555,以允许对其发出请求。

---------- 在 Debian/Ubuntu 上----------

$ sudo ufw allow 27017

$sudo ufw reload

---------- 在 RHEL/CentOS 6.x 上 ----------

$ sudo iptables -A INPUT -p tcp --dport 5555 -j ACCEPT

$ sudo service iptables restart

---------- 在 RHEL/CentOS 7.x 上----------

$ sudo firewall-cmd --permanent --add-port=5555/tcp

$ sudo firewall-cmd reload

5、现在,从任何其他机器上,打开Web浏览器,然后使用下面的URL访问scout_realtime来监视远程Linux服务器的性能。

http://localhost:5555

或者

http://ip-address-or-domain.com:5555

39bbc1e756d60503c79ca3dfddbc0958.png

6、默认情况下,scout_realtime日志写在系统上的.scout/scout_realtime.log中,您可以使用cat命令查看。

linuxmi@linuxmi:~$ cat .scout/scout_realtime.log

ef059267e4ccc361ddc0063ef133f9e3.png

7、运行以下命令停止scout_realtime守护进程。

linuxmi@linuxmi:~$ scout_realtime stop

8、使用实例从系统中卸载scout_realtime。

linuxmi@linuxmi:~$ gem uninstall scout_realtime

要了解更多信息,请查看Scout_realtime Github存储库。

就这么简单!Scout_realtime是一个简单而有用的工具,用于以类似top的方式实时监视Linux服务器指标如果还有什么疑问可以在评论中给我们反馈。

【编辑推荐】

【责任编辑:庞桂玉 TEL:(010)68476606】

点赞 0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值