How to Install Nmon on Ubuntu 24.04/22.04/20.04

Nmon, known for its efficiency in system monitoring, is an essential utility for Linux users. It offers a detailed view into the workings of your system, presenting valuable data in an accessible manner. Its lightweight and versatile nature makes it a preferred choice for real-time performance analysis. Understanding Nmon’s features and benefits will help you make the most of this tool in your Ubuntu environment:

  • Real-Time System Monitoring: Delivers live updates on system performance.
  • Comprehensive Resource Tracking: Includes CPU, memory, disk, and network usage.
  • Easy-to-Interpret Interface: Presents complex data in an understandable format.
  • Customizable Displays: Allows users to focus on specific system aspects.
  • Low Resource Usage: Operates efficiently without burdening the system.
  • Versatility: Useful for both quick checks and in-depth analysis.

As you install Nmon, you’ll appreciate its ability to transform complex system data into actionable insights. Our next steps will lead you through a straightforward installation process, equipping you with a vital tool for system management on Ubuntu.

Update Ubuntu Before Nmon Installation

Before installing any new software, it is always a good idea to update your system’s package list. To do this, open a terminal by pressing Ctrl+Alt+T or searching for “Terminal” in the applications menu.

Type the following command into the terminal and press Enter:

sudo apt update

Install Nmon via APT Command

Once your system is up to date, you can install Nmon by typing the following command and pressing Enter:

sudo apt install nmon

This command will download and install Nmon on your system. Once installed, confirm the installation with the following command:

nmon --version

Run Nmon Command

Once Nmon is installed, you can run it by typing the following command into the terminal and pressing Enter:

nmon

This will launch the nmon tool and display its main interface. From here, you can use the various hotkeys and commands to display system performance statistics.

Example Nmon Commands

Display CPU Usage with Nmon

To monitor CPU usage using Nmon, execute the following command:

nmon -c

This command displays real-time CPU usage, including user, system, and idle time. Navigate through different data screens using the arrow keys for an in-depth analysis of CPU performance.

Monitor Memory Usage Effectively

For assessing memory usage, use the -m option with Nmon:

nmon -m

This provides a live overview of memory utilization, showing used, free, and buffered memory, crucial for effective memory management.

Track Network Activity

To monitor network activity, Nmon offers a straightforward command:

nmon -n

This command displays real-time network usage by the interface, detailing bytes sent and received, which is essential for network management.

Analyze Disk I/O with Nmon

Nmon can also monitor disk I/O. Use the following command for this purpose:

nmon -d

It presents a real-time view of disk read and write activities, aiding in understanding and optimizing disk performance.

Monitor Process Activity

Nmon provides detailed insights for process monitoring. Execute this command:

nmon -p

It shows real-time process activities, including CPU, memory, and I/O activities, which help identify resource-intensive processes.

Monitor Remote Systems

Nmon can also be used to monitor remote systems over SSH:

nmon -ssh user@remotehost

This command extends Nmon’s capabilities to remote systems, offering valuable performance insights.

Save Nmon Output to a File

To save Nmon’s output for later analysis, use the following command:

nmon -s 5 -c 10 -f nmon_output.csv

This saves the Nmon data in a CSV file, nmon_output.csv, in your current directory, with a sampling interval of 5 seconds and a total of 10 samples, making it a valuable resource for detailed analysis.

Conclusion

Throughout this guide, we’ve explored Nmon’s versatility and power, covering everything from basic CPU monitoring to advanced remote system analysis. Remember, Nmon is your go-to tool for delving deep into your system’s performance, whether you’re troubleshooting or just curious about how things are running. Keep experimenting with different commands to discover more about your Ubuntu system.

Leave a Comment