天天看點

Linux下系統資源監控工具Collectl基本介紹

collectl 是一個輕量級的性能監控工具,可監控包括 cpu、磁盤、帶寬、記憶體、網絡、nfs、程序等等資訊。

對系統資源的監控,是系統管理者的一個必備的任務,我們經常需要監控系統資源以便解決相應的系統問題。linux系統也自帶很多的監控工具,如top、vmstat、iostat、sar等,對這些工具的熟練使用時非常重要的,但是這些工具太散了,有時候我們可能會需要看一些更全面地資料,collectl就是一個這樣的超級工具。之前我已經介紹過ibm的監控工具nmon了,nmon監控也是非常全面的,而且可視化做的也非常好,但是相對nmon的話,collectl是支援socket發送資料,對于很多機器的監控,nmon得開很多的視窗,而collectl隻需在一個視窗就能看到所有機器的資料,是以必須要推薦之!

unlike most monitoring tools that eitherfocus on a small set of statistics, format their output in only one way, runeither interatively or as a daemon but not both, collectl tries to do it all.you can choose to monitor any of a broad set of subsystems which

currentlyinclude buddyinfo, cpu, disk, inodes, infiniband, lustre, memory, network, nfs,processes, quadrics, slabs, sockets and tcp.

不同于大多數的監控工具那樣集中于一小部分資料的統計,然後以一種方式格式化輸出資料,以互動的方式或作為一個守護程序背景運作,但是不能同時支援兩種方式,collectl嘗試實作以上所有的功能。你可以選擇監控任何一個廣大子系統的一個子集,這些子系統包括buddyinfo,

cpu, disk, inodes, infiniband, lustre,memory, network, nfs, processes, quadrics, slabs, sockets and tcp資訊。

下面的框圖顯示,collectl是遠遠超過一個工具,從/ proc中讀取資料,将其結果寫入到一個檔案中,或在終端上。花幾分鐘的時間研究這個圖可以幫助更好地了解不同的方式,你可能會更有效地使用collectl。正如你可以看到,有一個資料可以按照不同的路徑和哪些需要取決于你所選擇的選項。

Linux下系統資源監控工具Collectl基本介紹

interactive mode

this is the default and in this mode datais read from /proc and passes throughanalyze. it is really nothing morethan a function that looks at the change between the current and previousvalues. it then divides by the duration of the interval (unless

you specicify-on) and produces the rate, for those values that are indeed rate based. thisfunction is also responsible for formatting/disposing the output. more on thatin a little while.

互動模式

這是預設的模式,在這種模式下資料從/ proc讀取并且分析。這實在是沒有什麼特殊的功能,就是着眼于目前和之前值之間的變化。此功能,負責格式化/配置輸出。

record mode

data passes from /proc the same way as interactivemode but instead of going through theanalyze function it written itto a file. by eliminating the calculations and formatting, this is the mostefficient path the data can take and is why

collectl it so light-weight whenrun in this way.

錄制模式

資料的收集同互動模式一樣通過/proc目錄,但是該模式會通過分析把結果寫入到一個檔案之中。通過排除計算和格式化的輸出,這是最有效的方法收集資料并且為什麼collectl通過此種方式運作時是如此輕量級的。

playback mode

here collectl works virtually identical to interactivemode except instead of reading data from /proc it reads it from a file.this means all the switches that control data formatting still apply. there arealso a couple of switches that allow you

to select the time period from whichyou want to play back data.

回放模式

這個模式同互動模式類似,隻是該軟體擷取資料的途徑不是從/proc檔案系統,而是從一個檔案中擷取資料。這意味着所有的選項都是依然可以應用的。這兒也有一個開關可以允許你選擇檢視資料的時間段回放。

其他關于collectl工具介紹的連結:

<a href="http://blog.csdn.net/zhangxinrun/article/details/5626055">http://blog.csdn.net/zhangxinrun/article/details/5626055</a>

繼續閱讀