diff --git a/CONTRIBUTORS.svg b/CONTRIBUTORS.svg index 5a076c6fa4..d2530da45e 100644 --- a/CONTRIBUTORS.svg +++ b/CONTRIBUTORS.svg @@ -98,80 +98,80 @@ - - - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + @@ -192,161 +192,163 @@ - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + \ No newline at end of file diff --git a/c/7z.html b/c/7z.html index 4619d4ff37..911c738e4c 100644 --- a/c/7z.html +++ b/c/7z.html @@ -9,7 +9,7 @@ 7z 命令,Linux 7z 命令详解:拥有极高压缩比的开源压缩软件。 - Linux 命令搜索引擎 - + @@ -411,7 +411,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/ab.html b/c/ab.html index a166c7e6a6..e0ce11f3e5 100644 --- a/c/ab.html +++ b/c/ab.html @@ -9,7 +9,7 @@ ab 命令,Linux ab 命令详解:Apache服务器的性能测试工具 - Linux 命令搜索引擎 - + @@ -428,7 +428,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/accept.html b/c/accept.html index 7c3d759d74..670faad507 100644 --- a/c/accept.html +++ b/c/accept.html @@ -9,7 +9,7 @@ accept 命令,Linux accept 命令详解:指示打印系统接受发往指定目标打印机的打印任务 - Linux 命令搜索引擎 - + @@ -221,7 +221,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/ack.html b/c/ack.html index dea477b972..489b313b43 100644 --- a/c/ack.html +++ b/c/ack.html @@ -9,7 +9,7 @@ ack 命令,Linux ack 命令详解:比grep好用的文本搜索工具 - Linux 命令搜索引擎 - + @@ -295,7 +295,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/ag.html b/c/ag.html index 86e66210ca..809e26c158 100644 --- a/c/ag.html +++ b/c/ag.html @@ -9,7 +9,7 @@ ag 命令,Linux ag 命令详解:ack 的升级版,C语言编写,更快更人性化 - Linux 命令搜索引擎 - + @@ -360,7 +360,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/alias.html b/c/alias.html index 94767b5ea2..fe512c39d8 100644 --- a/c/alias.html +++ b/c/alias.html @@ -9,7 +9,7 @@ alias 命令,Linux alias 命令详解:定义或显示别名。 - Linux 命令搜索引擎 - + @@ -328,7 +328,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/apachectl.html b/c/apachectl.html index a5601a944f..bd1ad58f80 100644 --- a/c/apachectl.html +++ b/c/apachectl.html @@ -9,7 +9,7 @@ apachectl 命令,Linux apachectl 命令详解:Apache服务器前端控制工具 - Linux 命令搜索引擎 - + @@ -222,7 +222,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/apk.html b/c/apk.html index f80ce44d73..9dc3a2fe9b 100644 --- a/c/apk.html +++ b/c/apk.html @@ -9,7 +9,7 @@ apk 命令,Linux apk 命令详解:Alpine Linux 下的包管理工具 - Linux 命令搜索引擎 - + @@ -410,7 +410,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/apropos.html b/c/apropos.html index 179cc370eb..3607532f3b 100644 --- a/c/apropos.html +++ b/c/apropos.html @@ -9,7 +9,7 @@ apropos 命令,Linux apropos 命令详解:在 whatis 数据库中查找字符串 - Linux 命令搜索引擎 - + @@ -292,7 +292,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/apt-get.html b/c/apt-get.html index 053f6f2516..f458b1d080 100644 --- a/c/apt-get.html +++ b/c/apt-get.html @@ -9,7 +9,7 @@ apt-get 命令,Linux apt-get 命令详解:Debian Linux发行版中的APT软件包管理工具 - Linux 命令搜索引擎 - + @@ -282,7 +282,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/apt-key.html b/c/apt-key.html index 0c8fb2cd44..fc431d708d 100644 --- a/c/apt-key.html +++ b/c/apt-key.html @@ -9,7 +9,7 @@ apt-key 命令,Linux apt-key 命令详解:管理Debian Linux系统中的软件包密钥 - Linux 命令搜索引擎 - + @@ -223,7 +223,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/apt-sortpkgs.html b/c/apt-sortpkgs.html index fb170bbfc8..b32ba22df2 100644 --- a/c/apt-sortpkgs.html +++ b/c/apt-sortpkgs.html @@ -9,7 +9,7 @@ apt-sortpkgs 命令,Linux apt-sortpkgs 命令详解:Debian Linux下对软件包索引文件进行排序的工具 - Linux 命令搜索引擎 - + @@ -219,7 +219,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/aptitude.html b/c/aptitude.html index f460dae253..052dff7e5f 100644 --- a/c/aptitude.html +++ b/c/aptitude.html @@ -9,7 +9,7 @@ aptitude 命令,Linux aptitude 命令详解:Debian Linux系统中软件包管理工具 - Linux 命令搜索引擎 - + @@ -251,7 +251,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/ar.html b/c/ar.html index 76946929d7..c52c2bfe53 100644 --- a/c/ar.html +++ b/c/ar.html @@ -9,7 +9,7 @@ ar 命令,Linux ar 命令详解:建立或修改备存文件,或是从备存文件中抽取文件 - Linux 命令搜索引擎 - + @@ -345,7 +345,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/arch.html b/c/arch.html index 8bea5e2db0..534110bbe8 100644 --- a/c/arch.html +++ b/c/arch.html @@ -9,7 +9,7 @@ arch 命令,Linux arch 命令详解:显示当前主机的硬件架构类型 - Linux 命令搜索引擎 - + @@ -234,7 +234,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/arj.html b/c/arj.html index 18e2aa8286..d3584db5d1 100644 --- a/c/arj.html +++ b/c/arj.html @@ -9,7 +9,7 @@ arj 命令,Linux arj 命令详解:用于创建和管理.arj压缩包 - Linux 命令搜索引擎 - + @@ -216,7 +216,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/arp.html b/c/arp.html index 421dc8cd26..81b69531c9 100644 --- a/c/arp.html +++ b/c/arp.html @@ -9,7 +9,7 @@ arp 命令,Linux arp 命令详解:arp 命令用于显示和修改 IP 到 MAC 转换表 - Linux 命令搜索引擎 - + @@ -264,7 +264,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/arpd.html b/c/arpd.html index 75e2e978ce..c915652177 100644 --- a/c/arpd.html +++ b/c/arpd.html @@ -9,7 +9,7 @@ arpd 命令,Linux arpd 命令详解:收集免费ARP信息 - Linux 命令搜索引擎 - + @@ -236,7 +236,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/arping.html b/c/arping.html index fc76cea851..ae4741b604 100644 --- a/c/arping.html +++ b/c/arping.html @@ -9,7 +9,7 @@ arping 命令,Linux arping 命令详解:通过发送ARP协议报文测试网络 - Linux 命令搜索引擎 - + @@ -255,7 +255,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/arptables.html b/c/arptables.html index 3175c102fa..474e03cad8 100644 --- a/c/arptables.html +++ b/c/arptables.html @@ -9,7 +9,7 @@ arptables 命令,Linux arptables 命令详解:管理ARP包过滤规则表 - Linux 命令搜索引擎 - + @@ -239,7 +239,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/arpwatch.html b/c/arpwatch.html index b71f1b43cb..ae3c4135f6 100644 --- a/c/arpwatch.html +++ b/c/arpwatch.html @@ -9,7 +9,7 @@ arpwatch 命令,Linux arpwatch 命令详解:监听网络上ARP的记录 - Linux 命令搜索引擎 - + @@ -221,7 +221,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/as.html b/c/as.html index efe80a315d..b9e2c78e16 100644 --- a/c/as.html +++ b/c/as.html @@ -9,7 +9,7 @@ as 命令,Linux as 命令详解:汇编语言编译器 - Linux 命令搜索引擎 - + @@ -270,7 +270,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/at.html b/c/at.html index f7e0bc4a52..404c9fb879 100644 --- a/c/at.html +++ b/c/at.html @@ -9,7 +9,7 @@ at 命令,Linux at 命令详解:在指定时间执行一个任务 - Linux 命令搜索引擎 - + @@ -305,7 +305,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/atop.html b/c/atop.html index fad8e6850c..79693b35de 100644 --- a/c/atop.html +++ b/c/atop.html @@ -9,7 +9,7 @@ atop 命令,Linux atop 命令详解:监控Linux系统资源与进程的工具 - Linux 命令搜索引擎 - + @@ -134,21 +134,24 @@ customElements.define('markdown-style', MarkdownStyle);atop

监控Linux系统资源与进程的工具

补充说明

-

[非内部程序,需要安装]它以一定的频率记录系统的运行状态,所采集的数据包含系统资源(CPU、内存、磁盘和网络)使用情况和进程运行情况,并能以日志文件的方式保存在磁盘中,服务器出现问题后,我们可获取相应的atop日志文件进行分析。atop是一款开源软件,我们可以从这里获得其源码rpm安装包

+

atop命令 是一款开源的系统监控工具,它以一定的频率记录系统的运行状态,采集的数据包含系统资源(CPU、内存、磁盘和网络)使用情况和进程运行情况,并能以日志文件的方式保存在磁盘中。服务器出现问题后,我们可获取相应的atop日志文件进行分析。atop是一款开源软件,我们可以从这里获得其源码rpm安装包

语法

-
atop(选项)(参数)
-
atop [选项] [参数] +

说明

-

ATOP列:该列显示了主机名、信息采样日期和时间点

-

PRC列:该列显示进程整体运行情况

+

ATOP列

+

该列显示了主机名、信息采样日期和时间点。

+

PRC列

+

该列显示进程整体运行情况:

-

CPU列:该列显示CPU整体(即多核CPU作为一个整体CPU资源)的使用情况,我们知道CPU可被用于执行进程、处理中断,也可处于空闲状态(空闲状态分两种,一种是活动进程等待磁盘IO导致CPU空闲,另一种是完全空闲)

+

CPU列

+

该列显示CPU整体(即多核CPU作为一个整体CPU资源)的使用情况:

CPU列各个字段指示值相加结果为N00%,其中N为cpu核数。

-

cpu列:该列显示某一核cpu的使用情况,各字段含义可参照CPU列,各字段值相加结果为100%

-

CPL列:该列显示CPU负载情况

+

cpu列

+

该列显示某一核cpu的使用情况,各字段含义可参照CPU列,各字段值相加结果为100%。

+

CPL列

+

该列显示CPU负载情况:

-

MEM列:该列指示内存的使用情况

+

MEM列

+

该列指示内存的使用情况:

-

SWP列:该列指示交换空间的使用情况

+

SWP列

+

该列指示交换空间的使用情况:

-

PAG列:该列指示虚拟内存分页情况

-

swin、swout字段:换入和换出内存页数

-

DSK列:该列指示磁盘使用情况,每一个磁盘设备对应一列,如果有sdb设备,那么增多一列DSK信息

+

PAG列

+

该列指示虚拟内存分页情况:

+ +

DSK列

+

该列指示磁盘使用情况,每一个磁盘设备对应一列,如果有sdb设备,那么增多一列DSK信息:

-

NET列:多列NET展示了网络状况,包括传输层(TCP和UDP)、IP层以及各活动的网口信息

+

NET列

+

多列NET展示了网络状况,包括传输层(TCP和UDP)、IP层以及各活动的网口信息:

atop日志

-

每个时间点采样页面组合起来就形成了一个atop日志文件,我们可以使用"atop -r XXX"命令对日志文件进行查看。那以什么形式保存atop日志文件呢?

-

对于atop日志文件的保存方式,我们可以这样:

+

每个时间点采样页面组合起来就形成了一个atop日志文件,我们可以使用atop -r XXX命令对日志文件进行查看。日志文件的保存方式如下:

-

其实atop开发者已经提供了以上日志保存方式,相应的atop.daily脚本可以在源码目录下找到。在atop.daily脚本中,我们可以通过修改INTERVAL变量改变atop信息采样周期(默认为10分钟);通过修改以下命令中的数值改变日志保存天数(默认为28天):

+

atop开发者提供了以上日志保存方式,相应的atop.daily脚本可以在源码目录下找到。在atop.daily脚本中,我们可以通过修改INTERVAL变量改变atop信息采样周期(默认为10分钟);通过修改以下命令中的数值改变日志保存天数(默认为28天):

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

最后,我们修改cron文件,每天凌晨执行atop.daily脚本:

+

最后,我们修改cron文件,每天凌晨执行atop.daily脚本:

0 0 * * * root /etc/cron.daily/atop.daily
 
@@ -281,7 +292,7 @@ function copied(target, str) { 607 个Linux命令,超过 50+ 贡献者 - - + + \ No newline at end of file diff --git a/c/atq.html b/c/atq.html index a8b54a8fb1..b97e3b23dd 100644 --- a/c/atq.html +++ b/c/atq.html @@ -9,7 +9,7 @@ atq 命令,Linux atq 命令详解:列出当前用户的at任务列表 - Linux 命令搜索引擎 - + @@ -145,22 +145,45 @@ customElements.define('markdown-style', MarkdownStyle);
-

实例

-
at now + 10 minutes
+

示例

+

创建一个在10分钟后执行的任务,并列出当前用户的任务列表:

+
[root@localhost ~]# at now + 10 minutes
 at> echo 1111
-at> <eot>
+at> <EOT>
 job 3 at Fri Apr 26 12:56:00 2013
-
-atq
-3       Fri Apr 26 12:56:00 2013 a root
-
+

使用atq命令查看当前用户的任务列表:

+
[root@localhost ~]# atq
+3       Fri Apr 26 12:56:00 2013 a root
+
+

查询指定队列的任务:

+
[root@localhost ~]# at -q a now + 10 minutes
+at> echo "Task in queue a"
+at> <EOT>
+job 4 at Fri Apr 26 13:06:00 2013
+
+

使用atq命令查看队列a中的任务:

+
[root@localhost ~]# atq -q a
+4       Fri Apr 26 13:06:00 2013 a root
+
+

显示atq命令的版本号:

+
[root@localhost ~]# atq -V
+atq (GNU at) 3.1.20
+