nmon stands for Nigel’s performance Monitor for Linux & AIX, developed by IBM employee Nigel Griffiths. Initially, it was developed for IBM AIX operating system, later a version written for Linux too and released as a open source under GPL on 2009.
nmon is a another nifty tool to monitor various system resources such as CPU, memory, network, disks, file systems, NFS, top processes, Power micro-partition and resources (Linux version & processors) on Linux terminal.
It support common architectures like POWER, x86, x86_64, Mainframe & now ARM (Raspberry Pi). This system administrator tuner, benchmark tool gives you a huge amount of important performance information which will help you to troubleshoot the system performance when you have the issues.
For real-time monitoring it uses curses library for low CPU impact and you can see the data directly on the screen and updated every two seconds. Alternatively you can save the data to file for later analysis.
So many command line system performance monitoring tool is available in Linux like Top, Htop, etc but why i wrote about nmon because we can enable/disable the required statistics widgets with any sequence but all other tools not like that.
Install Nmon on Debian/Ubuntu/Mint
Debian based users can install nmon easily from distribution official repository by using below command.
$ sudo apt-get install nmon
Install Nmon on Fedora
Fedora users can install nmon easily from distribution official repository by using below command.
$ sudo dnf install nmon
Install Nmon on RHEL/CentOS
RHEL/CentOS users need to install/enable EPEL Repository in order to install nmon.
$ sudo yum install nmon
Install Nmon on openSUSE
openSUSE users can install nmon easily from distribution official repository by using below command.
$ sudo zypper in nmon
How to use nmon to monitory system performance
nmon wont required high end tech skill to work on it. Just type nmon and hit enter you will be presented with welcome screen similar to this. Welcome screen itself you will get all the major options to work further.
To display/hide particular widgets statistics, just press the associated key. Say for example, if you want to display CPU utilization
, just press c
and press again the same key c
to hide the CPU utilization widgets statistics.
$ nmon βnmonβ14gβββββββββββββββββββββHostname=2daygeekββRefresh= 2secs βββ07:09.46ββββββββββββββββββββ β β β ------------------------------ 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 β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β β β β β β β β β β β β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Check CPU utilization by processor
Just press c
key, to see the CPU utilization based on the processor. Each CPU shows (user process, sys process & wait process utilization).
βnmonβ13gββββββ[H for help]βββHostname=2daygeekββRefresh= 2secs βββ07:06.29ββββββββββββββββββββ β CPU Utilisation βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β +-------------------------------------------------+ β βCPU User% Sys% Wait% Idle|0 |25 |50 |75 100| β β 1 0.5 0.0 0.0 99.5| > | β β 2 0.0 0.0 0.0 100.0| > | β β +-------------------------------------------------+ β βAvg 0.2 0.2 0.0 99.5| > | β β +-------------------------------------------------+ β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β β β β β β β β β β β β β β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Check memory utilization
Just press m
key to see memory utilization stats (cached, active, inactive, buffered, free in MB & free percent)
βnmonβ14gββββββ[H for help]βββHostname=2daygeekββRefresh= 2secs βββ07:24.44ββββββββββββββββββββ β Memory Stats ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β RAM High Low Swap Page Size=4 KB β β Total MB 32079.5 -0.0 -0.0 20479.0 β β Free MB 11205.0 -0.0 -0.0 20479.0 β β Free Percent 34.9% 100.0% 100.0% 100.0% β β MB MB MB β β Cached= 19763.4 Active= 9617.7 β β Buffers= 172.5 Swapcached= 0.0 Inactive = 10339.6 β β Dirty = 0.0 Writeback = 0.0 Mapped = 11.0 β β Slab = 636.6 Commit_AS = 118.2 PageTables= 3.5 β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β β β β β β β β β β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Check disk utilization
Just press d
key to see disk utilization for each disk partition (each disk partition read, write shows in KB & busy shows in percent. Over all disk partition read & write shows in MB & data transfer rate shows in sec).
βnmonβ14gββββββ[H for help]βββHostname=2daygeekββRefresh= 2secs βββ07:26.59ββββββββββββββββββββ β Disk I/O ββ/proc/diskstatsββββmostly in KB/sβββββWarning:contains duplicatesβββββββββββββββββ βDiskName Busy Read Write Xfers Size Peak% Peak-RW InFlight β βsda 0% 0.0 10.0KB/s 2.5 4.0KB 0% 18.0KB/s 0 β βsda1 0% 0.0 0.0KB/s 0.0 0.0KB 0% 0.0KB/s 0 β βsda2 0% 0.0 10.0KB/s 2.5 4.0KB 0% 18.0KB/s 0 β βsda3 0% 0.0 0.0KB/s 0.0 0.0KB 0% 0.0KB/s 0 β βsdb 0% 0.0 0.0KB/s 0.0 0.0KB 0% 0.0KB/s 0 β βsdb1 0% 0.0 0.0KB/s 0.0 0.0KB 0% 0.0KB/s 0 β βTotals Read-MB/s=0.0 Writes-MB/s=0.0 Transfers/sec=5.0 β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β β β β β β β β β β β β β β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Check Network utilization
Just press n
key to see Network utilization based on the Network interface (Inter face name, Data received & Data send KB/s, packet in, packet out, insize, outsize & Total data transaction)
βnmonβ14gββββββ[H for help]βββHostname=2daygeekββRefresh= 2secs βββ07:28.18ββββββββββββββββββββ β Network I/O βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ βI/F Name Recv=KB/s Trans=KB/s packin packout insize outsize Peak->Recv Trans β β lo 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 β β eth0 0.0 0.0 0.0 0.0 0.0 0.0 5.2 22.4 β β eth1 0.0 0.2 0.5 0.5 60.0 330.0 2.0 15.4 β β eth2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 β β eth3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 β β bond0 0.0 0.2 0.5 0.5 60.0 330.0 7.3 37.8 β β usb0 0.1 0.1 1.5 1.5 65.3 79.3 9.9 11.7 β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β β β β β β β β β β β β β β β β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Check Top processes
Just press t
key to see Top processes which is similar to Top command utility.
βnmonβ14gββββββ[H for help]βββHostname=2daygeekββRefresh= 2secs βββ07:28.57ββββββββββββββββββββ β Top Processes Procs=625 mode=3 (1=Basic, 3=Perf 4=Size 5=I/O)ββββββββββββββββββββββββββββββββ β PID %CPU Size Res Res Res Res Shared Faults Command β β Used KB Set Text Data Lib KB Min Maj β β 16528 2.0 17720 4876 112 7384 0 948 308 0 nmon β β 1 0.0 19356 1520 140 404 0 1196 0 0 init β β 2 0.0 0 0 0 0 0 0 0 0 kthreadd β β 3 0.0 0 0 0 0 0 0 0 0 migration/0 β β 4 0.0 0 0 0 0 0 0 0 0 ksoftirqd/0 β β 5 0.0 0 0 0 0 0 0 0 0 stopper/0 β β 6 0.0 0 0 0 0 0 0 0 0 watchdog/0 β β 7 0.0 0 0 0 0 0 0 0 0 migration/1 β β 8 0.0 0 0 0 0 0 0 0 0 stopper/1 β β 9 0.0 0 0 0 0 0 0 0 0 ksoftirqd/1 β β 10 0.0 0 0 0 0 0 0 0 0 watchdog/1 β β 11 0.0 0 0 0 0 0 0 0 0 migration/2 β β 12 0.0 0 0 0 0 0 0 0 0 stopper/2 β β 13 0.0 0 0 0 0 0 0 0 0 ksoftirqd/2 β β 14 0.0 0 0 0 0 0 0 0 0 watchdog/2 β β 15 0.0 0 0 0 0 0 0 0 0 migration/3 β β 16 0.0 0 0 0 0 0 0 0 0 stopper/3 β β 17 0.0 0 0 0 0 0 0 0 0 ksoftirqd/3 β β 18 0.0 0 0 0 0 0 0 0 0 watchdog/3 β β 19 0.0 0 0 0 0 0 0 0 0 migration/4 β β 20 0.0 0 0 0 0 0 0 0 0 stopper/4 β β 21 0.0 0 0 0 0 0 0 0 0 ksoftirqd/4 β β 22 0.0 0 0 0 0 0 0 0 0 watchdog/4 β β 23 0.0 0 0 0 0 0 0 0 0 migration/5 β β 24 0.0 0 0 0 0 0 0 0 0 stopper/5 β β 25 0.0 0 0 0 0 0 0 0 0 ksoftirqd/5 β β 26 0.0 0 0 0 0 0 0 0 0 watchdog/5 β β 27 0.0 0 0 0 0 0 0 0 0 migration/6 β β 28 0.0 0 0 0 0 0 0 0 0 stopper/6 β β 29 0.0 0 0 0 0 0 0 0 0 ksoftirqd/6 β ββββββββββWarning: Some Statistics may not shownβββββββββββββββββββββββββββββββββββββββββββββββ
Check system information
Just press r
key to see varies system information like, kernel version, gcc version, CPU info, No of CPUs, Machine architecture, distribution name, distribution code name & distribution version no)
βnmonβ16fββββββ[H for help]βββHostname=daygeekββββββRefresh= 2secs βββ03:04.19βββββββββββββββββ β Resources Linux & Processor βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β Linux: Linux version 4.8.0-22-generic (buildd@lgw01-11) β β Build: (gcc version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12) ) β β Release : 4.8.0-22-generic β β Version : #24-Ubuntu SMP Sat Oct 8 09:15:00 UTC 2016 β β cpuinfo: model name : Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz β β cpuinfo: vendor_id : GenuineIntel β β cpuinfo: cpu MHz : 2592.002 β β cpuinfo: wp : yes β β # of CPUs: 1 β β Machine : x86_64 β β Nodename : daygeek β β /etc/*ease[1]: DISTRIB_ID=Ubuntu β β /etc/*ease[2]: DISTRIB_RELEASE=16.10 β β /etc/*ease[3]: DISTRIB_CODENAME=yakkety β β /etc/*ease[4]: DISTRIB_DESCRIPTION="Ubuntu 16.10" β β lsb_release: Distributor ID: Ubuntu β β lsb_release: Description: Ubuntu 16.10 β β lsb_release: Release: 16.10 β β lsb_release: Codename: yakkety β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β β β β β β β β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Load more then one widgets
Just press c,m,d,n
key to see CPU, memory, disk & network utilization on your system.
βnmonβ14gβββββββββββββββββββββHostname=2daygeekββRefresh= 2secs βββ07:30.42ββββββββββββββββββββ β Memory Stats ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β RAM High Low Swap Page Size=4 KB β β Total MB 32079.5 -0.0 -0.0 20479.0 β β Free MB 11205.2 -0.0 -0.0 20479.0 β β Free Percent 34.9% 100.0% 100.0% 100.0% β β MB MB MB β β Cached= 19763.4 Active= 9617.8 β β Buffers= 172.5 Swapcached= 0.0 Inactive = 10339.5 β β Dirty = 0.0 Writeback = 0.0 Mapped = 11.0 β β Slab = 636.6 Commit_AS = 118.7 PageTables= 3.5 β β Network I/O βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ βI/F Name Recv=KB/s Trans=KB/s packin packout insize outsize Peak->Recv Trans β β lo 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 β β eth0 0.0 0.0 0.0 0.0 0.0 0.0 0.5 5.9 β β eth1 0.0 0.1 0.5 0.5 60.0 234.0 0.1 2.9 β β eth2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 β β eth3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 β β bond0 0.0 0.1 0.5 0.5 60.0 234.0 0.5 8.8 β β usb0 0.1 0.1 1.5 1.5 65.3 79.3 0.7 0.8 β β Disk I/O ββ/proc/diskstatsββββmostly in KB/sβββββWarning:contains duplicatesβββββββββββββββββ βDiskName Busy Read WriteKB|0 |25 |50 |75 100| β βsda 0% 0.0 0.0|> | β βsda1 0% 0.0 0.0|> | β βsda2 0% 0.0 0.0|> | β βsda3 0% 0.0 0.0|> | β βsdb 0% 0.0 0.0|> | β βsdb1 0% 0.0 0.0|> | β βTotals Read-MB/s=0.0 Writes-MB/s=0.0 Transfers/sec=0.0 β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β β β β β β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Enjoy..)