Nmon linux ��� ���

Install and Use nmon Tool To Monitor Linux Systems Performance

H ow do I install nmon command under Linux operating systems to find out performance information for my CPU, memory, network, disk, virtual memory, top process and other part of my HP server running on Debian Linux or CentOS Linux 6.x amd64 bit server?

This systems administrator, tuner, benchmark tool gives you a huge amount of important performance information in one go with a single binary.

Tutorial details
Difficulty level Intermediate
Root privileges Yes
Requirements None
Est. reading time N/A

It works on Linux, IBM AIX Unix, Power, x86, amd64 and ARM based system such as Raspberry Pi. The nmon command displays and records local system information. The command can run either in interactive or recording mode.

Debian / Ubuntu Linux Install nmon

Type the following apt-get command:
# apt-get install nmon
Sample outputs:

A note about RHEL / CentOS Linux user

Compiling Nmon Under RHEL / CentOS / Fedora / Scientific Linux

Grab the source code and makefile using wget command:
$ wget http://ncu.dl.sourceforge.net/project/nmon/lmon14g.c
$ wget http://ncu.dl.sourceforge.net/project/nmon/makefile
You need to install ncurses-devel package, enter:
# yum install ncurses-devel
Rename file, enter:
$ mv lmon14g.c lmon.c
Open the makefile and find the the directive that matches your platform and Linux release:
$ vi makefile
To compile for RHEL/CentOS v5.x, enter:
$ make nmon_x86_rhel52
Sample outputs:

You can move nmon_x86_rhel52 to /usr/local/sbin, enter:
# mv nmon_x86_rhel52 /usr/local/sbin/nmon

How do I use nmon?

Simply type the following command:
# nmon
Sample outputs:

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

Fig.01: nmon startup screen

nmon keyboard shortcuts

  • q – To stop and exit nmon.
  • h – To see quick help (hint) screen and press h again to remove the hints.
  • Use the following command to turn on or off stats:
    • c – See cpu stats.
    • m – See memory stats.
    • d – See disk stats.
    • k – See kernel stats.
    • n – See network stats.
    • N – See NFS stats.
    • j – See file system stats.
    • t – See top process.
    • V – See virtual memory stats.
    • . – See only busy disks/procs.
    • v – Verbose mode (display as Ok/warning/danger on screen).

Sample output from my home server:

Fig.02: nmon command in action

How do I set default monitoring options for nmon?

To see the memory, network, disk and processor statistics immediately after the nmon command is started, run (or add in your shell startup file):
# export NMON=mndc
Run the nmon command:
# nmon

Capturing and analyzing data with nmon

You can capture the data to a file for later analysis and graphing. Type the following command:
# nmon -f -s2 -c 30
OR
# nmon -ft -s 30 -c 120
nmon will run as a daemon in the background and you can log out. nmon will complete the data file capture and it will save in a file *.nmon file such as nas02_120806_0202.nmon. Where,

  1. -f : Start data collect mode and output in spreadsheet format.
  2. -s 2 : Wait between 2 seconds refreshing the screen.
  3. -c30 : Total number of refreshes (30).
  4. -t : Spreadsheet includes top processes.
  5. -d disks : to increase the number of disks [default 256]
  6. -x : Capacity planning (15 min for 1 day = -fdt -s 900 -c 96)

You need to download nmonanalyser which is an Excel spreadsheet that takes an output file from nmon and produces some nice graphs to aid in analysis and report writing.

See a quick installation and demo of nmon command:

(Video 01: nmon Linux installation and quick usage demo)

Recommended readings:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Источник

Linux | Nmon

Nmon is a fully interactive performance monitoring command-line utility tool for Linux. It is a benchmark tool that displays performance about the CPU, MEMORY, NETWORK, DISKS, FILE SYSTEM, NFS, TOP PROCESSES, RESOURCES, AND POWER MICRO-PARTITION.

INSTALLATION
On Ubuntu/Debian :

On Fedora:

CentOS/RHEL:

Once the installation of Nmon has been finished and you launch it from the terminal by typing the ‘nmon‘ command you will be presented with the following output.

Check CPU by processor
In order to get the CPU performance, you should hit the ‘c‘ key on the keyboard of the system you are using.

CPU by processor

Top Process Details
In order to get the top processes that are running currently, you should hit the ‘t‘ key on the keyboard of the system you are using.

Check Network Statistics
In order to check network statistics, you should hit the ‘n‘ key on the keyboard of the system you are using.

Disk I/O Graphs
In order to get informations of disks, you should hit the ‘d‘ key on the keyboard of the system you are using.

Monitor Disk I/O

Check Kernel Information
In order to check kernel information, you should hit the ‘k‘ key on the keyboard of the system you are using.

Check Linux Kernel Information

Get System Information
In order to get system information on different resources such as operating system version, Linux Version, Machine architecture, you should hit the ‘r‘ key on the keyboard of the system you are using.

Check File System Statistics
In order to check File System Statistics, you should hit the ‘j‘ key on the keyboard of the system you are using. You can get information on the size of the file system, used space, free space, type of the file system and the mount point.

File System Statistics

Virtual Memory Statistics
In order to check Virtual Memory Statistics, you should hit the ‘V‘ key on the keyboard of the system you are using.

Virtual Memory Statistics

CPU Long Term
In order to check CPU Long Term Statistics, you should hit the ‘l‘ key on the keyboard of the system you are using.

Источник

Nmon: Analyze and Monitor Linux System Performance

If you are looking for a very easy to use performance monitoring tool for Linux, I highly recommend to install and use the Nmon command-line utility.

Nmon Monitoring Tool

Nmon is a system’s administrator tuner, benchmark tool that can be used to display performance data about the followings:

  1. cpu
  2. memory
  3. network
  4. disks
  5. file systems
  6. nfs
  7. top processes
  8. resources
  9. power micro-partition

A very nice thing I really like about this tool is the fact that it is fully interactive and helps the Linux user or the system administrator with the necessary command to get the most out of it.

Installing Nmon Monitoring Tool in Linux

If you are using a Debian/Ubuntu based Linux distribution you can easily install the Nmon command-line utility by grabbing it from the default repositories.

To install, Open a new terminal (CTRL+ALT+T) and use the following command.

Are you a Fedora user? To install in your machine open a new terminal and run the following command.

CentOS/RHEL users can install it, by installing EPEL repository as shown:

How to use Nmon to Monitor Linux Performance

Once the installation of Nmon has been finished and you launch it from the terminal by typing the ‘nmon‘ command you will be presented with the following output.

Nmon Preview

As you guys can see from the above screenshot, the nmon command-line utility runs completely in interactive mode and it presents the user with the keys to toggle statistics.

Check CPU by processor

For example, if you would like to collect some statistics on CPU performance you should hit the ‘c‘ key on the keyboard of the system you are using. After hitting the ‘c‘ key on my keyboard I get a very nice output that gives me information on my CPU usage.

CPU by Processor

The following are the keys you can use with the utility to get information on other system resources present in your machine.

  1. m = Memory
  2. j = Filesystems
  3. d = Disks
  4. n = Network
  5. V = Virtual Memory
  6. r = Resource
  7. N = NFS
  8. k = kernel
  9. t = Top-processes
  10. . = only busy disks/procs

Top Process Statistics

To get stats on top processes that are running on your Linux system press the key ‘t‘ on your keyboard and wait for the information to show up.

Top Processes

Those familiar with the top utility will understand and be able to interpret the above information very easy. If you are new to Linux system administering and have never used the top utility before, run the following command in your terminal and try to compare the produced output with the above one. Do they look similar, or is it the same output?

It looks like I am running the top process monitoring utility when I use the key ‘t‘ with the Nmon tool to me.

Check Network Statistics

How about some network stats? Just press ‘n‘ on your keyboard.

Network Statistics

Disk I/O Graphs

Use the ‘d‘ key to get information on disks.

Monitor Disk I/O

Check Kernel Information

A very important key to use with this tool is ‘k‘, it is used to display some brief information on the kernel of your system.

Check Linux Kernel Information

Get System Information

A very useful key for me is the key ‘r‘ which is used to give information on different resources such as machine architecture, operating system version, Linux version and CPU. You can get an idea of the importance of the key ‘r‘ by looking the following screenshot.

System Information

Check File System Statistics

To get stats on the file systems press ‘j‘ on your keyboard.

File System Statistics

As you can see from the above screenshot, we get information on size of the file system, used space, free space, type of the file system and the mount point.

Display NFS Data

The key ‘N‘ can help to collect and display data on NFS.

NFS Data

So far it has been very easy to work with the Nmon utility. There are many other thing you need to know about the utility and one of them is the fact that you can use in data captured mode. If you don’t like the data to be displayed on the screen you can easily capture a small sample file with the following command.

After running the above command you will get a file with ‘.nmon‘ extension in the directory where you were while working with the tool. What is the ‘-f‘ option? The following is a simple and short explanation of the options used in the above command.

  1. The -f means you want the data saved to a file and not displayed on the screen.
  2. The -s13 means you want to capture data every 13 seconds.
  3. The -c 30 means you want thirty data points or snap shots.

Conclusion

There are many tools that can do the job of the Nmon utility, but none of them is so easy to use and friendly to a Linux beginner. Unfortunately the tool does not have as many features as other tools such as collectl and it can not provide in-depth stats to the user.

At the end I can say it is a very nice utility for a Linux system administrator, especially for someone that is not familiar with command-line options and commands.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

We are thankful for your never ending support.

Источник

Читайте также:  Как создать загрузочную флешку с установленной windows 10
Оцените статью