Linux

SAR in Ubuntu

뭉기 2012. 6. 22. 13:30


출처 : http://jmanbal.tistory.com/124

Ubuntu에서 기본적으로 SAR를 제공하지 않는다.

그래서 설정하는 방법을 정리 해보았다.
먼저 설치를 해야 하는데.
$sudo apt-get install sysstat
이렇게 하면 한참 시간이 걸리면서 설치가 완료가 된다.

이제 설정 부분이다.
변경을 해야하는 파일은 
/etc/init.d/sysstat /etc/cron.d/sysstat /etc/cron.daily/sysstat /etc/default/sysstat 이다.
ENABLE="false" --> ENABLE="true"
라고 모두 변경한다.

$sudo /etc/init.d/sysstat start
이러면 서비스가 가동된다.


#sar -A -P ALL | more
Linux 2.6.27.24-170.2.68.fc10.x86_64 (blue)     08/13/09
00:00:01 CPU %user %nice %system %iowait %steal %idle
00:10:01 all 0.05 0.00 0.12 0.00 0.00 99.84
00:10:01 0 0.02 0.00 0.13 0.00 0.00 99.84
00:10:01 1 0.07 0.00 0.09 0.00 0.00 99.84
00:20:01 all 0.04 0.00 0.06 0.00 0.00 99.90
00:20:01 0 0.02 0.00 0.08 0.01 0.00 99.90
00:20:01 1 0.06 0.00 0.05 0.00 0.00 99.89

sar이라면... 코어별로 확인할 수 있습니다.


원래 sysstat 가 10 분단위로 기록되므로 설치후 최소 10 분 있어야
통계값이 생성됩니다..

sar 옵션 관련 http://ttongfly.net/zbxe/?document_srl=43497&mid=linux&sort_index=readed_count&order_type=desc