NMON – A tool to analyze AIX and Linux performance

nmon is widely used tool in AIX and Linux to check system performance such as Memory, CPU, Processors, Input/Output  of adapters, Disk etc and it was released by IBM to open source in July 2009. nmon stands for  Nigel’s Monitor and was developed by Nigel Griffiths from IBM UK .We can use Nigel’s Monitor  as a command to displays local system statistics in interactive mode and as well as we can run it on the background to records system statistics in recoding mode for a whole day. If you specify any of the -F-f-X-x, and -Z flags, the nmon command works in recording mode. Otherwise, the nmon command works in interactive mode.

This article is not a Nigel’s Monitor  manual. I will explain here how to configure nmon tool to record system statics of Memory Usages, CPU Usages, Disk Usages for a day in a constant interval.  And schedule Nigel’s Monitor to collect this information every day using crontab.  The tool is available at IBM site http://www.ibm.com/developerworks/aix/library/au-analyze_aix/ in a graphical form. I will post tutorial of  nmon command line on a separate article.

The tool runs on:

  • AIX 4.1.5, 4.2.0 , 4.3.2, and 4.3.3 (The Tool Version 9a: This version is functionally established and will not be developed further.)
  • AIX 5.1, 5.2, and 5.3,6.1. 7.1 Linux SUSE SLES 9, Red Hat EL 3 and 4, Debian on pSeries p5, and OpenPower
  • Linux SUSE, Red Hat, and many recent distributions on x86 (Intel and AMD in 32-bit mode)
  • Linux SUSE and Red Hat on zSeries or mainframe

The NMON Tool is designed for AIX and Linux for monitoring and analyzing performance data, including:

  • 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

Configuration  Steps
NMON  tool is available as a built in package for AIX 5.3 TL 9 and higher. However you need to download and install the tool for Linux and AIX level lower than 5.3 TL9 and .The tool is a stand-alone binary file (a different file for each AIX or Linux version) that you can install . Installation is simple:

Download the tool  http://www.ibm.com/developerworks/wikis/display/WikiPtype/nmon

1) Copy the nmonXXX.tar.Z file to the machine. If using FTP, remember to use binary mode.
2)To uncompress the file, run uncompress nmonXX.tar.Z.
3) To extract the files, run tar -xvf nmonXX.tar
4) To start the nmon tool, type nmon. you might need to type ./nmon.

Let me explain how did I configuration NMON  for my AIX servers .

Step 1: Createa directory /nmondialy/data to store  outputs

Step 2:  Create a script under /nmondialy/scripts/nmonrun.ksh

#!/bin/ksh

export NMONAIX=5.2.0.0 # fix for AIX-NMON issue

/usr/bin/nmon -m /nmondialy/data   -x -A -g /nmondialy/data/webmanual01.diskgroup

find /nmondialy/data  -name ‘*.nmon’ -type f -mtime +5 -print | xargs /bin/compress

find /nmondialy/data -name ‘*.nmon.Z’ -type f -mtime +30 -print | xargs /bin/rm

Explanation of the script:

1)      Command  /usr/bin/nmon will start the nmon process

-x      Specifies the sensible spreadsheet recording for duration of one day for capacity planning. By default, the recording is done every 900 seconds for 96 times. This flag is equivalent to -ft -s 900 -c 96

-m    Changes the directory before the command saves the data to a file.

-g     Specifies the file that contains the user-defined disk groups, using the filename parameter. Each line in the file begins with a volume group name. The list of disks follows the group name and is separated with spaces. The file can contain a maximum of 64 disk groups. A disk can belong to various disk groups.

-A           Includes the Asynchronous I/O section in the view.

2)      First find command will compress any file with extension .nmon with is older than 5 days.

3)      Second find command will delete any file with extension .nmon.Z  with is older than 30 days.

Step 3 :  Create a file  /nmondialy/data/webmanual01.diskgroup including all volume group and its disk as specified by –g option on the step 2.

rootvg hdisk3 hdisk0
webvg hdisk1 hdisk2 hdisk5

Step 4 : Run the script and check topas_nmon process is running

webmanual01:/> ps -ef | grep -i nmon
root 4194438 5111940   0 23:53:49  pts/0  0:00 grep -i nmon
root 1900850       1   0 00:01:02      -  0:02 /usr/bin/topas_nmon  -m /nmondialy/data -x -A -g /nmondialy/data/webmanual01.diskgroup -youtput_dir=/nmondialy/data webmanual01 -ystart_time=00:01:01,Feb04,2012
webmanual0101:/>

Step 5 :Now download the tool from http://www.ibm.com/developerworks/wikis/display/WikiPtype/nmonanalyser

Analyser download

Step 6:  Download nmon data from server to local desktop from path /nmondaily/data

-rw-r–r–    1 root     system       414346 Jun 18 00:01 webmanual01_110617_0001.nmon.Z

-rw-r–r–    1 root     system       369579 Jun 19 00:01 webmanual01_110618_0001.nmon.Z

-rw-r–r–    1 root     system       383022 Jun 20 00:01 webmanual01_110619_0001.nmon.Z

-rw-r–r–    1 root     system       417310 Jun 21 00:01 webmanual01_110620_0001.nmon.Z

-rw-r–r–    1 root     system       424298 Jun 22 00:01 webmanual01_110621_0001.nmon.Z

Step 7:  Export the downloaded  data  to  Analyser tool using “Analyse nmon data” button as shown below 

Analyser tool

 Step 8: Finally you will get a spreadsheet in graphical for Memory, Disk , CPU etc. As  below screen shot is for CPU during one day

analyzing performance

 

Now start monitoring your system performance and enjoy a stable environment.