nmon - 安装使用

开源性能监控工具,用于监控linux系统的资源消耗信息,并能把结果输出到文件中,然后通过nmon_analyser工具产生数据文件与图形化结果。

Nmon

  1. 下载相应OS版本,基于Centosnmon
  2. 上传到Server /opt/nmon/
  3. 解压,重命名,授权

    1
    2
    3
    [root@Automation nmon]# tar -zxvf nmon16e_mpginc.tar.gz
    [root@Automation nmon]# mv nmon_x86_64_centos6 nmon
    [root@Automation nmon]# chmod 777 nmon
  4. 验证

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    [root@Automation nmon]# ./nmon

    ------------------------------ x
    x _ __ _ __ ___ ___ _ __ For help type H or ... x
    x | '_ \| '_ ` _ \ / _ \| '_ \ nmon -? - hint
    x | | | | | | | | | (_) | | | | nmon -h - full details
    x |_| |_|_| |_| |_|\___/|_| |_|
    x To stop nmon type q to Quit
    x ------------------------------ x
    x LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-no x
    xarcGenuineIntel Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
    x MHz=2496.089 bogomips=4992.17
    x ProcessorChips=1 PhyscalCores=1
    x Hyperthreads =0 VirtualCPUs =2 x
    x Use these keys to toggle statistics on/off:
    x c = CPU l = CPU Long-term - = Faster screen updates
    x C = " WideView U = Utilisation + = Slower screen updates
    x m = Memory V = Virtual memory j = File Systems
    x d = Disks n = Network . = only busy disks/procs
    x r = Resource N = NFS h = more options
    x k = Kernel t = Top-processes q = Quit

Nmon Analyser

下载和说明参见:nmon_analyser

数据采集并分析

  1. 采集

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    [root@Automation nmon]# ./nmon --help
    ./nmon: invalid option -- '-'
    Hint for nmon version 16e
    Full Help Info : nmon -h

    On-screen Stats: nmon
    Data Collection: nmon -f [-s <seconds>] [-c <count>] [-t|-T]
    Capacity Plan : nmon -x
    Interactive-Mode:
    Read the Welcome screen & at any time type: "h" for more help
    Type "q" to exit nmon

    For Data-Collect-Mode
    -f Must be the first option on the line (switches off interactive mode)
    Saves data to a CSV Spreadsheet format .nmon file in then local directory
    Note: -f sets a defaults -s300 -c288 which you can then modify
    Further Data Collection Options:
    -s <seconds> time between data snapshots
    -c <count> of snapshots before exiting
    -t Includes Top Processes stats (-T also collects command arguments)
    -x Capacity Planning=15 min snapshots for 1 day. (nmon -ft -s 900 -c 96)
    ---- End of Hints
    [root@Automation nmon]# ./nmon -c 10 -s 2 -f -t

  2. 分析
    把第一步生成的采集文件,用analyser打开即可。

唐胡璐 wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!
分享创造价值,您的支持将鼓励我继续前行!