Вы находитесь на странице: 1из 3

INSTALL nmon **************** mkdir nmon cd nmon wget http://sourceforge.net/projects/nmon/files/lmon12f.c/download ln -s lmon12f.c lmon.

c cat /etc/redhat-release make nmon_power_rhel5 ln -s nmon_power_rhel5 nmon

./nmon_power_rhel5 -f -s 60 -c 120

./nmon_power_rhel5 -f -s 300 -c 288 300 = 5 min 288x5 = 24hrs

# temporary stats collection process via nmon 06082011 Witold Koziel 0 0 * * * /usr/local/src/nmon_power_rhel5 -fTN -s 300 -c 288 -m /tmp/nmon_data 0 0 * 7 * /usr/local/src/nmon/nmon -fTN -s 300 -c 288 -m /data01/nmon_data 1 20 * * * /usr/bin/find /data01/nmon_data -type f -mtime +30 -name -exec rm -f {} \;>/dev/null

0 0 * * * /usr/local/src/nmon/nmon -f -s 5 -c 10 -m /usr/local/src/nmon/data 0 0 * * * /usr/local/src/nmon/nmon -fTN -s 5 -c 10 -m /usr/local/src/nmon/data 0 0 * * * /usr/local/src/nmon/nmon -fTN -s 300 -c 288 -m /usr/local/src/nmon/data

nmon and cron


The nmon default capture to file filenames has bee carefully chosen. If you save the output of many machines and captures in one directory and list the directory you will have the files in first machine hostname order and second orders by time (and date). This is a sensible ordering. Many people have written scripts to start nmon via cron and many of the scripts are a complete waste of time or even wrong. One feature that was added to nmon to make this easy was the -m flag so the nmon moves to a particular directory before saving data. So here is what I put in my crontab (use crontab -e to add tasks to your crontab file). This collects the data once a day in the directory /home/nmon_data at once every 5 minutes and with 288 snapshot which makes a excellent graph detail level. It also collects top processes and user command lines (T), NFS stats (N), Workload Manager but no Subclasses (W), Large page stats (L) and Asynchronous I/O details. The reporting threshold is 0.001 percent of a CPU.

cron entry example 0 0 * * * /usr/lbin/nmon_aix53 -fTNWLA -I 0.001 -s 300 -c 288 -m /home/nmon_data


There is no need of any shell scripts to start this collection. Note: that is you start two nmon processes running at the same time they will have the same filename. So if you want to, for example, collect details and summary stats start then one minute apart. So if I also wanted hourly statistics with less top process details a second crontab entry might be:

cron entry example 2 0 * * * /usr/lbin/nmon_aix53 -ftNWLA -s 3600 -c 24 -m /home/nmon_data Capturing data to a file for later analysis and graphing
Run nmon with the -f or -F flag. See nmon -h for the details, but as an example, to run nmon for an hour capturing data snapshots every 15 seconds for an hour (15*240=3600 seconds) use: nmon -f -s 15 -c 240 n nmon -fT -s 15 -c 240The second line also captures the top processes. Both of these will create the output file in the current directory called: <hostname>_date_time.nmon This file is in a comma separated values format and can be imported into a spread sheet directly. FOR Lotus 1-2-3 ONLY (NOT RECOMMENDED ANY LONGER) If you are using Lotus 1-2-3 the file needs to be sorted before importing. On AIX, follow this example: sort -A mymachine_311204_1030.nmon > xxx.csv

T This sorting is not required for the Excel version of the nmon analyser.Hints and Tips: To load this into a spreadsheet, check the spreadsheet documentation for loading comma-separated value (.csv) data files. Many spreadsheets accept this data as just one of the possible files to load or provide an import function to do this. Many spreadsheets have fixed maximum numbers of columns and rows. We suggest you collect a maximum of 300 snapshots to avoid hitting these issues and to make a nice looking graph. Also not a 1024x768 computer screen with 350 data points would only have approximately two pixels per data. There is little purpose in having more data points. When you are capturing data to a file, the nmon tool disconnects from the shell, to ensure that it continues running even if you log out. This means that nmon can appear to crash, but it is still running in the background.

Вам также может понравиться