Nmon is a free tool for analyzing AIX and Linux performance, which is primarily developed by IBM for its own AIX operating system, but can also be applied on Linux operating systems, while Nmon_ Analyser is a tool for Nmon to convert Nmon generated reports into Excel reports for us to view. Let's get a full feasting my eyes and look at the Nmon_analyser generated report
Installation of the tool:
[Email protected] source]# chmod 777 Nmon_x86_rhel45
[[email protected] source]#./NMON_X86_RHEL45 (Switch to the directory where the Nmon_x86_rhel45 file is located)
[[Email protected] source]# env
[Email protected] source]# MV Nmon_x86_rhel45/usr/bin
[Email protected] source]# MV Nmon_x86_rhel45 nmom
[[email protected] source]# Nmom (now Nmon is the global command)
Use of Nmon tool commands:
#nmon-S 300-c 288-f-m/tmp
-S 300: Indicates that data is collected every 300 seconds,
C 288: The acquisition of 288 times, 300*288=86400 seconds, just 1 days of data, so run once this program will generate a day of data files,
-m/tmp: Represents the path to the generated data file
-F: Indicates that there is time in the generated data file name
Also allows it to automatically monitor a folder every day, one file per hour, or 5 samples per minute
Parameter explanation:
The-S10 collects data every 10 seconds.
-c60 collected 60 times, that is, the acquisition of 10 minutes of data.
-F generates a data file name that contains the time when the file was created.
The storage directory of the data files generated by-M.
Nmon-f-S 10-c 60
-F indicates that there is time in the generated data file name;
-S 10 means that data is collected every 10 seconds;
-C 60 means acquisition 60 times, 10*60=600 seconds,
It's just 10 minutes of data, so running this program will generate a file that collects 10 minutes of data. The line command will create an output file in the current directory named:
Download Nmon_analyser
Set the security level for Excel macros to be lowered
Tools, macro-and security, and then open the file and allow the macro to run.
Open excel in Nmon_analyser, and then load the Nmon data, saving the output of Excel.
More usage
Crontab-e
0 0 * * */usr/local/nmo-s300-c288-f-m/home/nmon/>/dev/null 2>&1
Said:
300*288=86400 seconds, just a day's data.
0 8 * * 1,2,3,4,5/usr/local/nmon-f-n-m/home/nmon/log-s 30-c 1200
Said:
From Monday to Friday, 10 hours (until 18:00) were monitored and exported to/home/nmon/log, starting from 08 o'clock in the morning.
Example 1:
Automatically collect data by day:
Add a record to the crontab:
0 0 * * * nmon-s300-c288-f-m/home/>/dev/null 2>&1:
300*288=86400 seconds, just a day's data.
Example 2:
A, Execution command: #crontab-E
B. Add the following command on the last line:
0 8 * * 1,2,3,4,5/nmon/scriptn/mon_x86_rhel52-f-n-m/nmon/log-s 30-c 1200
Said:
From Monday to Friday, from 08 o'clock in the morning, monitoring 10 hours (until 18:00), output to/nmon/log
Third, Nmon data collection
1. Data acquisition
To monitor the system's usage over time and record the results in real time, we can do this by running the following command:
1 |
#./ nmon -f -t -s30 -c 180 |
Parameter description:
l-f< Span style= "color: #000000; line-height:150%; font-size:14px; " >: Output files in standard format:
l-t< Span style= "color: #000000; line-height:150%; font-size:14px; " >: The output includes high-occupancy processes;
l- S3030 seconds data collection
l- C180180
after entering the command enter, a hostname_timeseries.nmon files, nmon_.nmon
Special Note:
When the command is started, it isNmon Create a monitoring file in the directory and continue writing to the resource data until 3601 hours, these operations are done automatically without manual intervention, and testers can continue to do other things. If you want to stop the monitoring, you need to pass the #ps Span style= "color: #000000; line-height:150%; font-size:14px; " >–ef| Grepnmon "Query the process number and then kill the process to stop monitoring.
[Email protected] source]# hostname
Linux_test
[Email protected] source]#/nmon-f-S 10-C 60
[Email protected] source]# Ps-ef | grep Nmon
Root 17815 1 0 08:22 pts/1 00:00:00/nmon-f-S 10-C 60
Root 17888 6977 0 08:22 pts/1 00:00:00 grep nmon
[[email protected] source]# ls Linux_test_120724_0822.nmon
Linux_test_120724_0822.nmon
When we execute the relevant command, we generate a file in the current directory that starts with this hostname linux_test to execute the date as the rule, nmon the end of the document, and we see the associated Nmon process through the PS command, Here we are 10 minutes after the past we will find the relevant Nmon process will disappear.
Linux_test_120724_0822.nmon is the data file we generated, all the information is in the Linux_test_120724_0822.nmon record, and we found through the more command that we can not understand some of the text, This requires us to translate it into a file that we can read in Excel format. First we export the Linux_test_120724_0822.nmon file to our Windows Local. And then we're from Http://www.ibm.com/developerworks/wikis/display/Wikiptype/nmonanalyser.
Download Nmonanalyser software to Windows Local. After opening the unpacked file, we will find 2 files, one is Nmonanalyse description of Word format is stable and the other is Nmonanalyse file in Excel format.
All we need here is Excel format to ask the file, we double click Open.
Use of Nmon Tools