Report issue Add example

atop

Tool for monitoring Linux system resources and processes

Additional Information

The atop command is an open-source system monitoring tool that records the operating status of the system at a certain frequency. The collected data includes system resource usage (CPU, memory, disk, and network) and process operation status, and can be saved to the disk in the form of log files. When a problem occurs on the server, we can obtain the corresponding atop log files for analysis. atop is open-source software, and you can get its source code and RPM installation packages from their respective links.

Syntax

atop [options] [parameters]

Description

ATOP Column

This column shows the hostname, sampling date, and time.

PRC Column

This column shows the overall running status of processes:

CPU Column

This column shows the overall usage of the CPU (i.e., multi-core CPU as a whole CPU resource):

The sum of the values in the CPU column is N00%, where N is the number of CPU cores.

cpu Column

This column shows the usage of a specific CPU core. The meaning of each field is the same as in the CPU column, and the sum of the fields is 100%.

CPL Column

This column shows the CPU load status:

MEM Column

This column indicates memory usage:

SWP Column

This column indicates swap space usage:

PAG Column

This column indicates virtual memory paging status:

DSK Column

This column indicates disk usage. Each disk device corresponds to a column. If there is an sdb device, an additional DSK column is added:

NET Column

Multiple NET columns show network status, including the transport layer (TCP and UDP), IP layer, and information for each active network interface:

atop Logs

A series of sampled pages over time forms an atop log file. We can use the atop -r XXX command to view the log file. Log files are saved as follows:

The atop developers provide the above log saving methods, and the corresponding atop.daily script can be found in the source directory. In the atop.daily script, we can change the atop sampling period (default is 10 minutes) by modifying the INTERVAL variable; we can change the log retention period (default is 28 days) by modifying the numerical value in the following command:

(sleep 3; find $LOGPATH -name 'atop_*' -mtime +28 -exec rm {} \; )& 

Finally, we can modify the cron file to execute the atop.daily script every day at midnight:

0 0 * * * root /etc/cron.daily/atop.daily