Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

Linux 系統監控神器 Collectl 安裝與實戰指令大全

編輯:關於 Linux

Collectl 是輕量級、全方位的 Linux 效能監控工具,整合 vmstat、iostat、netstat 等功能,支援即時顯示、CSV 匯出、守護進程模式與模組化擴充。適用於 Ubuntu/Debian、RHEL/CentOS、Arch 等主流發行版。

安裝 Collectl

# Ubuntu / Debian
sudo apt-get install collectl

# RHEL / CentOS / Fedora
yum install collectl

# Arch Linux
pacman -S collectl

子系統速查表

Collectl 透過 -s 參數指定監控子系統,大寫為詳細模式:

代碼子系統說明
c / CCPU總覽 / 各核心詳細
d / DDisk磁碟 I/O 總覽 / 各裝置詳細
m / MMemory記憶體使用總覽 / NUMA 節點詳細
n / NNetwork網路流量總覽 / 各介面詳細
sSockets通訊端統計
tTCPTCP 計數器
ZProcesses進程詳細資訊
b, f, i, j, l, x, y其他Buddy、NFS、Inode、Interrupt、Lustre、Interconnect、Slab

常用指令範例

# CPU 總覽
collectl -sc

# 各核心 CPU 詳細
collectl -sC

# 記憶體總覽
collectl -sm

# 記憶體詳細 (含 NUMA)
collectl -sM

# 磁碟 I/O 總覽
collectl -sd

# 磁碟各裝置詳細
collectl -sD

# 磁碟詳細 + 額外資訊
collectl -sd --verbose

# 多子系統同時監控 (CPU+記憶體+磁碟+網路)
collectl -scmdn

# 指定取樣間隔 5 秒,持續 10 次
collectl -scmdn -i 5 -c 10

# 輸出 CSV 供 Excel/gnuplot 分析
collectl -scmdn -P -f /var/log/collectl/

Collectl 輸出範例

優勢: Collectl 單一工具即可替代多個傳統指令,且支援模組化擴充、精確時間戳記、彩色輸出與 CSV 匯出,極適合效能調校與自動化監控腳本。
Copyright © Windows教程網 All Rights Reserved