Nmon (Nigel’s Monitor)是由IBM 提供、免費監控 AIX 系統與 Linux 系統資源的工具。該工具可將服務器系統資源耗用狀況收集起來並輸出一個特定的文件,並可利用 excel 分析工具(nmon analyser)進行數據的統計分析。安全
搜索下載nmon,上傳到服務器解壓。我用一個比較老的版本給你們演示一下。解壓完有nmon16e_x86_rhel65,和nmon analyser v34a.xls。 服務器
啓動nmon的命令以下,啓動後自動後臺運行網絡
./nmon16e_x86_rhel65 -f -s 10 -c 999999999 -m ./
若首次執行失敗提示Permission Denied,執行 ide
chmod +x nmon16e_x86_rhel65 便可。
參數解釋: 工具
[root@localhost nmontest]# ./nmon16e_x86_rhel65 -f -s 10 -c 999999999 -m ./ [root@localhost nmontest]# ls -lrt total 372 -rwxr-xr-x. 1 root root 347506 Jul 1 2016 nmon16e_x86_rhel65 -rw-r--r--. 1 root root 29653 Aug 5 15:02 localhost_200805_1502.nmon
監控文件的名字由「主機名+時間」組成,nmon文件按照採樣間隔,不斷寫入數據 性能
[root@localhost nmontest]# tail -f localhost_200805_1502.nmon VM,T0004,2,0,0,1247,7428,-1,0,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 PROC,T0004,1,0,81.4,-1.0,-1.0,-1.0,0.8,-1.0,-1.0,-1.0 NET,T0004,0.0,0.1,0.0,0.0,0.0,0.1,0.0,0.0 NETPACKET,T0004,0.0,1.5,0.0,0.0,0.0,0.8,0.0,0.0 JFSFILE,T0004,29.6,0.0,1.4,29.6,13.3 DISKBUSY,T0004,0.0,0.0,0.0,0.0,0.0,0.0 DISKREAD,T0004,0.0,0.0,0.0,0.0,0.0,0.0 DISKWRITE,T0004,0.0,0.0,0.0,0.0,0.0,0.0 DISKXFER,T0004,0.0,0.0,0.0,0.0,0.0,0.0
採集結束,關閉nmon excel
[root@localhost nmontest]# ps -ef | grep nmon root 5226 1 0 15:02 pts/0 00:00:00 ./nmon16e_x86_rhel65 -f -s 10 -c 999999999 -m ./ root 6626 3519 0 15:24 pts/0 00:00:00 grep --color=auto nmon [root@localhost nmontest]# kill -9 5226
將nmon文件傳到本地電腦(ASCII格式傳輸),用nmon analyser v34a.xls轉換格式。若是有宏相關的警告,按「工具->宏->安全性->選擇低安全性」便可。
code
會屢次彈窗,問是否替換現有x86定義,全都點擊是。
保存xls格式的文件。打開xls文件。下方標籤名稱表明該標籤監控的硬件指標,
下面是網絡和內存使用的監控指標。
內存
nmon能夠長期採集硬件信息,設置採集間隔大的話對服務器性能影響能夠忽略不計。適用於採集一段時間,例如採集幾天,而後彙總分析的場景。經過分析硬件資源的佔用變化緣由,會有不少新的發現,使咱們對系統的掌握更加透徹。但不適用實時監控的要求。 資源