一、在CentOS上安裝
sudo yum install sysstat
二、在Ubuntu上安裝
apt-get install sysstat
三、源碼安裝(安裝最新版本)
通過該方式可以解決,yum安裝版本過低導致部分命令信息展示不全的問題,比如pidstat沒有展示%wait
1)通過git下載源碼
$ git clone git://github.com/sysstat/sysstat
2)為你的系統配置 sysstat
$ cd sysstat
$ ./configure
注意:該過程需要依賴gcc命令,若沒安裝請自行安裝(比如通過 yum install gcc 安裝)
3)編譯和安裝
$ make
$ sudo make install
4)配置環境變量(目的使相關命令在任何目錄都可以執行)
$ vi /etc/profile 添加: export PATH=/systat安裝目錄/sysstat:$PATH $ source /etc/profile
5)驗證是否安裝成功
[root@VM_0_4_centos ~]# mpstat -V sysstat version 12.3.2 (C) Sebastien Godard (sysstat <at> orange.fr)