惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
博客园 - 聂微东
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
罗磊的独立博客
H
Help Net Security
L
LangChain Blog
T
Threat Research - Cisco Blogs
量子位
S
Securelist
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
The Hacker News
The Hacker News
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
T
Threatpost
Security Latest
Security Latest
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
F
Full Disclosure
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Heimdal Security Blog
J
Java Code Geeks
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
B
Blog RSS Feed
月光博客
月光博客
C
Cisco Blogs
V
Visual Studio Blog
D
DataBreaches.Net
H
Hacker News: Front Page
博客园 - 叶小钗
N
News and Events Feed by Topic
爱范儿
爱范儿
A
Arctic Wolf

xnum’s blog

2025/03 初春日本四國遊記 2024/8 菲律賓遊學記 使用DNS紀錄來自動更新IP白名單 lvremove 遇到 contains a filesystem in use 多媒體檔案管理和下載伺服器 - 軟體篇 淘寶退貨 順豐寄回大陸經驗 在dnsmasq加上自動生成PTR紀錄 ultrahuman ring air 台灣購買兼使用心得 AI Singing Voice Conversion (SVC) 的試玩心得
在Linux上面安裝glances並設定為系統服務
Jia Jun Yeh · 2024-05-23 · via xnum’s blog

由於在 Docker 中無法查看某些系統資訊,加上需要指定版本,因此需要進行一個繁瑣的 Python 程式安裝流程。

首先,我們需要建立一個虛擬環境來隔離即將安裝的依賴,以免影響系統的穩定性。

apt install python3 python3-venv

接下來,建立一個虛擬環境:

python3 -m venv /root/_glances
source /root/_glances/bin/activate

接著,安裝 Glances。如果需要使用 Web UI,則需要額外安裝 FastAPI。

pip3 install Glances
pip3 install FastAPI

以下是 systemd 的服務配置檔案,將其放置於 /etc/systemd/system/glances.service

[Unit]
Description=Glances
Documentation=man:glances(1)
Documentation=https://github.com/nicolargo/glances
After=network.target

[Service]
ExecStart=/root/_glances/bin/python3 -m glances -w
Restart=on-abort

[Install]
WantedBy=multi-user.target

完成上述步驟後,啟用並啟動 Glances 服務:

systemctl daemon-reload
systemctl enable glances
systemctl start glances

這樣就完成了在 Linux 上安裝並設定 Glances 為系統服務的步驟。現在,你可以透過 Web UI 來監控你的系統狀態了。