====== smartdでディスク監視 ====== smartdでのディスク監視設定をしておく事によって、\\ ディスクの障害時に自動でアラートメールを飛ばしてくれる。\\ アラートの飛び先は「disk-alert@flateight.com」に統一する。 ===== インストール ===== ※CentOSではデフォルトでインストールされている。 # yum -y install smartmontools ===== 自動起動がOnになっている事を確認 ===== # chkconfig --list|grep smartd smartd 0:off 1:off 2:on 3:on 4:on 5:on 6:off ===== 起動 ===== # service smartd restart ===== 設定ファイル編集 ===== 該当のディスク監視オプションで追加する。\\ ※確認方法は以下の「確認のコマンド」で # vi /etc/smartd.conf -------- 下記追加 ----------------- /dev/sda -a -m disk-alert@flateight.com ===== 確認のコマンド ===== ==== 3wareの場合 ==== #smartctl -t long -d 3ware,0 -a /dev/twa0 #smartctl -t long -d 3ware,1 -a /dev/twa0 #smartctl -t long -d 3ware,2 -a /dev/twa0 #smartctl -t long -d 3ware,3 -a /dev/twa0 ==== Acaptechの場合 ==== [[http://www.cyberciti.biz/faq/linux-checking-sas-sata-disks-behind-adaptec-raid-controllers/]] 自己診断テスト smartctlコマンドの自己診断実行モードは、short , long , conveyance の3種類があります。 ^short|簡単なテスト。(1分くらい)| ^long|長いテスト。(1〜数時間かかります)| ^conveyance|輸送中に障害が起きやすいセクタをテストする。| 例 smartctl -t long /dev/sda smartctl -t short /dev/sda === その後下記のコマンドで、結果表示 === === ATAディスクの場合 === # smartctl -d ata -a /dev/hda === SASの場合 === # smartctl -d sas -a /dev/sda {{tag>smartctl}}