[Reprint] all-around champion: Linux system performance and usage activity monitoring tools sysstat

All-around champion: Linux system performance and usage activity monitoring tools sysstat

https://linux.cn/article-4025-1.html

 

Author:  Kuldeep Sharma  Translator:  LCTT  cvsher 

| 2014-10-16 14:20 Comments:  4  Favorites:  6 Share:  1    

Sysstat is a very handy tool, it comes with a large number of system resource monitoring tool for performance and usage monitoring system. We have a considerable part of the toolkit from the sysstat tools in everyday use. It also provides a method of using cron expression to develop performance and activity data collection plan.

The following table is a tool contained in the package sysstat

  • the iostat : statistical information output from the CPU and all input and output (I / O) I / O device statistics.
  • mpstat: For more information on the CPU (or a separate output packet output).
  • pidstat: statistical information about running processes / tasks, CPU, memory, etc.
  • sar: Save and export different system resources (CPU, memory, IO, network, kernel, and so ...) for more information.
  • sadc: system activity data collector for collecting data sar rear tool.
  • sa1: The system collects and stores data files sadc binary data, tools used in conjunction with sadc
  • sa2: with the sar tool used to generate daily summary reports.
  • sadf: a different data formats (CVS or XML) formatted sar output of the tool.
  • Sysstat: man sysstat tools help page.
  • nfsiostat: NFS (Network File System) of I / O statistics.
  • cifsiostat: CIFS (Common Internet File System) statistics.

Recently (in May June 2014 17), sysstat 11.0.0 (stable version) has been released, but also added some interesting features, as follows:

pidstat command added some new options: The first is the "-R" option, which will print information about policy priorities and task scheduling. Then the "-G" option With this option we can use the name of the search process, and then lists all matching threads.

sar, sadc and sadf command in the data file equally brings some enhancements in functionality. As always with only "saDD" to name data files. Now you can use the -D option "saYYYYMMDD" to rename the data files, the same, the current data file does not have to put "var / log / sa" directory, we can use the "SA_DIR" variable to define a new directory, the application of variable sa1 and sa2 command.

In the Linux system to install sysstat

In the main linux releases, 'sysstat' kit can be installed in the default library. However, the default version in the library generally little old, so we will download the source code package, compile and install the latest version (version 11.0.0).

First, use the following link to download the latest version of sysstat package, or you can use the wget command to download directly in the terminal.

Download sysstat package

Download sysstat package

Then unzip the downloaded package into the directory, compile and install begin

  1. # tar -xvf sysstat-11.0.0.tar.gz
  2. # cd sysstat-11.0.0/

这里,你有两种编译安装的方法:

a)

第一,你可以使用iconfig(这将会给予你很大的灵活性,你可以选择/输入每个参数的自定义值)

  1. # ./iconfig

sysstat command of iconfig

sysstat的iconfig命令

b)

第二,你可以使用标准的configure,在命令行中定义所有选项。你可以运行 ./configure –help 命令来列出该命令所支持的所有限选项。

  1. # ./configure --help

stsstat of cofigure -help

stsstat的cofigure -help

在这里,我们使用标准的./configure命令来编译安装sysstat工具包。

  1. # ./configure
  2. # make
  3. # make install

In the Linux system configuration sysstat

在Linux系统中配置sysstat

在编译完成后,我们将会看到一些类似于上图的输出。现在运行如下命令来查看sysstat的版本。

  1. # mpstat -V
  2.  
  3. sysstat version 11.0.0
  4. (C) Sebastien Godard (sysstat <at> orange.fr)

更新Linux 系统中的sysstat

默认的,sysstat使用“/usr/local”作为其目录前缀。因此,所有的二进制数据/工具都会安装在“/usr/local/bin”目录中。如果你的系统已经安装了sysstat 工具包,则上面提到的二进制数据/工具有可能在“/usr/bin”目录中。

因为“$PATH”变量不包含“/usr/local/bin”路径,你在更新时可能会失败。因此,确保“/usr/local/bin”路径包含在“$PATH”环境变量中,或者在更新前,在编译和卸载旧版本时将-prefix选项指定值为“/usr”。

  1. # yum remove sysstat [On RedHat based System]
  2. # apt-get remove sysstat [On Debian based System]

  1. # ./configure --prefix=/usr
  2. # make
  3. # make install

Now, with 'mpstat' command '-V' option to view the updated version.

  1. # mpstat -V
  2.  
  3. sysstat version 11.0.0
  4. (C) Sebastien Godard (sysstat <at> orange.fr)

Reference: For more information go to  Sysstat Documentation

In my next article, I will show you some practical examples of the use of sysstat command, stay tuned for updates. Do not forget to leave your valuable comments in the comment box below.

 

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/12083380.html