{"id":5504,"date":"2013-12-03T21:38:52","date_gmt":"2013-12-03T12:38:52","guid":{"rendered":"http:\/\/mk.miko.jp\/blog\/?p=5504"},"modified":"2014-10-13T16:43:36","modified_gmt":"2014-10-13T07:43:36","slug":"qnap-ts-121%e3%81%a7smartmontools%e3%82%92%e4%bd%bf%e3%81%86","status":"publish","type":"post","link":"http:\/\/mk.miko.jp\/blog\/archives\/5504","title":{"rendered":"QNAP TS-121\u3067smartmontools\u3092\u4f7f\u3046"},"content":{"rendered":"<p>\u3000\u4e45\u3005\u306b\u6280\u8853\u5bc4\u308a\u306e\u8a18\u4e8b\u3067\u3042\u308b\u306a\u3002<\/p>\n<p>\u3000QNAP TS-121\u306b\u3001\u5916\u4ed8\u3051HDD\u30b1\u30fc\u30b9\uff08WD Red 4TB\u5165\u308a\uff09\u3092eSATA\u3067\u63a5\u7d9a\u3057\u3066\u3001Q-RAID1\u3068\u304b\u3044\u3046\u602a\u3057\u3044\u30d6\u30c4\u3067\u30df\u30e9\u30fc\u30ea\u30f3\u30b0\u3092\u59cb\u3081\u305f\u306e\u3067\u3042\u308b\u304c\u3002<br \/>\n\u3000\u3069\u3046\u3082\u5916\u90e8\u63a5\u7d9a\u30c9\u30e9\u30a4\u30d6\u306b\u5bfe\u3059\u308bSMART\u306e\u76e3\u8996\u65b9\u6cd5\u304c\u898b\u5f53\u305f\u3089\u306a\u3044\u306e\u3060\u3002\u305d\u308c\u56f0\u308b\u3058\u3083\u3093\uff1f<br \/>\n\u3000SMART\u3067\u5bff\u547d\u306e\u4e88\u6e2c\u306a\u3093\u304b\u51fa\u6765\u306a\u3044\u3051\u3069\u3001\u58ca\u308c\u305f\u6642\u306bSMART\u76e3\u8996\u30bd\u30d5\u30c8\u3067\u6c17\u4ed8\u304f\u3068\u3044\u3046\u3053\u3068\u306f\u7d50\u69cb\u3042\u308b\u304b\u3089\u306a\u3042\u3002<\/p>\n<p>\u3000\u3064\u30fc\u304bQ-RAID1\u3068\u304b\u3044\u3046\u5909\u306a\u306e\u3092\u4f7f\u3046\u304f\u3089\u3044\u306a\u3089\u7d20\u76f4\u306b2\u30d9\u30a4\u306eQNAP\u8cb7\u3063\u3066RAID1\u3067\u826f\u304b\u3063\u305f\u3093\u3058\u3083\u306d\u3001\u3063\u3066\u601d\u3046\u4eba\u304c\u305d\u308d\u305d\u308d\u591a\u6570\u304b\u3082\u3057\u3093\u306a\u3044\u3051\u3069\u3001\u300cRAID1\u3067\u4e8c\u53f0\u307e\u3068\u3081\u3066\u6b7b\u306b\u307e\u3057\u305f\u300d\u306e\u8a18\u61b6\u304c\u54c0\u3057\u3059\u304e\u308b\u306e\u3067\u3001\u307e\u3060\u307e\u3060\u6211\u304c\u9053\u3092\u884c\u304f\u306e\u3067\u3042\u308b\u3002\u666e\u901a\u306f2\u30d9\u30a4\u306e\u65b9\u304c\u3044\u3044\u6c17\u3082\u3057\u307e\u3059\u304c\u3002<br \/>\n\u3000\u5143\u3005\u3001Q-RAID1\u306a\u3093\u3066\u4ed5\u69d8\u4e0d\u660e\u306e\u30d6\u30c4\u4f7f\u308f\u3093\u3067\u3001QNAP\u3082\u3046\u4e00\u53f0\u8cb7\u3063\u3066\u30db\u30c3\u30c8\u30b9\u30bf\u30f3\u30d0\u30a4\u3060\u305c\u30fc\u3001\u3068\u304b\u601d\u3063\u3066\u305f\u3093\u3060\u3051\u3069\u3055\u3002\u9ad8\u3044\u306e\u3067\u3002\u3053\u3053\u306f\u904e\u6e21\u7684\u306a\u74b0\u5883\u3063\u3066\u3053\u3068\u3067\u4e00\u3064\u3002\u4f7f\u3063\u3066\u308b\u4eba\u304c\u5c11\u306a\u305d\u3046\u306a\u6a5f\u80fd\u306b\u4f9d\u5b58\u3059\u308b\u306e\u306f\u5371\u967a\u306a\u6c17\u3082\u3059\u308b\u306e\u3060\u304c\u3002<\/p>\n<p>\u3000\u307e\u3042\u3001\u30d9\u30a4\u306e\u6570\u306f\u3069\u3046\u3067\u3082\u3044\u3044\u3084\u3002\u672c\u984c\u306b\u9032\u3082\u3046\u3002<\/p>\n<p>\u3000QNAP\u4f7f\u3063\u3066\u305f\u3089\u3001smartmontools\u3092\u4f7f\u3044\u305f\u3044\u4eba\u3082\u591a\u3044\u3068\u601d\u3046\u3093\u3067\u3059\u3088\u3002CrystalDiskInfo\u307f\u305f\u3044\u306b\u3001\u4ee3\u66ff\u51e6\u7406\u304c\u5165\u3063\u305f\u3089\u5373\u8b66\u544a\u3059\u308b\u30ec\u30d9\u30eb\u306a\u3089\u3044\u3044\u3093\u3060\u3051\u3069\u3001QNAP\u306e\u5831\u544a\u6a5f\u80fd\u304c\u3069\u3093\u306a\u57fa\u6e96\u306a\u306e\u304b\u5206\u304b\u3089\u3093\u3057\u3055\u30fc\u3002SMART\u306e\u6a19\u6e96\u3060\u3068\u3059\u3052\u30fc\u7de9\u3044\u57fa\u6e96\u3060\u3057\u3002<br \/>\n\u3000\u306a\u306e\u3067\u3001ipkg\u7248smartmontools\u3092\u8a66\u3057\u3066\u307f\u305f\u3051\u3069\u3001<\/p>\n<pre class=\"brush:plain\">[~] # ipkg install smartmontools\r\nInstalling smartmontools (5.40-3) to root...\r\nDownloading http:\/\/ipkg.nslu2-linux.org\/feeds\/optware\/cs08q1armel\/cross\/unstable\/smartmontools_5.40-3_arm.ipk\r\nConfiguring smartmontools\r\n\r\n#################################################################\r\n#\r\n#   To automatically start smartd on bootup, edit\r\n#\r\n#     \/opt\/etc\/init.d\/S20smartmontools\r\n#\r\n#   and follow the instructions in this file. smartd can be\r\n#   configured in \/opt\/etc\/smartd.conf\r\n#\r\n#################################################################\r\n\r\nSuccessfully terminated.\r\n[~] # smartctl -i \/dev\/sda3\r\nsmartctl 5.40 2010-10-16 r3189 [arm-none-linux-gnueabi] (local build)\r\nCopyright (C) 2002-10 by Bruce Allen, http:\/\/smartmontools.sourceforge.net\r\n\r\nSegmentation fault\r\n[~] # ipkg remove smartmontools\r\nRemoving package smartmontools from root...\r\nsmartd: no process found\r\nSuccessfully terminated.\r\n[~] #<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u30bb\u30b0\u30d5\u30a9\u3059\u308b\u306e\u3067\u6d88\u3057\u305f\u3002<br \/>\n\u3000\u539f\u56e0\u306f\u3069\u3046\u3084\u3089\u3001smartmontools\u304c5.39\u3067C++\u306e\u65b0\u3057\u3044\u6a5f\u80fd\u3092\u4f7f\u3046\u3088\u3046\u306b\u306a\u3063\u3066\u3001GCC 4.2.3\u304cARM\u3060\u3068\u30c0\u30a4\u30e4\u30e2\u30f3\u30c9\u7d99\u627f\u7d61\u307f\u306e\u6700\u9069\u5316\u3067\u30d0\u30b0\u308b\u3068\u304b\u4f55\u3068\u304b\u3002\u3067\u3082\u30c0\u30a4\u30e4\u30e2\u30f3\u30c9\u7d99\u627f\u306f\u5fc5\u8981\u3060\u304b\u3089\u4f7f\u3063\u3066\u308b\u3089\u3057\u3044\u3002GCC\u3092<code>-fno-toplevel-reorder<\/code>\u3067\u8d70\u3089\u305b\u308c\u3070\u52d5\u304f\u305c\u3001\u3068\u3002\u306a\u308b\u307b\u3069\u3002\u3053\u306eipkg\u7248\u306e\u5b58\u5728\u3059\u308b\u610f\u5473\u304c\u5206\u304b\u3089\u3093\u306a\u3002<br \/>\n\u3000\u3064\u307e\u308a\u3042\u308c\u3060\u306a\u3001QNAP\u3067GCC\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u306a\u3044\u3068\u99c4\u76ee\u304b\u3002\u3081\u3093\u3069\u304f\u305b\u3048\u4e88\u611f\u3002Debian\u5316\u3057\u3061\u3083\u3046\u4eba\u306e\u6c17\u6301\u3061\u304c\u5c11\u3057\u5206\u304b\u308b\u6c17\u3082\u3057\u305f\u3002<\/p>\n<p>\u3000\u8abf\u3079\u3066\u308b\u3046\u3061\u306b\u3001QNAP\u306b\u30c7\u30d5\u30a9\u3067\u5165\u3063\u3066\u308b<code>\/sbin\/nasutil<\/code>\u306bsymlink\u3057\u3066\u308b<code>get_hd_smartinfo<\/code>\u3067SMART\u60c5\u5831\u304c\u53d6\u308c\u308b\u3001\u3068\u5224\u660e\u3002<\/p>\n<pre class=\"brush:plain\">[~] # get_hd_smartinfo\r\nUsage: get_hd_smartinfo [OPTION]...\r\nPrint HardDisk SMART Information.\r\n\r\n        -h, Display this help and exit.\r\n        -d, NUM Set disk number. (NUM &gt; 0)\r\n        -i, Timer Interval.(sec)\r\n        -o, When -i exist,save to output File.(default save to \/tmp\/sd[a-g]_smart_xxxx)\r\n        -m, When -i exist,mask attribute ID number(e.g -m 194,131)\r\n[~] # get_hd_smartinfo -d 1\r\n001 Raw_Read_Error_Rate          0        200 200 051 OK\r\n003 Spin_Up_Time                 6008     219 219 021 OK\r\n004 Start_Stop_Count             7        100 100 000 OK\r\n005 Reallocated_Sector_Ct        0        200 200 140 OK\r\n007 Seek_Error_Rate              0        200 200 000 OK\r\n009 Power_On_Hours               334      100 100 000 OK\r\n010 Spin_Retry_Count             0        100 253 000 OK\r\n011 Calibration_Retry_Count      0        100 253 000 OK\r\n012 Power_Cycle_Count            2        100 100 000 OK\r\n192 Power-Off_Retract_Count      1        200 200 000 OK\r\n193 Load_Cycle_Count             2509     200 200 000 OK\r\n194 Temperature_Celsius          37       115 113 000 OK\r\n196 Reallocated_Event_Count      0        200 200 000 OK\r\n197 Current_Pending_Sector       0        200 200 000 OK\r\n198 Offline_Uncorrectable        0        100 253 000 OK\r\n199 UDMA_CRC_Error_Count         0        200 200 000 OK\r\n200 Multi_Zone_Error_Rate        0        100 253 000 OK\r\n[~] #<\/pre>\n<p>\u306a\u308b\u307b\u3069\u3002193\u306e<code>Load_Cycle_Count<\/code>\u304c\u51c4\u3044\u3051\u3069\u6c17\u306b\u3057\u306a\u3044\u305c\u3002005\u3068196\u3068197\u3068198\u304c0\u306a\u3089\u3044\u3044\u306e\u3088\u3002<\/p>\n<p>\u3000\u3053\u3044\u3064\u306bPython\u3067\u3082\u7d44\u307f\u5408\u308f\u305b\u308c\u3070\u81ea\u52d5\u76e3\u8996\u3082\u697d\u52dd\u304b\u306a\u30fc\u3068\u601d\u3063\u305f\u3051\u3069\u3001eSATA\u3068\u304bUSB\u3068\u304b\u306b\u63a5\u7d9a\u3057\u305f\u30c9\u30e9\u30a4\u30d6\u3092\u6307\u5b9a\u51fa\u6765\u306a\u3044\u6a21\u69d8\u3002\u5916\u90e8\u30c9\u30e9\u30a4\u30d6\u306b\u3082\u5bfe\u5fdc\u3057\u3066\u304f\u308c\u3088\u30fc\u3068\u304b\u3001\u5916\u90e8\u30c9\u30e9\u30a4\u30d6\u306eSMART\u60c5\u5831\u53d6\u308b\u65b9\u6cd5\u3069\u3053\u306b\u3082\u7121\u3044\u3093\u3060\u3051\u3069\u30fc\u3068\u304b\u3001\u30d5\u30a9\u30fc\u30e9\u30e0\u3067\u8981\u671b\u51fa\u3057\u305f\u4eba\u306f\u3044\u305f\u3093\u3060\u3051\u3069\u3001\u4e2d\u306e\u4eba\u306b\u300cNAS\u306b\u4f55\u3092\u6c42\u3081\u3066\u308b\u3093\u3059\u304b\u300d\u307f\u305f\u3044\u306a\u611f\u3058\u3067\u5207\u308a\u6368\u3066\u3089\u308c\u3066\u305f\u3002\u3046\u3080\u3002QNAP\u8cb7\u3063\u305f\u306e\u9593\u9055\u3044\u3060\u3063\u305f\u308d\u3046\u304b\u3001\u3068\u3044\u3046\u6c17\u5206\u306b\u5c11\u3057\u306a\u3063\u305f\u306a\u3002\u5b89\u3044PC\u8cb7\u3063\u305f\u65b9\u304c\u826f\u304b\u3063\u305f\u8aac\u3082\u3002<br \/>\n\u3000\u305d\u306e\u8981\u671b\u306e\u3068\u3053\u308d\u306b\u3001smartmontools\u3067\u3082\u53d6\u308c\u306a\u304b\u3063\u305f\u3001\u307f\u305f\u3044\u306b\u66f8\u3044\u3066\u3042\u308b\u306e\u304c\u4e0d\u5409\u3060\u3051\u3069\u3001\u307e\u3042\u8a66\u3057\u3066\u307f\u3088\u3046\u3002<\/p>\n<p>\u3000\u3048\u30fc\u3068\u3001QNAP\u3067smartmontools\u3092\u52d5\u304b\u305b\u305f\u4eba\u306e\u8a71\u306f\u3001\u3068\u3002Projekt Qnap\uff08\u8ffd\u8a18:\u591a\u5206\u9589\u9396\uff1f\uff09\u3063\u3066\u3068\u3053\u306b\u3042\u308b\u306a\u3002<br \/>\n\u3000\u5272\u3068\u305d\u306e\u307e\u307e\u7d20\u76f4\u306a\u5185\u5bb9\u306b\u898b\u3048\u308b\u306e\u3067\u3001\u5fc5\u8981\u6700\u5c0f\u9650\u3063\u307d\u3044\u3068\u3053\u308d\u3092\u5207\u308a\u51fa\u3057\u3066\u8efd\u304f\u30a2\u30ec\u30f3\u30b8\u3002<\/p>\n<pre class=\"brush:bash\">cd \/tmp\r\nipkg install make\r\nipkg install gcc\r\nipkg install grep\r\nipkg install gawk\r\nipkg install optware-devel\r\nexport PATH=\/opt\/bin:$PATH\r\nwget \u6700\u65b0\u7248URL\r\n# http:\/\/sourceforge.net\/projects\/smartmontools\/files\/ \u306e\u4e2d\u306b\u6700\u65b0\u7248\u304c\u3042\u308b\u7b48\r\ntar zxf smartmontools-\u30d0\u30fc\u30b8\u30e7\u30f3\u756a\u53f7.tar.gz\r\ncd smartmontools-\u30d0\u30fc\u30b8\u30e7\u30f3\u756a\u53f7\r\n.\/configure CXXFLAGS=&#039;-g -O2 -fno-toplevel-reorder -Wall -W&#039;\r\nmake\r\nmake install\r\nupdate-smart-drivedb<\/pre>\n<p>\u3063\u3066\u3068\u3053\u304b\u3002<code>ipkg install<\/code>\u306f\u4e00\u884c\u306b\u307e\u3068\u3081\u3089\u308c\u305d\u3046\u306a\u6c17\u3082\u3059\u308b\u3051\u3069\u3002<br \/>\n\u3000\u306a\u304a\u3001\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u305f\u6642\u70b9\u3067\u306f\u3001smartmontools\u306f6.2\u304c\u6700\u65b0\u7248\u3067\u3042\u308b\u3002<\/p>\n<p>\u3000\u3093\u3067\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b9f\u884c\u3002<br \/>\n\u3000\u3042\u3063\u3055\u308a\u5b8c\u4e86\u3002<\/p>\n<p>\u3000\u3093\u3058\u3083\u30fc\u8d70\u3089\u3059\u304b\u3002<code>df<\/code>\u3057\u305f\u611f\u3058\u3060\u3068\u3001eSATA\u306f<code>\/dev\/sdz<\/code>\u307f\u305f\u3044\u3060\u304b\u3089\u3001<\/p>\n<pre class=\"brush:plain\">[~] # smartctl -d marvell -a \/dev\/sdz<\/pre>\n<p>\u3068\u3002<del><code>-d marvell<\/code>\u306f\u91cd\u8981\u3002<\/del>\uff08\u8ffd\u8a18:QTS\u3068smartmontools\u3092\u4e21\u65b9\u66f4\u65b0\u3057\u305f\u3089\u3001<code>\/dev\/sdz<\/code>\u2192<code>\/dev\/sdza<\/code>\u3001<code>-d marvell<\/code>\u2192<code>-d sat<\/code>\u306b\u305d\u308c\u305e\u308c\u5909\u66f4\u3057\u306a\u3044\u3068\u99c4\u76ee\u306b\u306a\u3063\u305f\uff09<br \/>\n\u3000\u3067\u3001\u884c\u3051\u305f\u3002\u3061\u3083\u3093\u3068\u60c5\u5831\u8868\u793a\u3055\u308c\u3066\u308b\u3058\u3083\u30fc\u3093\u3002\u826f\u304b\u3063\u305f\u826f\u304b\u3063\u305f\u3002<br \/>\n\u3000\u3067\u3082\u3055\u30fc\u3001\u3053\u3093\u304f\u3089\u3044<code>nasutil<\/code>\u3067\u5bfe\u5fdc\u3055\u305b\u3089\u3093\u306a\u3044\u306e\u304b\u306d\u3002\u3044\u3044\u3051\u3069\u3055\u3002<\/p>\n<p>\u3000\u6b21\u306f\u3001\u76e3\u8996\u3055\u305b\u308b\u8a33\u3060\u304c\u3001<code>smartd<\/code>\u3067\u884c\u3051\u308b\u304b\u3069\u3046\u304b\u3002<br \/>\n\u3000\u76e3\u8996\u57fa\u6e96\u306f\u3001CrystalDiskInfo\u3068\u540c\u7b49\u3067\u3044\u3044\u3084\u3002\u76e3\u8996\u5bfe\u8c61\u306f<code>\/dev\/sda<\/code>\u3068<code>\/dev\/sdz<\/code>\u306e\u4e21\u65b9\u306b\u3057\u3088\u3046\u3002\u3068\u306a\u308b\u3068\u3001\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u306e\u304b\u306a\u3002\u3048\u30fc\u3068\u3002<br \/>\n\u3000QNAP\u3067\u4efb\u610f\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u81ea\u52d5\u7684\u306b\u8d77\u52d5\u3055\u305b\u308b\u65b9\u6cd5\u304b\u3089\u8abf\u3079\u3066\u307f\u3088\u3046\u304b\u3002<a href=\"http:\/\/wiki.qnap.com\/wiki\/Running_Your_Own_Application_at_Startup\">QNAPedia Community Wiki\u306e\u8a18\u4e8b<\/a>\u3092\u53c2\u8003\u306b\u3001\u306a\u308b\u3079\u304f\u7d20\u76f4\u306b\u771f\u4f3c\u3059\u308b\u611f\u3058\u3067\u3002<\/p>\n<p>\u3000\u4eca\u306e\u30d5\u30a1\u30fc\u30e0\u3067\u3082\u901a\u7528\u3059\u308b\u3084\u308a\u65b9\u306f\u3001QPKG\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u308b\u30d5\u30ea\u3092\u3059\u308b\u65b9\u6cd5\u3063\u307d\u3044\u3002<br \/>\n\u3000\u30b5\u30f3\u30d7\u30eb\u3092\u771f\u4f3c\u3057\u3066\u3001<code>\/etc\/config\/qpkg.conf<\/code>\u306e\u4e0b\u306e\u65b9\u306b\u3001\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092\u8ffd\u52a0\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"brush:plain\">[autorunSmartmontools]\r\nName = Autorun Smartmontools\r\nVersion = 6.2\r\nAuthor = autorun\r\nDate = 2013-12-03\r\nShell = \/share\/HDA_DATA\/.qpkg\/autorun\/smartd.sh\r\nInstall_Path = \/share\/HDA_DATA\/.qpkg\/autorun\r\nQPKG_File = autorun_smartmontools.qpkg\r\nEnable = TRUE<\/pre>\n<p>\u30d6\u30e9\u30a6\u30b6\u3067App Center\u3092\u958b\u304f\u3068\u3001\u304a\u30fc\u3001\u30de\u30a4\u30a2\u30d7\u30ea\u306b\u767b\u9332\u3055\u308c\u3066\u308b\u3002\u3042\u3068\u306f\u3053\u306e\u5185\u5bb9\u901a\u308a\u306b<code>\/share\/HDA_DATA\/.qpkg\/autorun<\/code>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3066\u3001\u305d\u306e\u4e2d\u306b\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u4e00\u5f0f\u3092\u4f5c\u308c\u3070\u826f\u3055\u305d\u3046\u3060\u306a\u3002<br \/>\n\u3000\u306a\u304a\u3001\u3053\u306e\u30b7\u30b9\u30c6\u30e0\u306fRAM\u30c7\u30a3\u30b9\u30af\u306b\u30de\u30a6\u30f3\u30c8\u3055\u308c\u3066\u308b\u5834\u6240\u304c\u975e\u5e38\u306b\u591a\u3044\u306e\u3067\u3001HDD\u4e0a\u306b\u5b9f\u4f53\u306e\u3042\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u7f6e\u304b\u306a\u3044\u3068\u518d\u8d77\u52d5\u3067\u4f55\u3082\u7121\u304b\u3063\u305f\u3053\u3068\u306b\u306a\u308b\u3002TS-121\u3060\u3068<code>\/share\/HDA_DATA<\/code>\u304c\u826f\u3055\u3052\u3060\u3051\u3069\u3001\u6a5f\u7a2e\u306b\u3088\u3063\u3066\u5834\u6240\u306f\u5909\u308f\u308b\u6a21\u69d8\u3002<br \/>\n\u3000\u3042\u3068\u3001<code>QPKG_File<\/code>\u306e\u6307\u5b9a\u306f\u3001\u3069\u3046\u305b\u5b58\u5728\u3057\u306a\u3044\u306e\u3067\u9069\u5f53\u306a\u540d\u524d\u306b\u3057\u305f\u3002\u5e73\u6c17\u304b\u3069\u3046\u304b\u77e5\u3089\u3093\u3051\u3069\u3002<\/p>\n<p>\u3000\u4e0a\u306e<code>Shell<\/code>\u3063\u3066\u3068\u3053\u306b\u6307\u5b9a\u3057\u305f\u306e\u304c\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u3089\u3057\u3044\u306e\u3067\u3001\u4eca\u5ea6\u306f\u305d\u306e<code>smartd.sh<\/code>\u3092\u66f8\u304f\u3002<\/p>\n<pre class=\"brush:bash\">#!\/bin\/sh\r\n\/usr\/local\/sbin\/smartd -c \/share\/HDA_DATA\/.qpkg\/autorun\/smartd.conf --interval=600 -p \/var\/run\/smartd.pid<\/pre>\n<p>\u3063\u3066\u3068\u3053\u304b\u3002<br \/>\n\u3000\u30a4\u30f3\u30bf\u30fc\u30d0\u30eb\u306f\u3001\u307e\u3042\u3001\u30c7\u30d5\u30a9\u306e30\u5206\u3067\u3044\u3044\u6c17\u3082\u3059\u308b\u3051\u3069\u3001\u4f55\u3068\u306a\u304f10\u5206\u306b\u3002\u5225\u306b\u56fa\u307e\u3063\u305f\u308a\u3082\u3057\u306a\u3044\u3088\u3046\u3060\u3057\u30011\u5206\u304f\u3089\u3044\u3067\u3082\u3044\u3044\u304b\u3082\u306a\u3042\u3002<br \/>\n\u3000<code>smartd.conf<\/code>\u306f\u3001\u30c7\u30d5\u30a9\u306e<code>\/usr\/local\/etc\/smartd.conf<\/code>\u306f\u5909\u66f4\u305b\u305a\u3001\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u3068\u540c\u3058\u5834\u6240\u306b\u4e00\u304b\u3089\u4f5c\u308b\u3053\u3068\u306b\u3002<br \/>\n\u3000PID\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u307e\u3042\u3001\u3042\u3063\u3066\u56f0\u308b\u3053\u3068\u3082\u7121\u3044\u304b\u3089\u6307\u5b9a\u3057\u3066\u304a\u304f\u3002<\/p>\n<p>\u3000\u6b21\u306f\u3001<code>smartd.conf<\/code>\u3002\u98fd\u304d\u3066\u304d\u305f\u304c\u9069\u5f53\u306b\u9811\u5f35\u308d\u3046\u3002<\/p>\n<pre class=\"brush:plain\">DEFAULT -d marvell -n standby,q -a -R 5! -s S\/..\/..\/.\/02 -s L\/..\/01\/.\/08 -m foo@example.com -M exec \/share\/HDA_DATA\/.qpkg\/autorun\/smartd-mailer.sh\r\n\/dev\/sda\r\n\/dev\/sdz<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u304b\u306d\u30fc\u3002<br \/>\n\u3000<code>-n standby,q<\/code>\u306f\u3001\u30b9\u30bf\u30f3\u30d0\u30a4\u30e2\u30fc\u30c9\u3067\u6b62\u307e\u3063\u3066\u308b\u6642\u306bSMART\u8aad\u307f\u3067\u30b9\u30d4\u30f3\u30a2\u30c3\u30d7\u3055\u305b\u306a\u3044\u70ba\u306b\u6307\u5b9a\u3002\u307e\u3042\u3001\u30b9\u30d4\u30f3\u30c0\u30a6\u30f3\u3057\u306a\u3044\u8a2d\u5b9a\u306b\u3057\u3066\u308b\u7b48\u3060\u3051\u3069\u4e00\u5fdc\u3002<br \/>\n\u3000<code>-R 5!<\/code>\u306f\u3001\u4ee3\u66ff\u30bb\u30af\u30bf\u304c\u51fa\u305f\u6642\u306b\u81f4\u547d\u7684\u3068\u5224\u5b9a\u3055\u305b\u305f\u3044\u306e\u3067\u6307\u5b9a\u3002<br \/>\n\u3000\u307e\u3042\u3001\u4f55\u304b\u3084\u305f\u3089\u3068\u8272\u3005\u6307\u5b9a\u51fa\u6765\u308b\u306e\u3067\u4fbf\u5229\u305d\u3046\u3060\u3002\u5f8c\u3067\u4e0d\u90fd\u5408\u306a\u3053\u3068\u304c\u3042\u3063\u305f\u3089\u307e\u305f\u8a2d\u5b9a\u3092\u5f04\u3063\u3066\u307f\u3088\u3046\u3002<\/p>\n<p>\u3000\u3068\u3001\u8aac\u660e\u3092\u7aef\u6298\u3063\u305f\u3051\u308c\u3069\u3082\u3001\u6700\u5f8c\u306e<code>-M<\/code>\u306e\u6307\u5b9a\u306f\u8aac\u660e\u305b\u3093\u3068\u304f\u3093\u3002<br \/>\n\u3000\u3053\u308c\u306f\u3001smartd\u306e\u30a8\u30e9\u30fc\u5831\u544a\u3092\u30e1\u30fc\u30eb\u3067\u3084\u3089\u305b\u305f\u3044\u6642\u306b\u3001\u3069\u3046\u3084\u3063\u3066\u9001\u308b\u304b\u3092\u6307\u5b9a\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u306a\u3093\u3060\u3051\u3069\u3001\u7121\u6307\u5b9a\u3060\u3068<code>mail<\/code>\u7d4c\u7531\u3067\u9001\u308b\u3089\u3057\u3044\u3002QNAP\u306b\u306f\u5b58\u5728\u3057\u307e\u305b\u3093\u3002\u3046\u3080\u3002<br \/>\n\u3000QNAP\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089\u30e1\u30fc\u30eb\u3092\u9001\u308b\u65b9\u6cd5\u3092\u30d5\u30a9\u30fc\u30e9\u30e0\u3067\u63a2\u3059\u3068\u3001<code>sendmail -t<\/code>\u3092\u4f7f\u3063\u305f\u3089\u884c\u3051\u305f\u3001\u3068\u306e\u3053\u3068\u3002\u4e00\u65b9\u3001\u9001\u4fe1\u8005\u3067\u3042\u308bsmartd\u306e\u4ed5\u69d8\u306f\u3001<code>mail<\/code>\u304c\u99c4\u76ee\u306a\u5834\u5408\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u6e21\u3059\u306e\u304c\u4e00\u756a\u697d\u3063\u307d\u3044\u3002<br \/>\n\u3000\u4ee5\u4e0a\u306b\u3088\u308a\u3001<code>-M exec \/share\/HDA_DATA\/.qpkg\/autorun\/smartd-mailer.sh<\/code>\u3068\u3044\u3046\u6307\u5b9a\u304c\u5165\u3063\u3066\u3044\u308b\u306e\u3067\u3042\u3063\u305f\u3002<\/p>\n<p>\u3000\u3068\u3044\u3046\u3053\u3068\u3067\u3001<code>smartd-mailer.sh<\/code>\u3092\u66f8\u3053\u3046\u3002<\/p>\n<pre class=\"brush:bash\">#!\/bin\/sh\r\n{ echo -n -e &quot;To: $SMARTD_ADDRESS\\nSubject: $SMARTD_SUBJECT\\n\\n&quot;; cat; } | \/usr\/sbin\/sendmail -t<\/pre>\n<p>\u3053\u308c\u3067\u3069\u3046\u3060\u3002<br \/>\n\u3000\u3093\u3067\u3001\u5fd8\u308c\u305a\u306b\u307e\u3068\u3081\u3066<code>chmod u+x *.sh<\/code>\u3092\u3057\u3066\u304a\u304f\u3002<br \/>\n\u3000\u6700\u5f8c\u306b\u3001\u30e1\u30fc\u30eb\u30c6\u30b9\u30c8\u306e\u70ba\u306b<code>smartd.conf<\/code>\u306e\u4e00\u884c\u76ee\u306e\u672b\u5c3e\u306b<code>-M test<\/code>\u3092\u8ffd\u52a0\u3057\u3066\u3001<\/p>\n<pre class=\"brush:plain\">[~] # \/share\/HDA_DATA\/.qpkg\/autorun\/smartd.sh<\/pre>\n<p>\u3067\u8d77\u52d5\u3002\u3088\u3057\u3001\u30c6\u30b9\u30c8\u30e1\u30fc\u30eb\u304c\u6b63\u5e38\u306b\u5c4a\u3044\u305f\u3002\u30e1\u30fc\u30eb\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u3067\u8ff7\u60d1\u30e1\u30fc\u30eb\u306b\u5165\u3089\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\uff08\u91cd\u8981\uff09\u3001\u3055\u3063\u304d\u8ffd\u52a0\u3057\u305f<code>-M test<\/code>\u3092\u6d88\u3057\u3066\u3001\u8d77\u52d5\u3057\u76f4\u3057\u3066\u3001\u7d42\u308f\u308a\u30fc\u3002\u3046\u3078\u30fc\u3002\u75b2\u308c\u305f\u308f\u30fc\u3002<br \/>\n\u3000\u3067\u3082\u3001\u5b9f\u969b\u306bSMART\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u6642\u306b\u3061\u3083\u3093\u3068\u52d5\u304f\u306e\u304b\u4e0d\u660e\u3002\u4e00\u898b\u52d5\u304d\u305d\u3046\u306b\u898b\u3048\u308b\u3051\u3069\u3001\u300c\u3053\u308c\u3058\u3083\u52d5\u304b\u306d\u30fc\u3088\u30d0\u30fc\u30ab\u300d\u3068\u304b\u3042\u3063\u305f\u3089\u662f\u975e\u30b3\u30e1\u30f3\u30c8\u3092\u3002<\/p>\n<p>\u3000\u305d\u3057\u3066\u3001Q-RAID1\u3068\u3084\u3089\u306e\u30df\u30e9\u30fc\u30ea\u30f3\u30b0\u306f\u7cde\u9045\u304b\u3063\u305f\u3002eSATA\u306a\u3093\u3060\u3057\u3001\u3082\u30fc\u3061\u3087\u3044\u4f55\u3068\u304b\u306a\u3089\u3093\u306e\u304b\u306a\u3002<code>ps<\/code>\u3067\u898b\u308b\u9650\u308a\u3001rsync 3.0.7\u3092\u6539\u9020\u3057\u3066\u52d5\u3044\u3066\u308b\u3063\u307d\u3044\u96f0\u56f2\u6c17\u3067\u306f\u3042\u308b\u3051\u3069\u3001\u4f55\u3067\u3053\u3093\u306a\u306b\u9045\u3044\u3093\u3060\u308d\u3046\u3002<br \/>\n\u3000\u3044\u3064\u307e\u3067\u3082\u7d42\u308f\u3089\u306a\u3044\u3057\u3001\u7d42\u308f\u308b\u307e\u3067\u306f\u518d\u8d77\u52d5\u3082\u3057\u305f\u304f\u306a\u3044\u3093\u3067\u3001smartd\u304c\u81ea\u52d5\u3067\u8d77\u52d5\u3059\u308b\u304b\u306e\u30c6\u30b9\u30c8\u3082\u51fa\u6765\u306a\u3044\u306e\u3060\u304c\u3002\u5931\u6557\u3057\u305f\u3089\u5831\u544a\u306e\u8a18\u4e8b\u66f8\u3044\u3066\u3001\u3053\u3053\u306b\u8ffd\u8a18\u3082\u3059\u308c\u3070\u3044\u3044\u304b\u3002<br \/>\n\u3000Q-RAID1\u304c\u30cf\u30fc\u30c9\u30ea\u30f3\u30af\u3092\u3061\u3083\u3093\u3068\u51e6\u7406\u3059\u308b\u304b\u3068\u304b\u3082\u78ba\u8a8d\u3059\u308b\u3064\u3082\u308a\u3060\u3063\u305f\u3051\u3069\u3001\u3053\u3063\u3061\u306f\u7279\u306b\u7570\u69d8\u306a\u3053\u3068\u304c\u8d77\u304d\u306a\u3051\u308c\u3070\u5831\u544a\u306e\u8a18\u4e8b\u306f\u66f8\u304b\u306a\u304f\u3066\u826f\u3055\u305d\u3046\u304b\u306a\u30fc\u3002<\/p>\n<p>\u8ffd\u8a18:<br \/>\n\u3000Q-RAID1\u306f\u30cf\u30fc\u30c9\u30ea\u30f3\u30af\u3092\u7406\u89e3\u3057\u306a\u304b\u3063\u305f\u3002\u30d5\u30a9\u30fc\u30e9\u30e0\u3067\u3082\u516d\u5e74\u4ee5\u4e0a\u524d\u306b\u300c<code>-H<\/code>\u4ed8\u3051\u3066\u300d\u300c\u691c\u8a0e\u3057\u3068\u304f\u308f\u300d\u3063\u3066\u3084\u308a\u53d6\u308a\u304c\u3042\u3063\u305f\u3093\u3067\u3001\u5206\u304b\u3063\u3066\u308b\u3051\u3069\u653e\u7f6e\u3063\u307d\u3044\u3002\u3053\u308c\u3082\u300c\u6240\u8a6eNAS\u3067\u3059\u304b\u3089\u300d\u3063\u3066\u3053\u3068\u304b\u306d\u3002<br \/>\n\u3000\u307e\u3042\u3001\u30c7\u30fc\u30bf\u7f6e\u304d\u5834\u306b\u30cf\u30fc\u30c9\u30ea\u30f3\u30af\u306a\u3093\u3066\u666e\u901a\u4f7f\u308f\u306a\u3044\u3060\u308d\u3001\u3063\u3066\u8a00\u308f\u308c\u308c\u3070\u305d\u308c\u307e\u3067\u3060\u304c\u3002\u4e16\u4ee3\u7ba1\u7406\u51fa\u6765\u306a\u3044\u306a\u30fc\u3069\u3046\u3057\u3088\u3046\u3002<\/p>\n<p>\u8ffd\u8a182:<br \/>\n\u3000\u518d\u8d77\u52d5\u3057\u305f\u3089smartd\u306f\u81ea\u52d5\u8d77\u52d5\u3057\u306a\u304b\u3063\u305f\u3002\u3050\u306c\u306c\u3002Q-RAID1\u306f\u982d\u304b\u3089\u540c\u671f\u3057\u76f4\u3057\u3060\u3051\u306910\u5206\u304f\u3089\u3044\u3067\u5b8c\u4e86\u3002\u307e\u3042\u305f\u3060\u306e\u30ed\u30fc\u30ab\u30ebrsync\u307f\u305f\u3044\u3060\u3057\u306a\u3002<br \/>\n\u3000\u81ea\u52d5\u8d77\u52d5\u306f\u3001\u8abf\u3079\u3066\u3082\u4eca\u4e00\u3064\u826f\u304f\u5206\u304b\u3089\u3093\u3057\u3001\u3082\u3046\u3081\u3093\u3069\u304f\u305b\u30fc\u304b\u3089\u591a\u91cd\u8d77\u52d5\u5bfe\u7b56\u3057\u305f\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u3092cron\u3067\u6bce\u6642\u9593\u8d77\u52d5\u3068\u304b\u3067\u8aa4\u9b54\u5316\u3059\u304b\u306a\u30fc\u3002<\/p>\n<p>\u8ffd\u8a183:<br \/>\n\u3000\u30d5\u30a1\u30fc\u30e0\u3092\u66f4\u65b0\uff08QTS4.0.6\u21924.1.0\uff09\u3057\u305f\u3089smartmontools\u306etarball\u53d6\u3063\u3066\u304f\u308b\u3068\u3053\u304b\u3089\u3084\u308a\u76f4\u3057\u306b\u306a\u3063\u305f\u3002\u6bce\u56de\u5fc5\u8981\u304b\u306f\u5206\u304b\u3089\u3093\u3051\u3069\u3002\u82e5\u5e72\u3081\u3093\u3069\u304f\u305b\u30fc\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u3092HDA_DATA\u306e\u4e2d\u306b\u3057\u305f\u65b9\u304c\u826f\u304b\u3063\u305f\u304b\u3082\uff1f<br \/>\n\u3000\u3067\u3001smartmontools\u30826.2\u21926.3.1\u306b\u306a\u3063\u3066\u3001QTS\u3068smartmontools\u306e\u3069\u3063\u3061\u306e\u305b\u3044\u304b\u5206\u304b\u3089\u3093\u3051\u3069\u3084\u3084\u3053\u3057\u3044\u554f\u984c\u591a\u767a\u3002\u5bfe\u5fdc\u3057\u305f\u8a2d\u5b9a\u306f\u672c\u6587\u4e2d\u306b\u8ffd\u8a18\u3002<br \/>\n\u3000\u66f4\u306bVLAN\u3068\u304bGmail\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5f37\u5316\u3068\u304b\u306e\u90fd\u5408\u3067\u3046\u307e\u304f\u30e1\u30fc\u30eb\u3082\u5c4a\u304b\u305a\u3001\u9762\u5012\u306a\u306e\u3067Python\u3067email\u3068smtplib\u3092\u4f7f\u3063\u3066<code>smartd-mailer.py<\/code>\u3068\u304b\u66f8\u3044\u3066\u89e3\u6c7a\u3002SMTP\u8a8d\u8a3c\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u66f8\u304f\u3068\u4f55\u304b\u6c17\u6301\u3061\u60aa\u3044\u304c\u3002\u5b9f\u306b\u8272\u3005\u3068\u9762\u5012\u3067\u3042\u3063\u305f\u3002<br \/>\n\u3000\u3064\u30fc\u3053\u3068\u3067\u3001\u5143\u304b\u3089\u4e0d\u89aa\u5207\u306a\u8a18\u4e8b\u3060\u3063\u305f\u3051\u3069\u3001\u3044\u3088\u3044\u3088\u4f7f\u3044\u306b\u304f\u3044\u8a18\u4e8b\u306b\u306a\u3063\u305f\u3002\u4ffa\u3060\u3063\u3066\u300c\u3053\u308c\u30b3\u30d4\u30da\u3059\u308a\u3083\u5927\u4f53\u4f7f\u3048\u308b\u305c\u30fc\u300d\u3063\u3066\u8a18\u4e8b\u306b\u3057\u305f\u3044\u6c17\u306f\u3059\u308b\u3093\u3060\u3051\u3069\u3082\u4f55\u3060\u304b\u3060\u308b\u304f\u3066\u3082\u30fc\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u4e45\u3005\u306b\u6280\u8853\u5bc4\u308a\u306e\u8a18\u4e8b\u3067\u3042\u308b\u306a\u3002 \u3000QNAP TS-121\u306b\u3001\u5916\u4ed8\u3051HDD\u30b1\u30fc\u30b9\uff08WD Red 4TB\u5165\u308a\uff09\u3092eSATA\u3067\u63a5\u7d9a\u3057\u3066\u3001Q-RAID1\u3068\u304b\u3044\u3046\u602a\u3057\u3044\u30d6\u30c4\u3067\u30df\u30e9\u30fc\u30ea\u30f3\u30b0\u3092\u59cb\u3081\u305f\u306e\u3067\u3042\u308b\u304c\u3002 \u3000\u3069\u3046\u3082\u5916\u90e8\u63a5\u7d9a\u30c9\u30e9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/posts\/5504"}],"collection":[{"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/comments?post=5504"}],"version-history":[{"count":55,"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/posts\/5504\/revisions"}],"predecessor-version":[{"id":6301,"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/posts\/5504\/revisions\/6301"}],"wp:attachment":[{"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/media?parent=5504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/categories?post=5504"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/tags?post=5504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}