ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 转载“Linux 下使用 NMON 分析系统性能(转载+实战)”

转载“Linux 下使用 NMON 分析系统性能(转载+实战)”

Linux操作系统 作者:黄妮娜 时间:2018-06-10 15:33:21 0 删除 编辑

转载自:http://bluedata.org/2009/08/31/linux-nmon/

下载相应 CPU 类型的版本:
Pv [*c+H0http://nmon.sourceforge.net/pmwiki.php?n=Site.DownloadITPUB个人空间[;}u(q$Br
wgethttp://sourceforge.net/projects/nmon/files/download/nmon_x86_12a.zip/download

unzip nmon_x86_12a.zip
Bp+\ C1N0Archive:  nmon_x86_12a.zip
mL;rC x%tR0  inflating: nmon_x86_rhel45
'K_c-y4Xu0  inflating: nmon_x86_rhel52
.I:ZFI M v,jp0  inflating: nmon_x86_sles9ITPUB个人空间)Pw(c6`(P&W
  inflating: nmon_x86_sles10
!}b#{t+o!BV0  inflating: nmon_x86_ubuntu810ITPUB个人空间ST#pco$V])q
  inflating: nmon_x86_fedora10ITPUB个人空间"OS!?CtR
  inflating: nmon_x86_opensuse10

使用对应的操作系统文件:
_O*|[QQrje0chmod +x nmon_x86_ubuntu810ITPUB个人空间\}B6a u&s&cs {
mv nmon_x86_ubuntu810 /usr/local/bin/nmon

对于 Debian 还要做以下操作(不做也同样能运行):
:i%uD.gO0apt-get install lsb-releaseITPUB个人空间9I2jTR8\-_d
lsb_release -d | sed 's/Description:\t//' > /etc/debian_release

然后直接运行 nmon 即可。

ITPUB个人空间$S/ie$c\ U
采集数据并生成报表:ITPUB个人空间CPV&M?,@_+i/t
采集数据:ITPUB个人空间1g/o,vI3Dr
nmon -s10 -c60 -f -m /home/

参数解释:ITPUB个人空间\i$N$v;|`8q&D#xN
-s10 每 10 秒采集一次数据。ITPUB个人空间 P`rt$M1P;y*j'Tm$b
-c60 采集 60 次,即为采集十分钟的数据。ITPUB个人空间~&RF8|F;G)o xd%PY/Y
-f 生成的数据文件名中包含文件创建的时间。ITPUB个人空间x ]?S"Q;J H[q
-m 生成的数据文件的存放目录。

这样就会生成一个 nmon 文件,并每十秒更新一次,直到十分钟后。
4Oi7XD y }-L1X0生成的文件名如: hostname_090824_1306.nmon ,"hostname" 是这台主机的主机名。

生成报表:ITPUB个人空间dO5Zp.zj K3V
下载 nmon analyser (生成性能报告的免费工具):ITPUB个人空间 FP,pQ"e0l&mW
http://www.ibm.com/developerworks/wikis/display/Wikiptype/nmonanalyser

把之前生成的 nmon 数据文件传到 Windows 机器上,用 Excel 打开分析工具 nmon analyser v33C.xls 。点击 Excel 文件中的 "Analyze nmon data" 按钮,选择 nmon 数据文件,这样就会生成一个分析后的结果文件: hostname_090824_1306.nmon.xls ,用 Excel 打开生成的文件就可以看到结果了。

如果宏不能运行,需要做以下操作:ITPUB个人空间 C^} uz'wI4O? i
工具 -> 宏 -> 安全性 -> 中,然后再打开文件并允许运行宏。

自动按天采集数据:
2? |5zp"|D0在 crontab 中增加一条记录:
_-l A\8m]0Dc00 0 * * * root nmon -s300 -c288 -f -m /home/ > /dev/null 2>&1

300*288=86400 秒,正好是一天的数据。

参考资料:
1L ^)H)e;L{ ]V0nmon for Linux:ITPUB个人空间-Hi9f#t0Y;g6\({
http://nmon.sourceforge.net/pmwiki.php

nmon 性能:分析 AIX 和 Linux 性能的免费工具:
#{vND3`[*`_0http://www.ibm.com/developerworks/cn/aix/library/analyze_aix/index.html

nmon analyser —— 生成 AIX 性能报告的免费工具:ITPUB个人空间(|w!K'x j"xo
http://www.ibm.com/developerworks/cn/aix/library/nmon_analyser/index.html

实战:ITPUB个人空间L0@.Rkv3jL
ITPUB个人空间,Z(q Kp3cB+Z"\
Linux内核:2.6.18-164.el5
:]8Fz}G/uX A0ITPUB个人空间"L:\SN \/Ib
1.到RPM SEARCH查找对应的RPM包,下载:
7_i t0J"O0
http://rpm.pbone.net/index.php3/stat/4/idpl/12088655/com/nmon-11f-1.el5.rf.x86_64.rpm.htmlITPUB个人空间'Kz c.THa6gz

F3I'H'L eU2s4|"V02.安装:ITPUB个人空间,y9Y:eo[
rpm -ivh nmon-11f-1.el5.rf.x86_64.rpm

3.使用:
G {-_'W8n |9Rkj0yI0具体使用见上面转载的文章。
zl.~.o)blE,HxV%d0或
Zp8ME:Qn |5N0查看帮助nmon -h

 

./n

cannot execute binary file.

看不出介质是针对linux哪个平台,于是进一步检查Linux版本

引用
[ora9201@hzmc linux]$ uname -a
Linux hzmc 2.6.18-53.el5xen #1 SMP Mon Nov 12 03:26:12 EST 2007 i686 i686 i386 GNU/Linux


 

引用
[ora9201@hzmc linux]$ file /sbin/init
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped


可以看到这是英特尔x86系列CPU:80386,即i386

进一步检查nmon介质版本

引用
[ora9201@hzmc linux]$ file nmon_x86_rhel45
nmon_x86_rhel45: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped



 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31541547/viewspace-2155915/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2018-06-10

  • 博文量
    1
  • 访问量
    317