Linux
1 宝塔面板安装 docker 管理面板
2 宝塔面板开启61208端口(可不开)
3 运行docker命令
docker run -d --restart="always" --name glances -p 61208-61209:61208-61209 -e GLANCES_OPT="-w" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host docker.io/nicolargo/glances
Windows
1 安装 Python 2.7.9+ or 3.4+ ship with pip 环境
2 管理员方式启动powershell安装 glances
pip install glances bottle
3 然后开出站端口61208
4 powshell后台网页启动 glances
start-job{glances -w}
Android
1 安装Termux APK
2 打开Termux 安装glances
apt update
apt upgrade
apt install clang python
pip install glances bottle
3 网页启动glances
macOS
MacPorts
sudo port install glances
FreeBSD
To install the binary package:
pkg install py37-glances
To install Glances from ports:
cd /usr/ports/sysutils/py-glances/
make install clean
Glances 自动安装脚本:简单的方法
要安装依赖项和最新的 Glances 生产就绪版本(又名master分支),只需输入以下命令行:
curl -L https://bit.ly/glances | /bin/bash
或者
wget -O- https://bit.ly/glances | /bin/bash
注意:这仅在某些 GNU/Linux 发行版和 Mac OS X 上受支持。
Docker:有趣的方式
Glances 容器是可用的。您可以使用它来监控您的服务器和所有其他容器!
获取 Glances 容器:
docker pull nicolargo/glances:<版本>
Docker Hub 存储库上的可用版本:
nicolargo/glances:最新的基本 Debian Glances 映像版本,具有最少的依赖关系
nicolargo/glances:alpine-latest用于具有最小依赖性的基本 Alpine Glances 映像版本
nicolargo/glances:latest-full用于包含所有依赖项的完整 Debian Glances 映像版本
nicolargo/glances:alpine-latest-full用于包含所有依赖项的完整 Alpine Glances 映像版本
您还可以通过将 latest 替换为 3.2.3(例如)来指定版本。
在控制台模式下运行最新版本的 Glances 容器:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it nicolargo/glances:latest-full
此外,如果您想使用自己的 Glances.conf 文件,您可以创建自己的 Dockerfile:
FROM nicolargo/glances:latest
COPY glances.conf /glances/conf/glances.conf
CMD python -m glances -C /glances/conf/glances.conf $GLANCES_OPT
或者,您可以使用 docker run 选项指定相同的内容:
docker run -v `pwd`/glances.conf:/glances/conf/glances.conf -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host -it nicolargo/glances :最新完整
其中`pwd`/glances.conf 是包含glances.conf 文件的本地目录。
以Web服务器模式运行容器(注意glances启动命令的GLANCES_OPT环境变量设置参数):
docker run -d --restart="always" -p 61208-61209:61208-61209 -e GLANCES_OPT="-w" -v /var/run/docker.sock:/var/run/docker.sock:ro - -pid 主机 nicolargo/glances:latest-full