{"id":9487,"date":"2015-09-09T17:25:20","date_gmt":"2015-09-09T08:25:20","guid":{"rendered":"http:\/\/www.itblog.jp\/?p=9487"},"modified":"2015-09-09T17:25:20","modified_gmt":"2015-09-09T08:25:20","slug":"liux%e3%81%a7%e3%83%ad%e3%82%b0%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e8%82%a5%e5%a4%a7%e5%8c%96%e3%81%ae%e5%af%be%e7%ad%96","status":"publish","type":"post","link":"https:\/\/www.itblog.jp\/?p=9487","title":{"rendered":"liux\u3067\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u80a5\u5927\u5316\u306e\u5bfe\u7b56"},"content":{"rendered":"<p>\u6700\u8fd1\u3001\u500b\u4eba\u3067\u4f7f\u3063\u3066\u3044\u308bVPS\uff08\u4eee\u60f3\u5c02\u7528\u30b5\u30fc\u30d0\uff09\u304c\u3001\u983b\u7e41\u306b\u30c0\u30a6\u30f3\u3059\u308b\u3068\u3044\u3046\u73fe\u8c61\u304c\u8d77\u304d\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u539f\u56e0\u304c\u30b5\u30fc\u30d0\u306e\u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u304c\u3044\u3063\u3071\u3044\u306b\u306a\u3063\u3066\u3044\u305f\u3053\u3068\u3067\u3057\u305f\u3002<\/p>\n<p>\u3069\u3053\u304c\u30b5\u30fc\u30d0\u306e\u5bb9\u91cf\u3092\u5727\u8feb\u3057\u3066\u3044\u308b\u539f\u56e0\u306b\u306a\u3063\u3066\u3044\u305f\u304b\u3068\u3044\u3046\u3068\u3001PlESK\u306e\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u3067\u3057\u305f\u3002<\/p>\n<p>PLESK\u306e\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u4ee5\u4e0b\u306e\u5834\u6240\u306b\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\/var\/www\/vhosts\/\u30c9\u30e1\u30a4\u30f3\u540d\/statistics\/logs<\/p>\n<p>\u3053\u3053\u306b\u51fa\u529b\u3055\u308c\u308b error_log\u3000\u3068 access_log\u3000\u304c\u3001\u30b5\u30fc\u30d0\u6a19\u6e96\u306e\u8a2d\u5b9a\u3067\u306f\u30ed\u30b0\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a\u304c\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u305f\u3081\u80a5\u5927\u5316\u3057\u7d9a\u3051\u3001\u6c17\u304c\u3064\u3051\u3070\u30b5\u30fc\u30d0\u5bb9\u91cf\u306e\u5927\u534a\u3092\u5727\u8feb\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u5bfe\u7b56\u3068\u3057\u3066\u3001\u4ee5\u4e0b\u306e\uff12\u3064\u3092\u884c\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\uff11\uff0ePLESK\u30ed\u30b0\u306e\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a<\/p>\n<p>PLESK\u306e\u30ed\u30b0\u306e\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u3001PLESK\u30ed\u30b0\u30a4\u30f3\u5f8c\u3001\u4ee5\u4e0b\u304b\u3089\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3068\u30c9\u30e1\u30a4\u30f3 \u2192 \u30ed\u30b0 \u2192 \u8a72\u5f53\u30c9\u30e1\u30a4\u30f3\u306e\u300c\u8868\u793a\u3059\u308b\u300d \u2192 \u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3<\/p>\n<p>\uff12\uff0e\u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u304c\u5c11\u306a\u304f\u306a\u3063\u305f\u6642\u30a2\u30e9\u30fc\u30c8\u8a2d\u5b9a<\/p>\n<p>PLESK\u306e\u30ed\u30b0\u306e\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u3068\u3057\u3066\u3082\u3001\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306f\u4ed6\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u77e5\u3089\u306a\u3044\u3046\u3061\u306b\u751f\u6210\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u3042\u308a\u3001\u6c17\u304c\u3064\u3051\u3070\u540c\u69d8\u306e\u3053\u3068\u304c\u518d\u5ea6\u8d77\u3053\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u30b5\u30fc\u30d0\u306e\u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u304c\u4e00\u5b9a\u4ee5\u4e0b\u3068\u306a\u3063\u305f\u5834\u5408\u3001\u7ba1\u7406\u8005\u3078\u30e1\u30fc\u30eb\u901a\u77e5\u3092\u3059\u308b\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30d6\u30ed\u30b0\u8a18\u4e8b\u304c\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/www.mk-mode.com\/octopress\/2014\/03\/25\/linux-check-capasity-of-disk\/\">>Linux &#8211; \u30c7\u30a3\u30b9\u30af\u4f7f\u7528\u91cf\u76e3\u8996\uff06\u30e1\u30fc\u30eb\u901a\u77e5\uff01 &#8211; mk-mode BLOG<\/a><\/p>\n<p>\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5bb9\u91cf\u3092\u78ba\u8a8d\u3057\u3066\u95be\u5024\u4ee5\u4e0b\u3060\u3063\u305f\u5834\u5408\u7ba1\u7406\u8005\u3078\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3057\u3001cron\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<pre class=\"lang:default decode:true \" >#!\/bin\/bash\r\n\r\n# \u95be\u5024(%)\r\nLIMIT=90\r\n# \u30e1\u30fc\u30eb\u4ef6\u540d\r\nSUBJECT=\"[WARN] The capacity of the disk has decreased! - `hostname`\"\r\n\r\n# df \u30b3\u30de\u30f3\u30c9\u306e\u7d50\u679c\u3092\uff11\u884c\u305a\u3064\u30c1\u30a7\u30c3\u30af\r\nwhile read LINE\r\ndo\r\n    # \u30d1\u30fc\u30bb\u30f3\u30c6\u30fc\u30b8\u53d6\u5f97\r\n    PER=`echo $LINE | sed 's\/^.* \\([0-9]*\\)%.*$\/\\1\/'`\r\n    # \u95be\u5024\u3092\u8d85\u3048\u305f\u3089 df \u30b3\u30de\u30f3\u30c9\u306e\u5185\u5bb9\u3092\u30e1\u30fc\u30eb\u9001\u4fe1\r\n    if [ $PER -gt $LIMIT ]; then\r\n        df -h | mail -s \"$SUBJECT\" root\r\n        break\r\n    fi\r\ndone &lt; &lt;(df | grep '[0-9]\\{1,\\}%')<\/pre>\n<p><a href=\"https:\/\/gist.github.com\/komasaru\/9580138\">https:\/\/gist.github.com\/komasaru\/9580138<\/a>\n<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u3001\u500b\u4eba\u3067\u4f7f\u3063\u3066\u3044\u308bVPS\uff08\u4eee\u60f3\u5c02\u7528\u30b5\u30fc\u30d0\uff09\u304c\u3001\u983b\u7e41\u306b\u30c0\u30a6\u30f3\u3059\u308b\u3068\u3044\u3046\u73fe\u8c61\u304c\u8d77\u304d\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u539f\u56e0\u304c\u30b5\u30fc\u30d0\u306e\u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u304c\u3044\u3063\u3071\u3044\u306b\u306a\u3063\u3066\u3044\u305f\u3053\u3068\u3067\u3057\u305f\u3002 \u3069\u3053\u304c\u30b5\u30fc\u30d0\u306e\u5bb9\u91cf\u3092\u5727\u8feb\u3057\u3066\u3044\u308b\u539f\u56e0\u306b\u306a\u3063\u3066\u3044\u305f\u304b\u3068\u3044\u3046\u3068\u3001 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[114],"tags":[],"class_list":["post-9487","post","type-post","status-publish","format-standard","hentry","category-it"],"_links":{"self":[{"href":"https:\/\/www.itblog.jp\/index.php?rest_route=\/wp\/v2\/posts\/9487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itblog.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itblog.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itblog.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itblog.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9487"}],"version-history":[{"count":0,"href":"https:\/\/www.itblog.jp\/index.php?rest_route=\/wp\/v2\/posts\/9487\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.itblog.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itblog.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itblog.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}