Use nmon to monitor Linux system resources

Source: Internet
Author: User

Download the corresponding CPU version:
Http://nmon.sourceforge.net/pmwiki.php? N = site. Download

Wget http://sourceforge.net/projects/nmon/files/download/nmon_x86_12a.zip/download
Unzip nmon_x86_12a.zip
Archive: nmon_x86_12a.zip
Inflating: nmon_x86_rhel45
Inflating: nmon_x86_rhel52
Inflating: nmon_x86_sles9
Inflating: nmon_x86_sles10
Inflating: nmon_x86_ubuntu810
Inflating: nmon_x86_fedora10
Inflating: nmon_x86_opensuse10

Use the corresponding operating system file:
Chmod + x nmon_x86_ubuntu810
MV nmon_x86_ubuntu810/usr/local/bin/nmon

Perform the following operations for Debian ):
Apt-Get install LSB-release
Lsb_release-d | SED's/Description: \ t // '>/etc/debian_release

Run nmon directly.

Collect data and generate reports:
Data collection:
Nmon-S10-16A-F-M/home/

Parameter description:
-S10 collects data every 10 seconds.
-60 records are collected for 60 times, that is, 10 minutes of data are collected.
-F: The generated data file name contains the time when the file was created.
-M: directory where data files are stored.

In this way, a nmon file is generated and updated every 10 seconds until 10 minutes later.
The generated file name is hostname_0901__1306.nmon. "hostname" indicates the host name.

Generate Reports:
Download nmon analyser (a free tool for generating performance reports ):

Http://www.ibm.com/developerworks/wikis/display/Wikiptype/nmonanalyser

Upload the previously generated nmon data file to a Windows machine and use Excel to open the analysis tool nmon analyser v33c.xls. Click the "analyze nmon data" button in the Excel file and select the nmon data file to generate an analysis result file: hostname_0901__1306.nmon.xls, open the generated file in Excel and you will see the result.

If the macro cannot run, perform the following operations:
Tool-> macro-> Security->, and then open the file and allow the macro to run.

Automatic data collection by day:
Add a record to crontab:
0 0 *** root nmon-s300-c288-F-M/home/>/dev/null 2> & 1

300*288 = 86400 seconds, which is exactly the data of one day.

References:
Nmon for Linux:
Http://nmon.sourceforge.net/pmwiki.php

Nmon performance: a free tool for analyzing AIX and Linux performance:
Http://www.ibm.com/developerworks/cn/aix/library/analyze_aix/index.html

Nmon analyser-a free tool for generating AIX performance reports:
Http://www.ibm.com/developerworks/cn/aix/library/nmon_analyser/index.html

 

Bytes ------------------------------------------------------------------------------------------------------------------------

 

Nmon is a free tool provided by IBM to monitor AIX and Linux system resources. This tool collects the system resource consumption of the server and outputs a specific file. It can also use the Excel analysis tool for statistical analysis of data, analyze the performance data of Unix or Linux systems. The nmon tool is easy to use. The following describes how to use it in different steps.

1. Install nmon
First, download the nmon tool from the official IBM website. When downloading the tool, you must download the corresponding system version. Here we use debian31 as an example to download the nmon_x86_11f.zip version, which supports ubuntu. Decompress the package, change the name to nmon, and upload it to Linux. Enter ls in the Linux terminal to see:
SLG @ SLG-desktop :~ /Desktop/gvs Project/nmon $ ls
Nmon_x86_debian31 nmon_x86_knoppix5 nmon_x86_rhel3 nmon_x86_sles10
Nmon_x86_fedora5 nmon_x86_rhel2 nmon_x86_rhel4 nmon_x86_sles9

To use the nmon tool normally, we need to modify the permissions of related files. The Linux system we use here is Ubuntu, so we only modify the "nmon_x86_debian31" file.
. For convenience, change to 777 directly. After the command chmod 777 nmon_x86_debian31 is modified, We have installed the nmon tool. Next we will introduce how to use the tool.

Ii. Use nmon
The nmon tool is very easy to use. First, start the tool. In the nmon directory, enter./nmon_x86_debian31 to open the interface and follow the prompts to perform the operation,
┌ Nmon-11f ── ─ ── hostname = SLG-desktop ── refresh = 2 secs ──. 08 ── ─

│ ------------------------------ For help type H or... │
│ ######### Nmon -? -Hint │
│ ########### Nmon-H-full │
│ ########### │
│ ######### To start the same way every time │
│ ######### Set the nmon KSh variable │
│ ######### │
│ ------------------------------ │

│ Use these keys to toggle statistics on/off: │
│ C = cpu l = CPU long-term-= faster screen updates │
│ M = memory J = filesystems + = slower screen updates │
│ D = disks n = Network v = Virtual Memory │
│ R = Resource n = NFS v = verbose hints │
│ K = kernel T = Top-processes. = only busy disks/procs │
│ H = more options q = quit │
│ ── ─ ── ─ │

Enter C to Display CPU information;
CPU utilisation ── ─ ── ─ │
│ + ------------------------------------------------- + │
│ Cpu user % sys % wait % idle | 0 | 25 | 50 | 75 100 | │
│ | Please wait gathering data │
│ + ------------------------------------------------- + │
│ ── ─ ── ─

Iii. output file

The above is only about server monitoring. What we really need is how to collect the data and process and analyze them. Nmon provides an nmon_analyser analysis tool that can use Excel to analyze statistical results. During the test, we can use the following command to output data:
./Nmon_x86_debian31-FT-S 5-C 5
The preceding command indicates the-F output file, the-T output process that consumes the most resources, the-s data collection interval, and the-C data collection times. For example, if the test scenario takes 20 minutes, we need to monitor Linux system resources every 10 seconds:
./Nmon_x86_debian31-FT-S 10-C 120
120 indicates the number of times, that is, 20 minutes/10 seconds = 120 times. A. nmon file is generated in the current directory.
.
SLG @ SLG-desktop :~ /Desktop/gvs Project/nmon $ ls
Nmon_x86_debian31 nmon_x86_knoppix5 nmon_x86_rhel3 nmon_x86_sles10 slg-desktop_090113_1024.nmon
Nmon_x86_fedora5 nmon_x86_rhel2 nmon_x86_rhel4 nmon_x86_sles9
The name of the nmon output file is server name_datetime. nmon. After the test, we can extract these files from the corresponding directory.

Iv. Analyze Data

Open nmon analyser v334
Set the macro security level to low. Click the analyser nmon data button and save the file as an Excel file.

 

Bytes ----------------------------------------------------------------------------------------------------------------------------

 

 

The topas command in the downstream of Aix can detect the system running status. There is only one top in Linux, but it is not very friendly. Today, I found an open-source tool numon, which can monitor resource usage in Linux and Aix. The interface is much more powerful than the top one, as well as analysis tools. Share some good things:

 

1. download and use

Nmon:

Http://www.ibm.com/developerworks/wikis/display/WikiPtype/nmon

Select the desired version:

For example, I used RedHat e 5.3, so I chose the download point under "nmon for Linux download" below. Click it to go to the "nmon for Linux" homepage and select "for the pre-compiled versions-click on download" in detail (the pre-compiled binary file is selected here, if you want to studySource code~), Open the download page:

 

Select a download point based on the CPU type. Here, select nmon under the 32-bit redhat5.3.

Decompress the package, as shown in the following figure.

The selected file is what we need!

Then run the file./nmon_x86_rhel52. The interface is as follows:

 

Check whether it is similar to the topas in Aix? Nmon provides some options for us to view, such as viewing CPU by C, viewing disk Io by D, and viewing network conditions by N.

Nmon options:

 

Ii. Data Analysis

Nmon also provides data analysis functions.

#./Nmon-F-S 30-C 100
Note: detection is performed once every 30 seconds, 100 times in total, and the results are output to the default file.

-F is output as a file. The default output format is machine name + date. nmon. You can also use-F to specify the output file name, for example:

#./Nmon_x86_rhel4-F test. nmon-S 30-C 100
-S indicates the sampling frequency, and the interval for collecting data. Here I specify 30 seconds;

-C indicates the number of samples. The total number of samples to be collected is 100.
Note: the size of the files collected at a time cannot exceed 330 KB (in Excel). It is OK if the value of-C in nmon does not exceed times.
./Nmon-F-S 10-C 150
The files generated by nmon are large. We recommend that you collect too many files each time. If you need to collect data for a long time, we recommend that you collect them separately, that is, generate multiple files, in Linux, multiple jobs can be created, for example:
Create a script, for example, nmon. Sh, as follows:
#! /Bin/sh
./Nmon_x86_rhel4-F 6326081116_6am.nmon-S 60-C 240
Authorize this file:
# Chmod 777 nmon. Sh
Then create a job:
# At-F nmon. Sh 6: 00 January 16

 

After the generated file is opened with a analyzer, the results are automatically analyzed and saved to an Excel file. The analysis results are as follows ::Analyzer, you need to adjust the macro security level of Excel

 

 

 

 

3. Resource file http://sosuny.iteye.com/blog/686160

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.