nmon Command
The nmon (Nigel's Monitor) command is a powerful and versatile system performance monitoring tool for Linux and AIX. It provides a comprehensive, real-time view of various system resources, including CPU, memory, disk I/O, network I/O, top processes, and more. It can also save data for later analysis.
Syntax
Description
nmon can operate in two main modes: interactive mode for real-time monitoring and data collection mode for saving performance statistics to a file. In interactive mode, users can press various keys to toggle different statistics views. The collected data files (.nmon) can be imported into the nmon analyzer spreadsheet tool for graphical analysis.
Key features of nmon:
- Real-time display of system performance metrics.
- Monitors CPU, memory, disk, network, and top processes.
- Supports data collection for historical analysis.
- Lightweight and low overhead.
- Useful for identifying performance bottlenecks and trends.
Common Options
| Option | Description |
|---|---|
-s <seconds> |
Data collection interval in seconds. |
-c <count> |
Number of data collection snapshots. |
-f |
Output data to a file (default filename is hostname_YYMMDD_HHMM.nmon). |
-t |
Include top processes in the output. |
-A |
Include all sections in the output file. |
-F <filename> |
Specify the output filename. |
-h |
Display help information. |
Examples
Start real-time interactive monitoring
Launches nmon in interactive mode. Press keys like c, m, d, n, t to view different statistics.
Collect performance data for 1 hour (30s interval, 120 snapshots)
Collects data every 30 seconds for 120 times, saving it to a .nmon file.
Collect data with top processes and custom filename
Saves performance data, including top processes, to my_server_perf.nmon, with 60 snapshots at 60-second intervals.
Analyze a .nmon file (using nmon analyzer)
Steps to visualize the collected performance data using the nmon analyzer spreadsheet.