ITPub博客

首页 > Linux操作系统 > Linux操作系统 > nmon使用

nmon使用

原创 Linux操作系统 作者:sky850623 时间:2015-06-09 19:30:40 0 删除 编辑


一.下载nmon。

根据CPU的类型选择下载相应的版本:
http://nmon.sourceforge.net/pmwiki.php?n=Site.Download
或 http://sourceforge.net/projects/nmon/files/download/nmon_x86_12a.zip/download

二.初始化nmon工具(安装nmon)。
(用root用户登录到系统中,然后建目录,把nmon解压缩到当前目录下)
#unzip nmon_x86_12a.zip
Archive:  nmon_x86_12a.zip
  inflating: nmon_x86_rhel45
  inflating: nmon_x86_rhel52
  inflating: nmon_x86_sles9
  inflating: nmon_x86_sles10
  inflating: nmon_x86_ubuntu810
  inflating: nmon_x86_fedora10
  inflating: nmon_x86_opensuse10

根据不同的平台,初始化对应平台的nmon工具:
chmod +x nmon_x86_ubuntu810
mv nmon_x86_ubuntu810 /usr/local/bin/nmon

对于 Debian 还要做以下操作(不做也同样能运行):
apt-get install lsb-release
lsb_release -d | sed 's/Description:\t//' > /etc/debian_release

三.查看帮助
[root@ocp home]# ./nmon -?
Hint: nmon [-h] [-s ] [-c ] [-f -d -t -r ] [-x]


        -h            FULL help information
        Interactive-Mode:
        read startup banner and type: "h" once it is running
        For Data-Collect-Mode (-f)
        -f            spreadsheet output format [note: default -s300 -c288]
        optional
        -s  between refreshing the screen [default 2]
        -c   of refreshes [default millions]
        -d    to increase the number of disks [default 256]
        -t            spreadsheet includes top processes
        -x            capacity planning (15 min for 1 day = -fdt -s 900 -c 96)

四.数据采集。(在做性能测试时,需要执行下面的语句)

#nmon -s10 -c60 -f -m /home/
参数解释:
-s10 每 10 秒采集一次数据。
-c60 采集 60 次,即为采集十分钟的数据。
-f 生成的数据文件名中包含文件创建的时间。
-m 生成的数据文件的存放目录。
这样就会生成一个 nmon 文件,并每十秒更新一次,直到十分钟后。
自动在当前目录生成一个hostname_timeSeries.nmon的文件,如果hosname为test1,生产的文件为:test1_090308_1313.nmon。
nmon -h查看更多帮助信息。

通过sort命令可以将nmon结果文件转换为csv文件:

  # sort  test1_090308_1313.nmon > test1_090308_1313.csv
  执行完sort命令后即可在当前目录生产test1_090308_1313.csv文件。

五、下载nmon_analyser_v45.zip
  https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Power%20Systems/page/nmon_analyser
  nmon_analyser_v45.xlsm  点击 analyze nmon data打开刚刚生成的csv文件
六、每天生成一个文件
  autonmon.sh
#!/bin/sh
source /etc/profile
/usr/local/bin/nmon -s10 -c60 -f -m /home

七、执行计划
*/10 * * * * /u01/autonmon.sh

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

下一篇: openfiler安装使用
请登录后发表评论 登录
全部评论

注册时间:2013-05-30

  • 博文量
    154
  • 访问量
    515361