最上面的div下面有空隙_最上面的命令教程,以及监视Linux系统指标的示例

最上面的div下面有空隙

最上面的div下面有空隙

Atop is a monitoring tool which is mainly developed for command-line usage. It is capable of showing detailed information about the process, memory, disk network information, and metrics. Atop commands provides more details than popular top command.

Atop是主要用于命令行使用而开发的监视工具。 它能够显示有关进程,内存,磁盘网络信息和指标的详细信息。 与常用的top命令相比,top命令提供的详细信息更多。

在命令语法之上 (atop Command Syntax)

We will use following syntax for atop command.

我们将对atop命令使用以下语法。

atop OPTION

在命令帮助上方 (atop Command Help)

Help information like flags, options can be listed with -h option.

可以使用-h选项列出帮助信息(例如标志,选项)。

$ atop -h
atop help
atop help
在帮助之上

从头开始(Start atop)

Atop can be started just issuing atop command. But to get more detailed information and metrics about different subsystem usages providing root privileges are a better way.

只需发出atop命令即可启动Atop。 但是要获得有关不同子系统使用情况的更详细的信息和指标,提供根特权是一种更好的方法。

$ sudo atop
Atop
Atop
在顶上

As we can see from the screenshot the information provided is more than we may want the terminal screen fills up with monitoring information. We will look at how to show specific information about CPU, process, network, disk memory, etc.

从屏幕截图中可以看到,所提供的信息超出了我们希望终端屏幕填满监视信息的范围。 我们将研究如何显示有关CPU,进程,网络,磁盘内存等的特定信息。

显示CPU使用率 (Display CPU Usage)

We can display CPU related information with c shortcut after atop started. This will list processes according to their CPU usage with their PID’s and full command line with parameters and options.

重新启动后,我们可以使用c快捷键显示与CPU相关的信息。 这将根据进程使用其PID的CPU使用情况以及带有参数和选项的完整命令行列出进程。

$ atop -c
Display CPU Usage
Display CPU Usage
显示CPU使用率

显示内存使用率(Display Memory Usage)

We can show memory usage with m shortcut. This will list information like PIC, minimum and maximum fault numbers, vstext, vsize,rsize,vgrow, rgrow, running user ID, effective user ID , memory usage, and command.

我们可以使用m快捷方式显示内存使用情况。 这将列出信息,如PIC,最小和最大故障号,vstext,vsize,rsize,vgrow,rgrow,运行用户ID,有效用户ID,内存使用情况和命令。

Display Memory Usage
Display Memory Usage
显示内存使用率

显示磁盘利用率(Display Disk Utilization)

Another usage type of disk utilization. We will use –d option for this.

磁盘利用率的另一种使用类型。 我们将使用– d选项。

$ atop -d
Display Disk Utilization
Display Disk Utilization
显示磁盘利用率

We can see that disk utilization of the each process is show separately. Each process disk metrics like

我们可以看到每个进程的磁盘利用率是分开显示的。 每个进程的磁盘指标如

  • RRDSK shows read disk

    RRDSK显示读取的磁盘

  • WRDSK shows write disk

    WRDSK显示写磁盘

  • WCANCL

    WCANCL

  • DSK shows general disk usage

    DSK显示常规磁盘使用情况

  • CMD shows related command

    CMD显示相关命令

LEARN MORE  How To Manage Windows Firewall From Command Line With Netsh Command?
了解更多信息如何使用Netsh命令从命令行管理Windows防火墙?

以累积方式显示过程信息 (Display Process Information In Cumulative Manner)

Process information can be listed with –p option. This will also show other metrics about the disk, network, and memory.

可以使用– p选项列出过程信息。 这还将显示有关磁盘,网络和内存的其他指标。

$ atop -p
Display Process Information
Display Process Information
显示过程信息
  • SYSCPU show system side CPU usage

    SYSCPU显示系统端CPU使用率

  • USRCPU shows user side CPU usage

    USRCPU显示用户端CPU使用率

  • VSIZE shows virtual memory size

    VSIZE显示虚拟内存大小

  • RSIZE shows real memory size

    RSIZE显示实际内存大小

  • RDDSK shows disk read

    RDDSK显示磁盘读取

  • WRDSK shows disk write

    WRDSK显示磁盘写入

  • RNET shows network receive

    RNET显示网络接收

  • SNET shows network send

    SNET显示网络发送

  • CPU shows shortcutCPU usage percentage

    CPU显示快捷方式CPU使用率百分比

  • CMD shows related command

    CMD显示相关命令

根据用户显示累积方式的过程信息(Display Process Information In Cumulative Manner According To User)

Another useful feature of the atop is showing metrics from the user perspective. This shortcut will sum up all metrics according to the user. We will use –u option.

顶部的另一个有用功能是从用户角度显示指标。 此快捷方式将根据用户汇总所有指标。 我们将使用– u选项。

$ atop -u
Display Process Information In Cumulative Manner According To User
Display Process Information In Cumulative Manner According To User
根据用户显示累积方式的过程信息

展示广告网络使用情况快捷方式(Display Network Usage shortcut)

Network usage can be displayed with  -n option. But there is a dependency for netatop to probe the network information.

可以使用-n选项显示网络使用情况。 但是netatop依赖于探测网络信息。

$ atop -n

显示一般信息 (Show Generic Information)

General information about system an process can be listed with -g option like below.

可以使用-g选项列出有关系统进程的一般信息,如下所示。

Show Generic Information
Show Generic Information
显示一般信息

This will list information like

这将列出类似的信息

  • PID

    PID

  • EUID

    EUID

  • USR CPU User level CPU usage

    USR CPU用户级别的CPU使用率

  • CPU CPU usage

    CPU CPU使用率

  • RDDSK Read disk

    RDDSK读盘

  • WRDSK  Write to disk

    WRDSK写入磁盘

显示所有过程(Show All Process)

Up to now only active process are shown. We can list all process without filtering them with -a option.

到目前为止,仅显示活动过程。 我们可以列出所有进程,而无需使用-a选项过滤它们。

$ atop -a
Show All Process
Show All Process
显示所有过程

显示详细信息/详细模式(Display Details / Verbose Mode)

More details about current windows can be shown with verbose mode. The verbose mode can be call -v option or v shortcut after atop starts.

可以使用详细模式显示有关当前窗口的更多详细信息。 详细模式可以在启动开始后调用-v选项或v快捷方式。

$ atop -v
Display Details / Verbose Mode
Display Details / Verbose Mode
显示详细信息/详细模式

As we can see from previous screenshot the following information is provided for each process.

从前面的屏幕截图可以看出,为每个过程提供了以下信息。

  • PID Process ID

    PID进程ID

  • PPID Parent Process ID

    PPID父进程ID

  • RGID

    RGID

  • EUID

    EUID

  • STDATE

    STDATE

  • STTIME

    STTIME

  • ENDATE

    ENDATE

  • ENTIME

    ENTIME

  • ST

    ST

  • EXC

    EXC

  • S

    S

  • CPU

    CPU

  • CMD

    CMD

显示线程 (Show Threads)

We can also show a thread-based list. In this view, the Thread ID and related information will be shown. There will be also the process name at the end of the line.

我们还可以显示基于线程的列表。 在此视图中,将显示线程ID和相关信息。 该行的末尾还将有进程名称。

$ atop -y
Show Threads
Show Threads
显示主题

写入日志文件(Write To Log File)

atop is a very analytical tool where we can save the monitored values into a file to read in the future. We will redirect into a binary format file with the -w option. We will name the log file as atop.raw

atop是一个非常分析的工具,我们可以在其中将监视的值保存到文件中以供将来读取。 我们将使用-w选项重定向到二进制格式的文件。 我们将日志文件命名为atop.raw

$ atop -w /root/atop.raw

从日志文件读取 (Read From Log File)

We can also read from a log file too. This will be beneficial If we need to investigate a past event for a specified time. We will use -r and the log file name which is atop.raw in this case.

我们也可以从日志文件中读取。 如果我们需要调查指定时间的过去事件,这将是有益的。 在这种情况下,我们将使用-r和日志文件名atop.raw

$ atop -r /tmp/atop.raw

设置全局配置 (Set Global Configuration)

If we generally need to use specific options we can specify them in a global configuration file which will effect for each atop run.  We will use /etc/atoprc .

如果我们通常需要使用特定的选项,我们可以在一个全局配置文件,该文件将针对每个效果指定它们atop运行。 我们将使用/etc/atoprc

LEARN MORE  How To Change Cisco IOS Time?
了解更多如何更改Cisco IOS时间?

设置基于用户的配置 (Set User Based Configuration)

We can also set user level configuration which will overload global configuration if defined. This configuration file is located ~/.atoprc

我们还可以设置用户级别的配置,如果定义,它将使全局配置超载。 该配置文件位于~/.atoprc

翻译自: https://www.poftut.com/atop-command-tutorial-examples-monitor-linux-system-meterics/

最上面的div下面有空隙

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值