nmon (Nigel’s performance Monitor) is a terminal-based performance monitoring tool for Linux and AIX that displays CPU, memory, disk, network, file system and process statistics on one screen and can also record them to a file at fixed intervals for later analysis. In Linux monitoring it sits between interactive viewers such as top and htop and long-term collectors such as sar.
Its distinguishing feature is the dual mode of operation: an interactive curses display that an administrator toggles section by section, and a capture mode that writes timestamped snapshots in a comma-separated format suitable for spreadsheets and graphing tools.
How nmon collects and displays data
nmon reads its figures from the procfs and sysfs interfaces, mainly files such as /proc/stat, /proc/meminfo, /proc/diskstats and /proc/net/dev. It samples these counters at each refresh, computes differences between samples and turns them into rates such as percent CPU busy, kilobytes per second or transfers per second.
The interactive screen is built from sections that the user switches on with single keys. Several sections can be shown at once, so an administrator can watch CPU, disks and network together while reproducing a problem.
| Key | Section | What it shows |
|---|---|---|
| c | CPU | Per-core user, system, wait and idle bars |
| m | Memory | RAM, swap, cache and buffer usage |
| d | Disks | Read and write throughput per device |
| n | Network | Receive and transmit rates per interface |
| t | Top processes | Processes sorted by resource use |
| j | File systems | Size, used and free space per mount |
| k | Kernel | Run queue, context switches, interrupts |
| q | Quit | Exits the program |
The refresh interval defaults to two seconds and can be changed with the -s option. Shorter intervals reveal brief spikes but add measurement overhead and make the display harder to read.
Recording mode and the nmon file format
In recording mode, nmon runs unattended in the background and writes one snapshot per interval to a file named after the host, date and time with the .nmon extension. The command nmon -f -s 60 -c 1440 captures one snapshot per minute for 24 hours, a common baseline for daily analysis.
The following options control what is captured and for how long.
| Option | Meaning | Typical use |
|---|---|---|
| -f | Write to a file instead of the screen | Every capture run |
| -s seconds | Interval between snapshots | 10 to 300 seconds |
| -c count | Number of snapshots to take | Sets total duration with -s |
| -t | Include top processes | Finding which process causes load |
| -m directory | Output directory | Storing captures on a separate disk |
| -F filename | Explicit output file name | Scripts and scheduled jobs |
Each line of the output starts with a section tag such as CPU_ALL, MEM, DISKREAD or NET, followed by a snapshot identifier and values. Tools such as the nmon analyser spreadsheet and nmonchart convert these files into graphs, and many administrators load them into scripts or time-series databases.
nmon compared with other Linux monitoring tools
nmon overlaps with several standard tools, and the choice depends on whether the task is live diagnosis, recording or deep tracing. The comparison below places nmon among its closest neighbors.
| Tool | Primary strength | Recording | Scope |
|---|---|---|---|
| nmon | All subsystems on one screen | Yes, CSV-like file | System-wide |
| top and htop | Process list and CPU | No | Processes |
| sar | Long-term history via sysstat | Yes, binary files | System-wide |
| atop | Per-process resource accounting | Yes, binary files | System and process |
| Glances | Web and API output | Export plugins | System-wide |
| iostat and vmstat | Focused subsystem counters | No | Disk or memory |
The practical difference from sar is that nmon files are plain text and self-contained, so they can be copied to a workstation and opened without the sysstat tools. The trade-off is larger file sizes and no built-in daemon for permanent collection.
Interpreting nmon output correctly
Reading nmon well requires knowing what each counter actually measures. CPU wait time indicates idle CPUs with outstanding I/O, not a busy processor, and high values point to storage latency rather than a lack of compute power.
- Memory shown as cached is reclaimable page cache, so low free memory alone is not a problem.
- Disk busy near 100 percent on SSD or NVMe devices can be misleading, because these devices serve many requests in parallel.
- Run queue longer than the core count for sustained periods indicates CPU saturation.
- Swap activity, not swap usage, is the signal of memory pressure.
- Network figures are throughput only and do not show packet loss or retransmissions.
For more precise saturation signals, nmon data is often combined with Pressure stall information from the kernel, which measures how long tasks actually waited for CPU, memory or I/O.
Practical use and common mistakes
nmon is most valuable for capturing a reproducible baseline before a change and comparing it with a capture taken afterward. It is available as a package in most distributions and runs as a single binary with very low overhead, typically well below one percent of one core at minute-level intervals.
| Situation | Recommended setting | Reason |
|---|---|---|
| Daily capacity baseline | -f -s 60 -c 1440 | Full day at manageable size |
| Short load test | -f -s 5 -c 720 | One hour with fine detail |
| Live incident triage | Interactive with c, d, m, t | Immediate view of all subsystems |
| Process attribution | Add -t to capture | Links load to specific processes |
Common mistakes include leaving captures running indefinitely and filling a file system, using intervals so short that files grow to hundreds of megabytes, and comparing captures taken with different intervals. Another frequent error is treating averages as peaks, because a 60-second sample hides spikes that last a few seconds.
In simple terms
nmon is like a dashboard for a Linux computer. It shows on one screen how hard the processor is working, how much memory is in use and how busy the disks and network are.
It can also act like a flight recorder, writing down these numbers every minute so that someone can look back later and see exactly when and why the machine slowed down.
A practical example
An operations team supports a Linux database server whose nightly batch job has started finishing two hours late. Users report slow reports each morning, but by the time anyone logs in, the server looks idle.
The administrator schedules nmon -f -t -s 30 -c 960 through cron to start at 22:00 and run for eight hours. The next morning, the capture is opened in a graphing tool and shows CPU wait time above 40 percent from 01:10 onward, while one disk reads at full throughput and the top-process section points to a backup job.
The backup had been moved to the same volume as the database files during a storage migration. After it is rescheduled to start at 04:00, the batch job again finishes within its two-hour window, and the next nmon capture confirms that disk wait has fallen below 5 percent.