{"id":253,"date":"2016-09-22T01:47:04","date_gmt":"2016-09-21T16:47:04","guid":{"rendered":"https:\/\/blog.daichang.me\/?p=253"},"modified":"2016-09-22T01:47:04","modified_gmt":"2016-09-21T16:47:04","slug":"sysstat-%e3%81%ab%e3%82%88%e3%82%8b%e3%83%aa%e3%82%bd%e3%83%bc%e3%82%b9%e7%a2%ba%e8%aa%8d","status":"publish","type":"post","link":"https:\/\/blog.daichang.me\/?p=253","title":{"rendered":"sysstat \u306b\u3088\u308b\u30ea\u30bd\u30fc\u30b9\u78ba\u8a8d"},"content":{"rendered":"<p>Linux \u7cfb\u30b7\u30b9\u30c6\u30e0\u306b\u304a\u3044\u3066CPU, RAM, Disk I\/O \u3068\u3044\u3063\u305f\u30b7\u30b9\u30c6\u30e0\u306e\u30ea\u30bd\u30fc\u30b9\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3001\u8ca0\u8377\u72b6\u6cc1\u3092\u78ba\u8a8d\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3068\u3057\u3066 sysstat \u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3001\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306b\u3088\u3063\u3066\u9055\u3044\u304c\u3042\u308b\u305f\u3081\u3001Ubuntu (Debian-like) \u3067\u306e\u4f7f\u3044\u65b9\u3092\u30e1\u30e2\u3057\u3066\u304a\u304d\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<p>sysstat \u3067\u3059\u304c\u3001RedHat \u7cfb Linux \u3067\u306f sysstat \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3060\u3051\u3067\u3001\u7279\u306b\u8a2d\u5b9a\u4e0d\u8981\u3067\u30b7\u30b9\u30c6\u30e0\u306e\u30ea\u30bd\u30fc\u30b9\u60c5\u5831\u3092\u5b9a\u671f\u7684\u306b\u53d6\u5f97\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3057\u304b\u3057\u3001Debian \u7cfb Linux \u3067\u306f\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3060\u3051\u3067\u306f\u5b9a\u671f\u7684\u306a\u30ea\u30bd\u30fc\u30b9\u60c5\u5831\u306e\u53d6\u5f97\u307e\u3067\u306f\u884c\u3063\u3066\u304f\u308c\u307e\u305b\u3093\u3002\u305d\u3053\u3067\u3001Ubuntu 16.04 (xenial) \u3067\u306e\u521d\u671f\u8a2d\u5b9a\u5185\u5bb9\u3092\u8a18\u8f09\u3057\u3066\u304a\u304d\u307e\u3059\uff08\u3068\u8a00\u3063\u3066\u3082\u7c21\u5358\u306a\u3082\u306e\u3067\u3059\u304c\uff09\u3002<\/p>\n<blockquote><p>\u307e\u305a\u306f sysstat \u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p><\/blockquote>\n<pre class=\"prettyprint linenums\">\n% sudo apt install -y sysstat\n<\/pre>\n<blockquote><p>\u6b21\u306b\u30ea\u30bd\u30fc\u30b9\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u8a2d\u5b9a\u3078\u5909\u66f4<\/p><\/blockquote>\n<p>10\u884c\u76ee\u306e <code>\"false\"<\/code> \u3092 <code>\"true\"<\/code> \u3078\u7f6e\u63db<\/p>\n<pre class=\"prettyprint linenums\">\n% sudo vim &#47;etc&#47;default&#47;sysstat\n#\n# Default settings for &#47;etc&#47;init.d&#47;sysstat, &#47;etc&#47;cron.d&#47;sysstat\n# and &#47;etc&#47;cron.daily&#47;sysstat files\n#\n\n# Should sadc collect system activity informations? Valid values\n# are &#34;true&#34; and &#34;false&#34;. Please do not put other values, they\n# will be overwritten by debconf!\n#ENABLED=&#34;false&#34;\n<\/pre>\n<blockquote><p>\u6700\u5f8c\u306b\u30ea\u30bd\u30fc\u30b9\u60c5\u5831\u53d6\u5f97\u8a2d\u5b9a\u306e\u6709\u52b9\u5316<\/p><\/blockquote>\n<pre class=\"prettyprint linenums\">\n% sudo service sysstat start\n<\/pre>\n<p>\u3053\u306e\u72b6\u614b\u3067 <code>sar<\/code> \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3053\u306e\u3068\u304a\u308a\uff01<\/p>\n<pre class=\"prettyprint linenums\">\n% sar\nLinux 4.4.0-21-generic (test) \t2016\u5e7409\u670822\u65e5 \t_x86_64_\t(4 CPU)\n\n01\u664208\u520630\u79d2  LINUX RESTART\t(4 CPU)\n<\/pre>\n<p>\u3042\u308c\u3042\u308c\u3001\u6709\u76ca\u306a\u60c5\u5831\u304c\u4f55\u3082\u7121\u3044\u3067\u3059\u306d\u3002\u3002\u3002<br \/>\n\u305d\u308c\u3082\u305d\u306e\u306f\u305a\u3001Ubuntu \u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f10\u5206\u9593\u9694\u304a\u3088\u3073\u300123:59\u3067\u306e\u53d6\u5f97\u3068\u306a\u3063\u3066\u3044\u308b\u304b\u3089\u3067\u3059\u3002\u3002\u3002<br \/>\n\u306a\u306e\u3067\u300110\u5206\u5f85\u3066\u3070\u3053\u3093\u306a\u611f\u3058&#8230;<\/p>\n<pre class=\"prettyprint linenums\">\n% sar\nLinux 4.4.0-21-generic (test) \t2016\u5e7409\u670822\u65e5 \t_x86_64_\t(4 CPU)\n\n01\u664208\u520630\u79d2  LINUX RESTART\t(4 CPU)\n\n01\u664215\u520601\u79d2     CPU     %user     %nice   %system   %iowait    %steal     %idle\n01\u664225\u520601\u79d2     all      0.04      0.00      0.08      0.03      0.01     99.85\n\u5e73\u5747\u5024:      all      0.04      0.00      0.08      0.03      0.01     99.85\n<\/pre>\n<p>\u307e\u3041\u3001\u306a\u3093\u3068\u3044\u3046\u304b\u3001\u5b9f\u7528\u306b\u306f\u8010\u3048\u306a\u3044\u30c7\u30b9\u3088\u306d\u3002\u3002\u3002<br \/>\n\u306a\u306e\u3067\u3001\u53d6\u5f97\u30bf\u30a4\u30df\u30f3\u30b0\u3092\u5404\u74b0\u5883\u306b\u5fdc\u3058\u3066\u4fee\u6b63\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u4fee\u6b63\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u5834\u6240\u306f <code>\/etc\/cron.d\/sysstat<\/code> \u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint linenums\">\n% sudo vim &#47;etc&#47;cron.d&#47;sysstat\n# The first element of the path is a directory where the debian-sa1\n# script is located\nPATH=&#47;usr&#47;lib&#47;sysstat:&#47;usr&#47;sbin:&#47;usr&#47;sbin:&#47;usr&#47;bin:&#47;sbin:&#47;bin\n\n# Activity reports every 10 minutes everyday\n5-55&#47;10 * * * * root command -v debian-sa1 &gt; &#47;dev&#47;null && debian-sa1 1 1\n\n# Additional run at 23:59 to rotate the statistics file\n59 23 * * * root command -v debian-sa1 &gt; &#47;dev&#47;null && debian-sa1 60 2\n<\/pre>\n<p>\u4e0a\u8a18\u306e\u30d5\u30a1\u30a4\u30eb\u3060\u3068\u30018\u884c\u76ee\u306e cron \u8a2d\u5b9a\u3092\u5fc5\u8981\u306a\u9593\u9694\u306b\u66f8\u304d\u63db\u3048\u308b\u3068\u6b32\u3057\u3044\u9593\u9694\u3067\u306e\u60c5\u5831\u304c\u624b\u306b\u5165\u308a\u307e\u3059\uff01<br \/>\n\u4f8b\u3048\u3070\u30011\u5206\u9593\u9694\u3067\u6b32\u3057\u3044\u3068\u3059\u308b\u3068\u3053\u3093\u306a\u611f\u3058\u306b\u3059\u308c\u3070\u3001<\/p>\n<pre class=\"prettyprint linenums\">\n0-59&#47;1 * * * * root command -v debian-sa1 &gt; &#47;dev&#47;null && debian-sa1 1 1\n<\/pre>\n<p>\u3068\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\uff01<\/p>\n<pre class=\"prettyprint linenums\">\n% sar\nLinux 4.4.0-21-generic (test) \t2016\u5e7409\u670822\u65e5 \t_x86_64_\t(4 CPU)\n\n01\u664208\u520630\u79d2  LINUX RESTART\t(4 CPU)\n\n01\u664215\u520601\u79d2     CPU     %user     %nice   %system   %iowait    %steal     %idle\n01\u664225\u520601\u79d2     all      0.04      0.00      0.08      0.03      0.01     99.85\n01\u664235\u520601\u79d2     all      0.03      0.00      0.08      0.03      0.01     99.85\n\u5e73\u5747\u5024:      all      0.04      0.00      0.08      0.03      0.01     99.85\n\n01\u664241\u520617\u79d2  LINUX RESTART\t(4 CPU)\n\n01\u664242\u520601\u79d2     CPU     %user     %nice   %system   %iowait    %steal     %idle\n01\u664243\u520601\u79d2     all      1.69      0.00      0.59      4.19      0.03     93.49\n01\u664244\u520601\u79d2     all      2.43      0.00      2.03     10.68      0.05     84.80\n01\u664245\u520601\u79d2     all      0.60      0.00      1.76     25.98      0.03     71.64\n\u5e73\u5747\u5024:      all      1.58      0.00      1.46     13.61      0.04     83.31\n<\/pre>\n<p>\u3081\u3067\u305f\u3057\u3001\u3081\u3067\u305f\u3057\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux \u7cfb\u30b7\u30b9\u30c6\u30e0\u306b\u304a\u3044\u3066CPU, RAM, Disk I\/O \u3068\u3044\u3063\u305f\u30b7\u30b9\u30c6\u30e0\u306e\u30ea\u30bd\u30fc\u30b9\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3001\u8ca0\u8377\u72b6\u6cc1\u3092\u78ba\u8a8d\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3068\u3057\u3066 sysstat \u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u305f\u3060\u3001\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306b\u3088\u3063\u3066\u9055\u3044 [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"https:\/\/blog.daichang.me\/?p=253\">\u7d9a\u304d\u3092\u8aad\u3080&#8230;<span class=\"screen-reader-text\"> from sysstat \u306b\u3088\u308b\u30ea\u30bd\u30fc\u30b9\u78ba\u8a8d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[14,23,25],"class_list":["post-253","post","type-post","status-publish","format-standard","hentry","category-tech","tag-linux","tag-tips","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/blog.daichang.me\/index.php?rest_route=\/wp\/v2\/posts\/253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.daichang.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.daichang.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.daichang.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.daichang.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=253"}],"version-history":[{"count":0,"href":"https:\/\/blog.daichang.me\/index.php?rest_route=\/wp\/v2\/posts\/253\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.daichang.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.daichang.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.daichang.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}