萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 作業系統 >  >> Linux 教學

Linux 安裝與使用 Glances 系統監控工具(支援多種輸出格式)

Glances 是基於 Python 的跨平台系統監控工具,支援 CPU、記憶體、磁碟、網路、感測器等監控,並可輸出 HTML/CSV、以 Server/Client 模式遠端監控。本文說明安裝需求、pip 安裝流程與常用參數。

安裝需求

  • Python ≥ 2.6
  • psutil ≥ 0.4.1

安裝步驟

pip install psutil
pip install pysensors
pip install hddtemp
git clone https://github.com/nicolargo/glances.git
cd glances
python setup.py install

常用參數速查

glances -h           # 顯示說明
glances -b           # 網路速率以 Byte/sec 顯示
glances -c @IP       # Client 模式連接 Server
glances -s           # Server 模式啟動
glances -p PORT      # 指定 TCP 埠(預設 61209)
glances -o HTML      # 輸出 HTML 報表
glances -o CSV       # 輸出 CSV 檔案
glances -t 5         # 重新整理間隔 5 秒
glances -1           # 每顆 CPU 獨立顯示
glances -e           # 啟用感測器模組(需 pysensors)
glances -y           # 啟用 hddtemp(需 hddtemp daemon)

Glances 執行畫面

小結

Glances 整合多項系統指標於單一介面,支援遠端監控與報表匯出,是系統管理員替代 top/htop 的優秀選擇。

copyright © 萬盛學電腦網 all rights reserved