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

Glances  WebServer 模式

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

建立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================"
相关文章
相关标签/搜索