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 a large-scale project using nmonmerge.
Use
Syntax: nmonmerge [-a] [-v] original-file extra-file [-a] append converted extra-file data to the end of the original file [-v] verbose extra details are output
- Without -a the merged data is sent to stdout, so redirect it (">") to save the converted data.
- Note:
- That header lines are stripped out of the 2nd file as they are already in the original file. This stripping 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; other tools ignore this line, but it will help in diagnosing errors.
- Do NOT sort the nmon file before merging (sorting not needed now)
- 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 nmonmerge3.c version 3 compiles under AIX and Linux
- Compile with IBM XLC or GNU gcc C compiler: cc -o nmonmerge -O3 nmonmerge2.c
Warnings
If you have two small .nmon files from the same Server/VM with no configuration changes and saved consecutively, then there is a high chance this will work fine.
If you have any of the following features, the resulting nmon files might not work:
- The combined number of snapshots is large (in the thousands range) - this may crash Excel running the nmon Analyser
- Top process stats as this can drastically add to the numbers stats - this may crash Excel running the nmon Analyser
- The more files you add together, like a week's worth of daily files or a month's worth, this will probably cause one of the above two errors
- The server or VM configuration changes, like the number of networks or disks - this is because the columns will not line up, or there will be disks with no names.
- The extra Disk service time stats can greatly increase the volume of stats and create Excel problems
- On AIX, you may have an AIX version which includes the PCPU and SCPU stats (now removed in current AIX releases).
- On virtual machines with large numbers of virtual CPUs, this can add thousands of pointless lines of data and MBs to the file size.
- This may cause Excel to crash while running the nmon Analyser.
- Note: you can "grep" out these lines cat nmonfile | grep -v ^PCPU | grep -v ^SCPU > smaller.nmon) out to improve your chances.
- The nmon files are from different servers or virtual machines - 100% sure this will not work.
If you get the merge to work, the data volume may cause Excel to take too long to process the stats.
- Time like 5 to 30 minutes, and Excel appears to have hung, with a "Not responding" warning in Windows.
- In addition, just saving the resulting Excel data to a 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. With tens of thousands of snapshots, the graphing can take a dozen seconds.
- - - The End - - -
