nmon config on aix/linux host

Nigel's MONitor (nmon) es una herramienta de monitoreo de performance para AIX y en sus ultimas versiones también corre bajo Linux.

La herramienta esta diseñada para evaluación de performance de un host AIX o Linux. La información que

que podemos obtener son sobre los siguientes recursos:

    CPU utilization

    Memory use

    Kernel statistics and run queue information

    Disks I/O rates, transfers, and read/write ratios

    Free space on file systems

    Disk adapters

    Network I/O rates, transfers, and read/write ratios

    Paging space and paging rates

    CPU and AIX specification

    Top processors

    IBM HTTP Web cache

    User-defined disk groups

    Machine details and resources

    Asynchronous I/O -- AIX only

    Workload Manager (WLM) -- AIX only

    IBM TotalStorage® Enterprise Storage Server® (ESS) disks -- AIX only

    Network File System (NFS)

    Dynamic LPAR (DLPAR) changes -- only pSeries p5 and OpenPower for either AIX or Linux

    

Tiene dos formas de ejecución, online y batch, este ultimo permite extraer archivos .nmon el cual puede ser analizado mas al detalle con herramienta llamada nmon analyser.

Uso básico de nmon:

En este ejemplo vamos a ver como usar la herramienta en AIX 6.1 y RHEL 5.2

Modo online AIX:

# nmon

+-------------------------------------------------------------------------------------+

¦  ------------------------------                                                     ¦

¦  N    N  M    M   OOOO   N    N   For online help type: h                           ¦

¦  NN   N  MM  MM  O    O  NN   N   For command line option help:                     ¦

¦  N N  N  M MM M  O    O  N N  N      quick-hint  nmon -?                            ¦

¦  N  N N  M    M  O    O  N  N N    full-details  nmon -h                            ¦

¦  N   NN  M    M  O    O  N   NN   To start nmon the same way every time?            ¦

¦  N    N  M    M   OOOO   N    N    set NMON ksh variable, for example:              ¦

¦  ------------------------------    export NMON=cmt                                  ¦

¦    TOPAS_NMON                                                                       ¦

¦                               4 - CPUs currently                                    ¦

¦                               4 - CPUs configured                                   ¦

¦                            3300 - MHz CPU clock rate                                ¦

¦                  PowerPC_POWER7 - Processor                                         ¦

¦                          64 bit - Hardware                                          ¦

¦                          64 bit - Kernel                                            ¦

¦               9,aix-rrhh6orades - Logical Partition                                 ¦

¦                    6.1.6.4 TL06 - AIX Kernel Version                                ¦

¦                 aix-rrhh6orades - Hostname                                          ¦

¦                 aix-rrhh6orades - Node/WPAR Name                                    ¦

¦                         065864P - Serial Number                                     ¦

¦                    IBM,8233-E8B - Machine Type                                      ¦

¦                                                                                     ¦

+-------------------------------------------------------------------------------------+

Presionar h para acceder a las opción:

+-HELP---------most-keys-toggle-on/off------------------------------------------------+

¦h = Help information     q = Quit nmon             0 = reset peak counts             ¦

¦+ = double refresh time  - = half refresh          r = ResourcesCPU/HW/MHz/AIX       ¦

¦c = CPU by processor     C=upto 128 CPUs           p = LPAR Stats (if LPAR)          ¦

¦l = CPU avg longer term  k = Kernel Internal       # = PhysicalCPU if SPLPAR         ¦

¦m = Memory & Paging      M = Multiple Page Sizes  P = Paging Space                   ¦

¦d = DiskI/O Graphs       D = DiskIO +Service times o = Disks %Busy Map               ¦

¦a = Disk Adapter         e = ESS vpath stats       V = Volume Group stats            ¦

¦^ = FC Adapter (fcstat)  O = VIOS SEA (entstat)    v = Verbose=OK/Warn/Danger        ¦

¦n = Network stats        N=NFS stats (NN for v4)   j = JFS Usage stats               ¦

¦A = Async I/O Servers    w = see AIX wait procs   "="= Net/Disk KB<-->MB             ¦

¦b = black&white mode     g = User-Defined-Disk-Groups (see cmdline -g)               ¦

¦t = Top-Process --->     1=basic 2=CPU-Use 3=CPU(default) 4=Size 5=Disk-I/O          ¦

¦u = Top+cmd arguments    U = Top+WLM Classes       . = only busy disks & procs       ¦

¦W = WLM Section          S = WLM SubClasses                                          ¦

¦[ = Start ODR            ] = Stop ODR                                                ¦

¦~ = Switch to topas screen                                                           ¦

¦Need more details?  Then stop nmon and use: nmon -?                                  ¦

¦                                                                                     ¦

+-------------------------------------------------------------------------------------+

Así por ejemplo para divisar de forma online el estado de I/O de disco, memoria, y cpu digitar dmc de forma seguida:

+-topas_nmon--j=JFS--------------Host=aix-miHostAixX=2 secs---14:47.25----------------+

¦ CPU-Utilisation-Small-View -----------EntitledCPU=  0.50 UsedCPU=  0.103------------¦

¦Logical  CPUs              0----------25-----------50----------75----------100       ¦

¦CPU User%  Sys% Wait% Idle%|           |            |           |            |       ¦

¦  0   5.0   4.0   0.0  91.0|UUss    >                                        |       ¦

¦  1   0.0   0.0   0.0 100.0|>                                                |       ¦

¦  2   0.0   0.0   0.0 100.0|>                                                |       ¦

¦  3   0.0   0.0   0.0 100.0|>                                                |       ¦

¦EntitleCapacity/VirtualCPU +-----------|------------|-----------|------------+       ¦

¦ EC   8.1   5.1   0.0   7.3|UUUUssiii----------------------------------------|       ¦

¦ VP   4.1   2.5   0.0   3.7|UUsi---------------------------------------------|       ¦

¦EC=  20.5%  VP=  10.3%     +--No Cap---|------------|-----------100% VP=1 CPU+       ¦

¦ Memory -----------------------------------------------------------------------------¦

¦          Physical  PageSpace |        pages/sec  In     Out | FileSystemCache       ¦

¦% Used       93.9%     38.6%  | to Paging Space   0.0    0.0 | (numperm)  5.9%       ¦

¦% Free        6.1%     61.4%  | to File System    0.0    0.5 | Process   57.8%       ¦

¦MB Used    5771.8MB  2370.1MB | Page Scans        0.0        | System    30.2%       ¦

¦MB Free     372.2MB  3773.9MB | Page Cycles       0.0        | Free       6.1%       ¦

¦Total(MB)  6144.0MB  6144.0MB | Page Steals       0.0        |           ------      ¦

¦                              | Page Faults    1820.1        | Total    100.0%       ¦

¦------------------------------------------------------------ | numclient  5.9%       ¦

¦Min/Maxperm     176MB(  3%)  5277MB( 86%) <--% of RAM        | maxclient 85.9%       ¦

¦Min/Maxfree     960   1088       Total Virtual   12.0GB      | User      60.5%       ¦

¦Min/Maxpgahead    2      8    Accessed Virtual    7.3GB 61.0%| Pinned    29.9%       ¦

¦ Disk-KBytes/second-(K=1024,M=1024*1024) --------------------------------------------¦

¦Disk     Busy  Read  Write 0----------25-----------50------------75--------100       ¦

¦ Name          KB/s   KB/s |           |            |             |          |       ¦

¦hdisk13    0%      0      0|                                                 |       ¦

¦hdisk9     0%      0      0|                                                 |       ¦

¦hdisk2     0%      0      2|                                                 |       ¦

¦hdisk10    0%      0      0|                                                 |       ¦

¦hdisk0     1%      0     30|W                                                |       ¦

¦hdisk1     0%      0      2|                                                 |       ¦

+---------Warning: Some Statistics may not be shown-----------------------------------

Modo online RHEL:

# nmon 

+nmon-14g------[H for help]---Hostname=lnx-miHostLinuXRefresh= 2secs ---14:48.21------+

¦                                                                                     ¦

¦  ------------------------------       For help type H or ...                        ¦

¦  #    #  #    #   ####   #    #        nmon -?  - hint                              ¦

¦  ##   #  ##  ##  #    #  ##   #        nmon -h  - full                              ¦

¦  # #  #  # ## #  #    #  # #  #                                                     ¦

¦  #  # #  #    #  #    #  #  # #       To start the same way every time              ¦

¦  #   ##  #    #  #    #  #   ##        set the NMON ksh variable                    ¦

¦  #    #  #    #   ####   #    #                                                     ¦

¦  ------------------------------                                                     ¦

¦                                                                                     ¦

¦  Use these keys to toggle statistics on/off:                                        ¦

¦     c = CPU        l = CPU Long-term   - = Faster screen updates                    ¦

¦     m = Memory     j = Filesystems     + = Slower screen updates                    ¦

¦     d = Disks      n = Network         V = Virtual Memory                           ¦

¦     r = Resource   N = NFS             v = Verbose hints                            ¦

¦     k = kernel     t = Top-processes   . = only busy disks/procs                    ¦

¦     h = more options                   q = Quit                                     ¦

¦-------------------------------------------------------------------------------------¦

¦                                                                                     ¦

+-------------------------------------------------------------------------------------+

Presionar h para acceder a las opción:

+nmon-14g------[H for help]---Hostname=lnx-sgchistorRefresh= 2secs ---15:00.05--------+

¦ HELP -------------------------------------------------------------------------------¦

¦     key  --- statistics which toggle on/off ---                                     ¦

¦     h = This help information                                                       ¦

¦     r = RS6000/pSeries CPU/cache/OS/kernel/hostname details + LPAR                  ¦

¦     t = Top Process Stats 1=basic 3=CPU                                             ¦

¦         u = shows command arguments (hit twice to refresh)                          ¦

¦     c = CPU by processor             l = longer term CPU averages                   ¦

¦     m = Memory & Swap stats L=Huge   j = JFS Usage Stats                            ¦

¦     n = Network stats                N = NFS                                        ¦

¦     d = Disk I/O Graphs D=Stats      o = Disks %Busy Map                            ¦

¦     k = Kernel stats & loadavg       V = Virtual Memory                             ¦

¦     g = User Defined Disk Groups [start nmon with -g <filename>]                    ¦

¦     v = Verbose Simple Checks - OK/Warnings/Danger                                  ¦

¦     b = black & white mode                                                          ¦

¦     --- controls ---                                                                ¦

¦     + and - = double or half the screen refresh time                                ¦

¦     q = quit                     space = refresh screen now                         ¦

¦     . = Minimum Mode =display only busy disks and processes                         ¦

¦     0 = reset peak counts to zero (peak = ">")                                      ¦

¦     Developer Nigel Griffiths see http://nmon.sourceforge.net                       ¦

¦-------------------------------------------------------------------------------------¦

+-------------------------------------------------------------------------------------+

Así por ejemplo para divisar de forma online el estado de I/O de disco, memoria, y cpu digitar dmc de forma seguida:

+nmon-14g------[H for help]---Hostname=lnx-lnx-miHostLinuXRefresh= 2secs ---14:49.44--+

¦ CPU Utilisation --------------------------------------------------------------------¦

¦---------------------------+-------------------------------------------------+       ¦

¦CPU  User%  Sys% Wait% Idle|0          |25         |50          |75       100|       ¦

¦  1   0.0   0.0   0.0 100.0| >                                               |       ¦

¦  2   0.5   0.0   0.0  99.5|  >                                              |       ¦

¦  3   0.5   0.0   0.0  99.5| >                                               |       ¦

¦  4   0.5   0.5   0.0  99.0|      >                                          |       ¦

¦---------------------------+-------------------------------------------------+       ¦

¦Avg   0.4   0.1   0.0  99.5|  >                                              |       ¦

¦---------------------------+-------------------------------------------------+       ¦

¦ Memory Stats -----------------------------------------------------------------------¦

¦                RAM     High      Low     Swap    Page Size=4 KB                     ¦

¦ Total MB     24107.7      0.0  24107.7  24576.0                                     ¦

¦ Free  MB      1584.3      0.0   1584.3  24576.0                                     ¦

¦ Free Percent     6.6%     0.0%     6.6%   100.0%                                    ¦

¦             MB                  MB                  MB                              ¦

¦                      Cached= 19560.2     Active= 15560.1                            ¦

¦ Buffers=  1149.4 Swapcached=     0.0  Inactive =  5897.8                            ¦

¦ Dirty  =     0.1 Writeback =     0.0  Mapped   =  2682.2                            ¦

¦ Slab   =   933.4 Commit_AS =  6717.2 PageTables=    81.0                            ¦

¦ Disk I/O --/proc/diskstats----mostly in KB/s-----Warning:contains duplicates--------¦

¦DiskName Busy  Read WriteKB|0          |25         |50          |75       100|       ¦

¦sda        0%    0.0    0.0|>                                                |       ¦

¦sda1       0%    0.0    0.0|>disk busy not available                         |       ¦

¦sda2       0%    0.0    0.0|>disk busy not available                         |       ¦

¦sda3       0%    0.0    0.0|>disk busy not available                         |       ¦

¦sda4       0%    0.0    0.0|>disk busy not available                         |       ¦

¦sda5       0%    0.0    0.0|>disk busy not available                         |       ¦

¦sda6       0%    0.0    0.0|>disk busy not available                         |       ¦

¦sdb        0%    0.0    0.0|>                                                |       ¦

¦sdb1       0%    0.0    0.0|>disk busy not available                         |       ¦

¦sdc        0%    0.0    0.0|>                                                |       ¦

+---------Warning: Some Statistics may not shown--------------------------------------+

Instalación/Configuración en AIX:

install

A partir de determinada versión de TL [1] de AIX 6 (si recuerdo es a partir del TL2SP2) el software viene nativo en el sistema operativo. Por lo que para hacer uso de la herramienta de modo online, ejecutamos del prompt nmon y ya "funciona".

config

# nohup /usr/bin/nmon  -f -T -P -s 300 -c 287 &

    * -f escribe en el archivo con nombre:    <hostname>_date_time.nmon

    * -T captura los procesos top.

    * -P incluye datos del area de paginación en el log.

    * -s segs muestrea cada 15 segundo.

    * -c si no usamos muestrea indefinidamente, de lo contrario llega al punto marcado para le muestro y     termina el procesos.

 

# nohup /usr/bin/nmon -F `hostname`_`date +%y%m%d`_`date +%H%M`.nmon -T -p -s 300 -c 287 &

Esto levanta un procesos que comienza a generar un archivo en el directorio actual, el cual tiene el formato aix-miAIXServer_100518_1510.nmon

donde:

aix-miAIXServer = hostname

100518 = 2010 mayo 18

1510 = hora de lanzamiento

Esto se puede automatizar mediante un scripts y "esquedular"  mediante cron, por ejemplo:

05 0 * * * /usr/bin/nmon -m /tmp/nmon/ -f -T -P -s 300 -c 287

- m = defino un directorio para guardar el archivo.

Este scheduler graba un archivo con 287 muestras de datos tomadas cada 300 segundos.

Instalación/Configuración en RHEL:

- Descargar el paquete para red hat según el link adjunto en referencias:

    # nmon_linux_14g.tar.gz

- Descomprimir el erchivo:

    # gunzip nmon_linux_14g.tar.gz

- como root copiar/instalar el paquete nmon_x86_rhel5 en el siguiente directorio:

    # cp /home/User/nmon_x86_rhel5  /usr/local/bin/nmon_x86_rhel5

- generar accesos a otro usuario

    "ln [ -f  | -n ] [ -s ] SourceFile [ TargetFile ]"

    # ln -s /usr/local/bin/nmon_x86_rhel5 /usr/bin/nmon

    # ls -l /usr/bin/nmon

      lrwxrwxrwx 1 root root 29 Apr 13 11:56 /usr/bin/nmon -> /usr/local/bin/nmon_x86_rhel5

     

- listo, con esto ya podemos acceder a nmon ejecutando desde la linea a de comando.

  la configuración es similar que en AIX.

nmon analyser

Esta es la herramienta que nos permite levantar el log que generamos en el paso de configuración y

generar gráficas a partir de esos datos. No es más que una macro excel que podemos descargar gratuitamente y usar.

Para mostrar las gráficas debemos tener habilitadas las macros en excel, abrir el archivo y las gráficas

comienzan a generase. Luego de unos minutos tenemos disponible el revelamiento que realizó la herramienta.

- Descargar la macro en Biblioteca U&S --> Software

- Abrir excel

- Abrir el archivo .nmon

screenshot

Habilitando las macros para nmon analyser

Abriendo el archivo de log

Guardando la planilla excel

system summary

uso de discos por el perdido seleccionado

uso de memoria por el periodo seleccionado