Readme for nmon2web
The nmon2web tool converts server performance data from multiple LPARs into dynamic web pages on a central server.
The performance data may be displayed for individual servers, or for the combined partitions on a shared server.
The operations requirements for nmon2web are straight forward.
- Run nmon in the data collection mode on LPAR(s).
- Upload the nmon csv files to a staging area on a central web server running nmon2web.
- Run nmon2web.pl to "extract, transform and load" the nmon files
into rrdtool data bases.
- Central web server (I use Apache on Linux)
- Install rrdtool. The rrdtool is available at
- Staging directory on the web server for the nmon files
- Sufficient disk space on the web server for the rrdfiles**.
The rrdtool pre-allocates all storage at creation time.
Storage can take up to 1 GB per LPAR depending on the nmon sampling rate and the database retention time.
- Customize and run setup.ksh
The setup.ksh automates the installation (and upgrades). It copies the nmon2web files to their proper directories and sets up permissions. You can copy the files manually (see the setup script).
The nmon2web tool converts nmon data from multiple servers into web pagges on a central web site.
Each server runs "nmon -f" for for some period of time (1-24 hours), then sends the output file to the staging directory on the central web server.
The "nmon2web.pl" script on the web server converts the nmon data into rrdfiles and creates the webpages.
(I leave the details of the data transfer to the web server up to you. You can choose rcp, NFS, ssh, rsync, etc.)
The nmon2web tool automate the conversion process. The tool processes all nmon.csv files in the staging directory. If it's a new server, the script will create the necessary directories, rrdtool databases. It then creates the daily and trend charts for the server. (The nmon2web.cgi aggregates performance data from multiple partitions on a shared server.)
The installation involves the "monitored servers", and a central web server.
- Monitored Servers:
- AIX or Linux (PPC or x86)
- Use nmon's "-f" flag to save the performance data to a file.
- I recommend an nmon sample interval(-s) between 600-1200 seconds (or 10-20 minutes).
Shorter intervals contain more "noise" which obscure long term trends and require more disk space
(for example, a one minute interval can use a GB disk per server).
- The sample length can be any size (1-24 hours). Be sure the cron job that uploads the files matches the sample length.
- If you are using a partitioned server, turn on the "Allow shared processor pool utilization authority" on all monitored partitions. Use the HMC to turn it on by right clicking the partition name. Choose "Properties". Choose the "Hardware" tab, then the "Processor and Memory" tab.
- Central Web Server:
- The nmon.csv files from the monitored servers are collected in a staging area on the web server (identified by the $NMON_DIR variable in the nmon2web.pl script).
- .The nmon2web.pl creates the directories and rrd files for new servers, extracts and stores the performance data in rrd files, and creates the daily and trend charts. After processing, the script gzips the csv file. The gzip saves space and the name change (*.gz) prevents nmon2web.pl from reprocessing the file.
- The non2web.cgi program dynamically creates aggregated performance charts for all partitions on a shared server.
Installation Steps for Monitored Servers
- Use cron to automate nmon data collection.
# following cron entry will run nmon with a 10 minute sample rate, starting
# at 00:01 for 24 hours:
01 00 * * * (cd /system_dir/nmon/HOSTNAME; /usr/local/bin/nmon -x)
- Automate upload of the nmon files to web server. (I run ssh as a cron job)
Installation Steps for Web Server
- File descriptions
- nmon2web.pl - Used to process nmon files and create the daily and long term charts.
- nmon2web.cgi - Web tool that creates aggregate charts dynamically using the rrdtool files created by nmon2web.pl.
- index.html - User entry point for this tool.
- nmon2web_consolidator.cgi - web version of the "nmon Consolidator" tool for simulating consolidations using nmon2web data.
- index.html - User entry point for the nmon2web consolidator tool
- Install the web server code and rrdtool rpm.
- Unpack the nmon2web.tar.gz file. (gzip -dc nmon2web.tar.gz |tar -xvf-)
- Copy the nmon2web.cgi to the CGI-BIN directory on the web server.
- Make the cgi file executable chmod a+x nmon2web.cgi
- Customize the nmon2web.cgi, nmon2web_consolidator.cgi and nmon2web scripts
$DOCUMENTROOT = the filesystem fullpath directory name of the web server.
$WEB_SUBDIR = URL subdirectory for the nmon2web index.html. If you plan to access the nmon2web tool as http://yourhost.com/index.html, then $WEB_SUBDIR="".
If you want to put the nmon2web tool in a web subdirectory (eg http://yourhost.com/nmon2web/index.html), the set $WEB_SUBDIR="/nmon2web"
Example 1: assuming the web files are located in "/usr/local/apache2/htdocs" and you want the index.html file to be located in the web's root directory, set:
Browser access: http://server/index.html
Example 2: If you want to locate the index.html in the web server's nmon subdirectory then
Browser access: http://server/nmon/index.html
- Copy nmon2web.pl
- Move to /usr/local/bin (or equivalent)
- Make executable chmod a+x nmon2web.pl
- Customize directory and database retention variables
$NMON_DIR="/staging"; # staging directory for nmon.csv files
$DOCUMENTROOT - see above
$WEB_SUBDIR - see above
$DB_MONTHS=12; # The rrdtool data retention period, in months. The rrdtool will overwrite the data after $DB_MONTHS.
- Add cron job to execute this script. This entry runs the script every day at 1 AM
00 01 * * * (/usr/local/bin/nmon2web.pl)
- Customize $HTTP_DIR and $NMON_DIR directories
- Permissions: give rwx permission on $HTTP_DIR to both the web server process id and the id that runs nmon2web.pl
- Copy index.html and aixtipshead.gif to $HTTP_DIR, make readable by all (chmod a+r *)
- %CPU Utilization on shared partitions is unreliable. This is not a problem with this tool, but rather how AIX reports the data. Use absolute CPU.
- Missing aggregate charts can be caused by adding or deleting servers.
This is an rrdtool issue. It creates blank charts when there is missing data. The "workaround" is to specify a date range that includes data from all servers.
- Nmon versions. In the past, changing nmon versions could cause data parsing problems and result in missing charts. The current nmon2web version attempts to work around this problem.
- Selecting a date range outside the start/end times of the rrdtool database.
- Linux missing charts. Nmon for Linux produces only a subset of the AIX nmon charts.
- A Linux Micropartition on a POWER server may display as a standalone server if the hardware serial number is missing
- Other Please report other issues. I have a limited "sandbox" and
have not tested every combination of hardware/operating system.
First Release: June 2006
July 2006 Bug fix
- Typo's = wlmcpu.rdd -> wlmcpu.rrd, $$WEIGHT -> $WEIGHT
- Modified rrd_update
- Added support for nmon 11d, 11e. Fixes missing LPAR charts resulting
from new fields being added to the nmon output.
November 2, 2006
- Added *.csv files for nmon input (*.nmon and *.csv)
- Modified LPAR charts to include free pool (thanks to David Wong)
- Replace missing data with 0's
- Added support for Linux (Limited. you'll notice missing charts...nmon for Linux doesn't provide the same amount of information as it does for AIX).
February 11, 2009
- nmon 12e support
- Update frequency: Removed previous restriction of one nmon file per day. You can now update at any frequency within reason. (I recommend a maximum of one update per hour.)
- Trend charts: Added top and disks to trend charts. Previously top and disk were only available in the daily charts.
- Number of disks There is a new customization option for number of disks to track. The default is 25.
- Bug fix fixed start date in Trend charts to be the rrdtool wrap date. Previously the start date was the creation date.
- Changed the way nmon2web.pl and nmon2web.cgi handle adapters to make nmon2web more resilient to server configuration changes. This breaks nmon2web "backward" compatibility with network and adapter aggregate charts (does not impact CPU, Memory, Disk)
July 27, 2012
- Made nmon2web.pl more resilient to data layout changes in the nmon.csv.
- Fixed missing hostname issue for Linux servers
October 7, 2013
- Updates for changes in topas-nmon output.
- Bug fixes.
- Addition of "nmon2web Consolidator".
December 20, 2013
- Added trend charts with user-specified date ranges.
- Moved "nmon2web Consolidator" into the index.html file.
- Added setup script for initial installs and updates.
- Added upgrade script for moving to this version.
- Moved nmon2web_consolidator to this web page.
- Added selectable date ranges for the performance charts.
(Note: the response time is slow (20+ seconds)
due to the large number of charts being created.
I've retained the daily host performance charts for response time and for
- A few bug fixes, modifications to work with nmon-topas changes.
- Added a "nmon2web Consolidator" function