zl程序教程

您现在的位置是:首页 >  云平台

当前栏目

glances 监控

2023-09-14 09:16:04 时间

安装

curl -L https://bit.ly/glances | /bin/bash

运行

glances

在这里插入图片描述

web 访问

glances -w

设置web 密码

mkdir ~/.config/glances
cp /usr/local/share/doc/glances/glances.conf /root/.config/glances
glances -w --password
  • 用户名默认为 glances,设置密码
# glances -w --password
Define the Glances webserver password (glances username):
Password (confirm):
Do you want to save the password? [Yes/No]: yes
Glances Web User Interface started on http://0.0.0.0:61208/

忘记密码

cd ~/.config/glances/
rm glances.pwd

服务方式运行

vim /etc/systemd/system/glances.service
[Unit]
Description=Glances
After=network.target

[Service]
ExecStart=/usr/local/bin/glances -w --password
Restart=on-abort
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
systemctl enable glances.service
systemctl start glances.service
systemctl status glances.service

参考

  1. glances
  2. Glances pdf