måndag, juni 11, 2007

Monitor harddrives using smartmontools in FreeBSD

"Control and monitor storage systems using the Self-Monitoring, Analysis and Reporting Technology System (SMART) built into most modern ATA and SCSI hard disks. In many cases, these utilities will provide advanced warning of disk degradation and failure."


Pre req:
Update ports with portsnap


#cd /usr/ports/sysutils/smartmontools
#make install clean

#cd /usr/local/etc/
#ls smart*
smartd.conf.sample

#cp smartd.conf.sample smartd.conf

#dmesg grep ata
...
ad0: 76319MB at ata0-master SATA150
ad1: 76319MB at ata0-slave SATA150
...

Check if SMART is enabled before we add config
#rehash
#smartctl -a /dev/ad(01)
..
SMART support is: Available - device has SMART capability.SMART support is: Enabled
..

# vi smartd.conf

Disable scan
#DEVICESCAN

/dev/ad0 -a -I 194 -W 4,30,40 -R 5 -m operator@domain.com
/dev/ad1 -a -I 194 -W 4,30,40-R 5 -m operator@domain.com

# echo 'smartd_enable="YES"' >> /etc/rc.conf

Done!