Skip to content


sysstat 安装

This package provides the sar and iostat commands for Linux. Sar and iostat enable system monitoring of disk, network, and other IO activity

http://rpmfind.net/ 下打systat 或 http://pagesperso-orange.fr/sebastien.godard/download.html

含src的rpm安装方式

1.执行rpm -i sysstat-5.0.5-1.src.rpm

  1. cd /usr/src/redhat/SPECS
  2. rpmbuild -bp sysstat-5.0.5-1.specs 一个和你的软件包同名的specs文件
  3. cd /usr/src/redhat/BUILD/sysstat-5.0.5-1/ 一个和你的软件包同名的目录
  4. ./configure 这一步和编译普通的源码软件一样,可以加上参数
  5. make
  6. make install

wget http://perso.orange.fr/sebastien.godard/sysstat-8.0.4.1.tar.gz

tar zxvf sysstat-8.0.4.1.tar.gz

cd sysstat-8.0.4.1

./configure

make

make install

    这个包一但安装下去,一般包括如下的几个命令可以使用。

    sar     iostat     sa1     sa2     sadf     mpstat     sadc     sysstat

crontab -e

/10 /usr/lib/sa/sa1 1 1 53 23 /usr/lib/sa/sa2 -A

 # /etc/init.d/crond restart

http://www.ixpub.net/thread-749930-1-17.html

让普通用户能够使用sar命令,至少有两种办法: 1、将普通用户加到adm组中; 2、这个例子中,就是这个命令:chmod o+x /usr/lib/sa/sadc

查看软件版本


[root@localhost sysstat-8.1.6]# sar -V
sysstat version 8.1.6

查看系统使用的文件描述符

[root@localhost sysstat-8.1.6]# sar -v 2 3 Linux 2.6.9-5.ELsmp (localhost.localdomain)     10/20/2008      i686  (4 CPU)   03:14:44 PM dentunusd   file-nr  inode-nr    pty-nr 03:14:46 PM     57966       810     66883         2 03:14:48 PM     57966       810     66883         2 03:14:50 PM     57966       810     66883         2 Average:        57966       810     66883         2

  1. 查看CPU使用情况
    sar  2   5 // 每隔2秒,显示5次,CPU使用的情况
     
  2. 查看内存使用情况
    sar  2   5 // 每隔2秒,显示5次,内存使用的情况
     
    1. 查看网络吞吐量
    1. sar  n DEV  2   5 // 每隔2秒,显示5次,网络吞吐量情况
  • Posted in LINUX, 技术.


    No Responses (yet)

    Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



    Some HTML is OK

    or, reply to this post via trackback.