Annvix:User Guide/smartd

From linsec.ca
Jump to: navigation, search

This page contains content from the old Annvix.org wiki and has been moved here to preserve content. These pages have been retained for historical and nostalgic purposes only.
Please be aware that Annvix is no longer in development!


smartd - monitor hard drive SMART information

Annvix uses smartmontools to provide services that monitor and alert of changes to S.M.A.R.T. (Self-Monitoring, Analysis and Reporting Technology) statuses in system hard drives. smartmontools is installed by default, although it is not configured by default.

smartd.conf

In order to make use of smartd(8), the /etc/smartd.conf configuration file must be edited. It is full of comments that can be used to tweak exactly what is monitored for each system drive. A short smartd.conf configuration file that monitors /dev/sda, /dev/sdb, and /dev/hda is shown below. For each drive, all S.M.A.R.T. attributes are monitored, and any errors are sent to the email address root@localhost:

/dev/sda -a -d ata -m root@localhost
/dev/sdb -a -d ata -m root@localhost
/dev/hda -a -m root@localhost

Using man 5 smartd.conf you can view the man page for smartd to get further information on applicable commands.

The above configuration monitors all attributes of the three noted drives. Note that for SATA drives, you must pass the -d ata option, which specifies the device type. By default, smartd will guess as to what type of drive it is, however it does so by looking at the first letter of the drive name: 'h' for ATA and 's' for SCSI. Unfortunately, SATA drives share the same device names as SCSI, so to force smartd to talk to an ATA device (of which it would normally attempt to issue SCSI commands), you need to explicitly specify the type. The man page contains more information regarding this.

Using the smartd service

With the configuration file in place, you can have smartd run as a daemon to keep an eye on your devices. To do this, you must add the smartd service and start it:

# srv --add smartd

This will add and start the service.

To view the log output from the service, view the /var/log/service/smartd/current log file. This log file will indicate any status changes to monitored devices.

The smartd service takes one option in the environment directory /var/service/smartd/env:

  • INTERVAL: the number of seconds between S.M.A.R.T. attribute polls (default: 1800)

If you wish to execute S.M.A.R.T. tests or view the S.M.A.R.T. information on a drive, use the smartctl(8) command. View

<< Return to User Guide

Personal tools
other sites