smartmontools ( smartctl , smartd )

以下、サンプル


以下設定を追加
/dev/sda -a -d sat -o on -S on -n standby -I 190 -I 194 -s (S/../.././22|L/../../7/03) -m xxx@aaa,yyy@bbb,zzz@ccc
/dev/sdb -a -d sat -o on -S on -n standby -I 190 -I 194 -s (S/../.././23|L/../../7/04) -m xxx@aaa,yyy@bbb,zzz@ccc


・オプション
 -a:すべての情報表示
 -o:自動オフラインテスト
 -S:固有属性自動保存
 -s:スケジュール(スケジュール書式:T/MM/DD/d/HH)
   T:テスト=S:short/L:long
   MM:月
   DD:日
   d:曜日1:月曜日〜
   HH:時間指定
   ※「.」で位置文字代
   ※ 「()」と「|」で複数指定
 -n:30分ごとのディスクアクセスstandbyもしくはsleepを有効。
   ただし-sオプションでスケジューリングされた監視は有効
 -m:異常時メール送信先(複数はカンマ区切り)
 -I:無視属性
[root@cent5-64b-40 ~]# rpm -aq | grep smartmon
smartmontools-5.42-2.el5
[root@cent5-64b-40 ~]# rpm -ql smartmontools
/etc/rc.d/init.d/smartd
/etc/smartd.conf
/etc/sysconfig/smartmontools
/usr/sbin/smartctl
/usr/sbin/smartd
/usr/sbin/update-smart-drivedb
/usr/share/doc/smartmontools-5.42
/usr/share/doc/smartmontools-5.42/AUTHORS
/usr/share/doc/smartmontools-5.42/CHANGELOG
/usr/share/doc/smartmontools-5.42/COPYING
/usr/share/doc/smartmontools-5.42/INSTALL
/usr/share/doc/smartmontools-5.42/NEWS
/usr/share/doc/smartmontools-5.42/README
/usr/share/doc/smartmontools-5.42/TODO
/usr/share/doc/smartmontools-5.42/WARNINGS
/usr/share/doc/smartmontools-5.42/examplescripts
/usr/share/doc/smartmontools-5.42/examplescripts/Example1
/usr/share/doc/smartmontools-5.42/examplescripts/Example2
/usr/share/doc/smartmontools-5.42/examplescripts/Example3
/usr/share/doc/smartmontools-5.42/examplescripts/Example4
/usr/share/doc/smartmontools-5.42/examplescripts/README
/usr/share/doc/smartmontools-5.42/smartd.conf
/usr/share/man/man5/smartd.conf.5.gz
/usr/share/man/man8/smartctl.8.gz
/usr/share/man/man8/smartd.8.gz
/usr/share/smartmontools
/usr/share/smartmontools/drivedb.h
[root@cent5-64b-40 ~]# 

smartdはデフォルトでは動いていないが、継続的なモニタをしない場合は不要。
smartctlで実際の操作ができる。

[root@cent5-64b-40 etc]# cd /etc/
[root@cent5-64b-40 etc]# find . | grep smartd
./smartd.conf
./rc.d/rc5.d/S99smartd
./rc.d/rc4.d/S99smartd
./rc.d/rc6.d/K01smartd
./rc.d/rc0.d/K01smartd
./rc.d/rc1.d/K01smartd
./rc.d/init.d/smartd
./rc.d/rc2.d/S99smartd
./rc.d/rc3.d/S99smartd
[root@cent5-64b-40 etc]# 

[root@cent5-64b-40 etc]# cp -pr smartd.conf smartd.conf.orig

[root@cent5-64b-40 etc]# cat smartd.conf.orig | grep -v "^#" | grep -v "^$"
DEVICESCAN -H -m root
[root@cent5-64b-40 etc]# 
> smartmontools

# smartctl -i /dev/hda
一般的なハードディスク情報の表示

# smart -A /dev/hda
よくみるSMARTデータの出力。VALUEが現在、WORSTは現在までの最悪値の指数、THRESH以下になっているとまずい。RAWデータを指数に変換してあるので、少しピンとこない。

# smart -c /dev/hda
SMARTの状態表示。

# smartctl -H /dev/hda
SMARTデータの異常部を表示してくれる。

# smartctl -l error /dev/hda
過去のエラーログの表示。

# smartctl -t short /dev/hda
2分で終わる簡易テスト。

# smartctl -t long /de/hda
全体のテストで、ハードディスクの容量に応じて、時間がかかる。

# smartctl -l selftest /dev/hda
セルフテストの結果表示。実行中のものはリストの最後に表示されるが、終了したものは最初の#1が最新。

# smartctl -a /dev/hda | grep -i temp
全データを表示するので、grepを使わないと見にくい

以下、参考にしたサイトなど(ありがとうございます)
http://centos86config.web.fc2.com/hdd-smart-cmd.html