2009年5月13日星期三

nmon的使用笔记

ref: http://www.alidba.net/index.php/archives/227

因为工作中也用到了,刚好看到,实现一下,我的环境是Oracle Enterprose Linux 5.2不过基本上可以跑,记录如下:

工具下载: http://www.ibm.com/developerworks/wikis/display/WikiPtype/nmon

下载包:
[root@croracle03 nmon]# wget -c http://www.ibm.com/developerworks/wikis/download/attachments/53871937/nmon_x86_64_rhel4.zip?version=2
--02:56:03-- http://www.ibm.com/developerworks/wikis/download/attachments/53871937/nmon_x86_64_rhel4.zip?version=2
Resolving www.ibm.com... 129.42.60.216
Connecting to www.ibm.com|129.42.60.216|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 73468 (72K) [application/x-zip-compressed]
--02:56:05-- (try: 2) http://www.ibm.com/developerworks/wikis/download/attachments/53871937/nmon_x86_64_rhel4.zip?version=2
Reusing existing connection to www.ibm.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 73468 (72K) [application/x-zip-compressed]
Saving to: `nmon_x86_64_rhel4.zip'

100%[=======================================>] 73,468 83.5K/s in 0.9s

02:56:07 (83.5 KB/s) - `nmon_x86_64_rhel4.zip' saved [73468/73468]

解压:

[root@croracle03 nmon]# unzip nmon_x86_64_rhel4.zip
Archive: nmon_x86_64_rhel4.zip
inflating: nmon_x86_64_rhel4

赋权限:
[root@croracle03 nmon]# chmod +x nmon_x86_64_rhel4

建立目录:
[root@croracle03 nmon]# mkdir bin data

[root@croracle03 nmon]# mv nmon_x86_64_rhel4 ./bin

编辑脚本:
[root@croracle03 bin]# vi nmon.sh
[root@croracle03 bin]# chmod +x nmon.sh

#!/bin/ksh
# written by ivan 20090513 for nmon

BINPATH=`dirname $0`
NPATH=$BINPATH/../data
$BINPATH/nmon_x86_64_rhel4 -s300 -c288 -f -m$NPATH

跑起来

[root@croracle03 bin]# ./nmon.sh

查看结果:
[root@croracle03 nmon]# cd data
[root@croracle03 data]# ls
croracle03_090514_0301.nmon
[root@croracle03 data]# ls -lh
total 20K
-rw-r--r-- 1 root root 20K May 14 03:11 croracle03_090514_0301.nmon

因为是一天的,所以等待明天看一下结果如何!

没有评论:

发表评论