监控工具glances安装


yum install epel* -y

yum install python-pip python-devel -y

yum install glances -y

yum install iftop -y 

yum install htop -y

#glances

 

 

 

WebServer 模式

在 glances 的 WebServer 模式下,客户端只通过浏览器访问就可以获取远程服务器的运行状态。该模式需要额外安装 Python 的 Bottle 模块:
pip install bottle
安装成功后,使用 glances -w 命令即可开启 WebServer 模式。
客户端使用浏览器访问 http://SERVER_IP:61208/ 进入监控界面。

将 WebServer 模式配置为系统服务

1.创建 Unit 文件
sudo vim /etc/systemd/system/glancesweb.service
文件内容如下:

[Unit] Description = Glances in Web Server Mode After = network.target [Service]
# glances路径因安装方法不同根据实际情况确定,可使用 which glances 命令获取
ExecStart = /usr/bin/glances -w -t 5
[Install]
WantedBy = multi-user.target

2. 启用 systemd 服务并运行

systemctl enable glancesweb
systemctl start glancesweb
systemctl status glancesweb


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM