Glances - Linux上的实时系统监控工具(Centos安装)

Glances  WebServer 模式

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

创建glances-install.sh ,内容如下。(记得赋予执行权限:chmod +x glances-install.sh)

#!/bin/bash

echo "Installing glances..."
yum install -y glances

echo "Installing pip bottle..."
pip install bottle


(
cat <<EOF
[Unit]
Description = Glances in Web Server Mode
After = network.target
[Service]
ExecStart = /usr/bin/glances  -w  -t  5
[Install]
WantedBy = multi-user.target
EOF
) > /etc/systemd/system/glancesweb.service


systemctl enable glancesweb

echo "Starting glancesweb..."
systemctl start glancesweb

echo "=================Glancesweb started================"

 

 
 
posted @ 2019-09-06 15:27  Don  阅读(468)  评论(0编辑  收藏  举报