Skip to content

Linux System Monitoring

Introduction

To ensure that your Linux server-based applications and services are running smoothly, it is essential to monitor the server and its connectivity status. Linux system monitoring tools can provide reassurance when things are working correctly and help identify unusual behavior, performance anomalies, and their source when the server misbehaves. By mastering these dedicated applications, most of which are built into the operating system, you’ll be well on your way to becoming a Linux system administrator expert.

All server monitoring programs have a common goal: to ensure that a server is performing optimally. They provide information that allows Linux administrators to understand what’s happening and sometimes automate their responses to those situations. Linux system monitoring tools achieve this by collecting data on each server’s key performance indicators (KPIs), network connectivity, and application availability.

To ensure peak server performance, Linux system monitoring programs are used to:

  • Verify hardware functionality.
  • Confirm server uptime.
  • Ensure that server resources are adequate for mission-critical applications and services to operate optimally.
  • Identify and resolve any resource bottlenecks that are impacting operations.
  • Alert system administrators when a KPI fails to meet its specified metric.
  • Present data in a visual way, such as dashboards, graphs, and weather maps, to highlight trends that may not be immediately apparent from raw data.

These programs track the following:

  • The real-time status of the server
  • Data collected over time to enable analysis of long-term trends
  • Data collected to determine the best use of server resources for mission-critical applications. For example, which database storage engine, InnoDB or MyISAM, works best?

Linux system monitors examine the following areas:

  • Memory usage
  • CPU usage
  • Storage usage, which includes disk space and Input/Output Operations per Second (IOPS)
  • Network usage

The system load of a server, a term frequently used in these discussions, generally refers to the usage of memory, CPU, and storage.

Linux system monitoring tools

The Linux operating system includes dozens of built-in server system monitoring commands. They range from simple commands like top, which displays Linux processes in order of CPU activity by default, to highly complex tools like sar. Sar collects, reports, and saves a wide variety of system activity information.

There are many system monitoring programs available for all distributions that allow you to monitor any Linux server. Some higher-level options include Glance, which is a Python-based cross-platform system monitoring tool; htop, another cross-platform system monitor that uses ncurses for its display; and Netdata, a distributed server system monitoring program. However, while these can be useful, they all rely on lower-level programs.

Four important Linux system monitoring tools are worthwhile to examine in more detail.

Sar: System Activity Reporter (sar) is part of the Sysstat system resource utilities package. Sar is a comprehensive monitoring tool that measures CPU activity, memory/paging, interrupts, device load, network, process and thread allocation, and swap space utilization. Sar can be used interactively, but its real value lies in its ability to keep data logs over a long period of time. These logs can be used to troubleshoot recurring problems and produce reports. For more information, please read our How to Use the System Activity Reporter (sar) guide.

Vmstat: This virtual memory statistics reporter is a built-in Linux command-line tool that reports in detail on virtual memory usage. Vmstat also gathers information on memory usage, memory paging, processes, I/O, CPU, and storage scheduling. Unlike sar, vmstat starts on boot and reports on cumulative activity since the last reboot. Our Use vmstat to Monitor System Performance guide includes more information about getting started with this monitoring tool.

Monitorix: Monitorix is a free, open-source tool that monitors multiple Linux services and system resources. Starting from version 3.0, Monitorix comes with its own web server, making it useful for remote Linux system monitoring. Originally designed for the Red Hat Enterprise Linux (RHEL) operating system family, Monitorix now works on all major Linux server distributions. Please read our How to Use Monitorix for System Monitoring guide to learn more.

Nethogs: This free and open-source program extends the net top tool, tracking bandwidth by process. For example, suppose the amount of outbound traffic has increased on your Linux server; Nethogs helps you identify which process is generating the usage spikes. Other network monitoring utilities only break down the traffic by protocol or subnet.

Feedback