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

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
T
Threat Research - Cisco Blogs
小众软件
小众软件
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
S
Secure Thoughts
O
OpenAI News
P
Proofpoint News Feed
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
T
Tenable Blog
A
Arctic Wolf
L
LINUX DO - 热门话题
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
博客园 - Franky
WordPress大学
WordPress大学
Know Your Adversary
Know Your Adversary
博客园_首页
雷峰网
雷峰网
IT之家
IT之家
PCI Perspectives
PCI Perspectives
L
LINUX DO - 最新话题
H
Heimdal Security Blog

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 來監控你的系統狀態了。