Linux性能監控工具sysstat系列:介紹與安裝

簡介
sysstat提供了Linux性能監控的工具集,包括sar、sadf、mpstat、iostat、pidstat等,這些工具能夠監控系統性能和使用狀況。各工具的做用以下:
iostat - 提供CPU統計,存儲I/O統計(磁盤設備,分區及網絡文件系統)
mpstat - 提供單個或組合CPU相關統計
pidstat - 提供Linux進程級別統計:I/O、CPU、內存等
sar - 收集、報告、保存系統活動信息:CPU、內存、磁盤、中斷、網絡接口、TTY、內核表等
sadc - 系統活動數據收集器,做爲sar後端使用
sa1 - 收集系統活動平常數據,並二進制格式存儲,它做爲sadc的工具的前端,能夠經過cron來調用
sa2 - 生成系統每日活動報告,一樣可做爲sadc的工具的前端,能夠經過cron來調用
sadf - 能夠以CSV、XML格式等顯示sar收集的性能數據,這樣很是方便的將系統數據導入到數據庫中,或導入到Excel中來生成圖表
nfsiostat-sysstat: 提供NFS I/O統計
cifsiostat: 提供CIFS統計
sysstat功能強大,功能也在不斷的加強,每一個版本提供了不一樣的功能,用戶能夠到sysstat官網瞭解工具最早發展狀況和得到相應的幫助手冊。官網地址:http://sebastien.godard.pagesperso-orange.fr/
安裝html

  1. 網絡安裝
    對於大多數Linux系統,都有sysstat安裝包,能夠經過網絡來進行安裝:
    以CentOS系統爲例,能夠經過yum來進行安裝:
    [plain] view plain copy
    [root@centos ~]# yum install sysstat
    以Ubuntu系統爲例, 能夠經過apt-get來進行安裝:
    [plain] view plain copy
    [root@localhost ~]# apt-get install sysstat
  2. 源碼安裝
    能夠在官網:http://sebastien.godard.pagesperso-orange.fr/download.html或GITHUB:https://github.com/sysstat/sysstat下載sysstat的源碼
    按照下面的步驟來進行源碼安裝(以Ubuntu系統爲例):
    [plain] view plain copy
    root@ubuntu:~# apt-get install xz-utils
    root@ubuntu:~# xz -d sysstat-11.0.5.tar.xz
    root@ubuntu:~# tar -xvf sysstat-11.0.5.tar
    root@ubuntu:~# cd sysstat-11.0.5
    root@ubuntu:~/sysstat-11.0.5# ./configure --disable-nls
    root@ubuntu:~/sysstat-11.0.5# make
    root@ubuntu:~/sysstat-11.0.5# make install
    註釋1:從官網中下載的源碼包爲.tar.xz壓縮文件,須要安裝xz-utils工具包,先經過xz -d解壓爲tar文件,而後再經過tar命令解壓
    註釋2:編譯過程當中若是遇到問題,能夠查看源碼根目錄下的FAQ文件獲取幫助信息
    註釋3:若是須要多語言支持,須要安裝GNU gettext包,不然可能遇到」make: [locales] Error 127「錯誤,本例子中經過」--disable-nls"配置項禁用了該選項。能夠參考FAQ中的信息來解決相應問題:
    [plain] view plain copy
    1.1. When I compile sysstat, it fails with the following message:
    make: msgfmt: Command not found
    make:
    [locales] Error 127

The msgfmt command belongs to the GNU gettext package.
If you don't have it on your system, just configure sysstat with
NLS disabled like this: 前端

$ ./configure --disable-nls ios

or answer 'y' (for "yes") to the question
"Disable National Language Support (NLS)? (y/n) [--disable-nls]"
if you use the Interactive Configuration script (iconfig),
then compile sysstat as usual (make ; make install).
Please read the README-nls file included in sysstat source package to learn
some more about National Language Support. git

相關文章
相關標籤/搜索