監控工具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