Nmonmerge

Briefly

Merges two nmon files together for later graphing or processing.

Warning: Please read the warnings at the end of this page before attempting to a large scale project using nmonmerge.

Use

Syntax: nmonmerge [-a] [-v] original-file extra-file
	[-a] append converted extra-file data to end of the original-file
	[-v] verbose extra details are output
  • Without -a the merged data is send to stdout, so redirect it (">") to save the converted data.
  • Note:
    • That header lines are striped out of the 2nd file as they are already in the original file. This assumes no configuration changes like new disks, LUNs, adapters, networks etc., which would cause header and data column mismatches
    • Only the timestamps (Tnnnn) and the number of snapshots are modified everything else is unchanged.
    • Be careful as you might have "missing" snapshots in the time between the data files.
    • An extra line is added, starting "AAA,note" and the filename this line is ignored other tools but will help in diagnosing errors
    • Do NOT sort the nmon file before merging (sorting not needed now anyway)
    • nmonmerge uses a temporary file called temp.nmon
Example: to merge three files a.nmon, b.nmon and c.nmon
	nmonmerge -a a.nmon b.nmon
	nmonmerge -a a.nmon c.nmon

	Now a.nmon contains all the data
Example: to merge three files a.nmon, b.nmon and c.nmon
	nmonmerge a.nmon b.nmon >merged.nmon
	nmonmerge -a merged.nmon c.nmon 

	Now merged.nmon contains all the data

Compiling

The command is implemented in C : nmonmerge2.c

  • Download nmonmerge2.c v3 compiles under AIX and Linux
  • Compile the an IBM XLC or GNU gcc C compiler: cc -o nmonmerge -O3 nmonmerge2.c

Warning

If you have two small .nmon files from the same Server / VM with not configuration changes and the files were saved consecutively then there is a high chance this should work fine.

If you have any of the following the resulting nmon files might not work:

  1. The combined numbers of snapshot is large (thousands) - this may crash Excel running the nmon Analyser
  2. Top process stats as this can drastically add to the numbers stats - this may crash Excel running the nmon Analyser
  3. The more files you add together like a weeks worth of daily files or months worth, will probably case one of the above two errors
  4. The server or VM configuration changes like the number of networks or disks - this is because the columns will not line up or there are disk with no names - missing when the first title line was added to the first nmon file
  5. The extra Disk service time stats increases the volume of stats
  6. On AIX you many have a AIX version which included the PCPU and SCPU stats (now removed in current AIX releases) - these on a Vm with high numbers of virtual CPUs can add thousands of pointless lines of data and MBs to the file size - this may crash Excel running the nmon Analyser. Note: you can grep these lines cat nmonfile | grep -v ^PCPU | grep -v ^SCPU > smaller.nmon) out to improve you chances.
  7. The nmon files are from different servers or virtual machines - absolutely sure this will not work

If you get the merge to work the data volume can mean Excel takes too long to process the stats. Time like 5 to 30 minutes and Excel looks like it has hung with Windows: "Not responding" warning. In addition just saving the resulting Excel data to file can take minutes and generate huge files (Gigabytes).

In this case, I recommend you start using nmonchart - it copes with large data volumes much better, when in to the tens of thousands of snapshot the graphing cat take a dozen seconds)..

- - - The End - - -