Select Git revision
ballen4705 authored
Added feature to send email warnings when errors detected by smartd. But this is NOT YET TESTED! Be cautious in using this for now. git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@246 4ea69e1a-61f1-4043-bf83-b5c94c648137
smartd.8 16.07 KiB
\# Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net>
\#
\# $Id: smartd.8,v 1.26 2002/11/12 21:16:25 ballen4705 Exp $
\#
\# This program is free software; you can redistribute it and/or modify it
\# under the terms of the GNU General Public License as published by the Free
\# Software Foundation; either version 2, or (at your option) any later
\# version.
\#
\# You should have received a copy of the GNU General Public License (for
\# example COPYING); if not, write to the Free Software Foundation, Inc., 675
\# Mass Ave, Cambridge, MA 02139, USA.
\#
\# This code was originally developed as a Senior Thesis by Michael Cornwell
\# at the Concurrent Systems Laboratory (now part of the Storage Systems
\# Research Center), Jack Baskin School of Engineering, University of
\# California, Santa Cruz. http://ssrc.soe.ucsc.edu/
\#
.TH SMARTD 8 "$Date: 2002/11/12 21:16:25 $" "smartmontools-5.0"
.SH NAME
smartd \- S.M.A.R.T. Daemon
.SH SYNOPSIS
.B smartd
[\-VX\]
.SH DESCRIPTION
.B smartd
is a daemon that monitors the Self-Monitoring, Analysis and Reporting
Technology (S.M.A.R.T.) system built into many ATA-3 and later ATA,
IDE and SCSI-3 hard drives. The purpose of S.M.A.R.T. is to monitor
the reliability of the hard drive and predict drive failures, and to
carry out different types of drive self-tests. This version of
.B smartd
is compatible with ATA/ATAPI-5 and earlier standards (see
.B REFERENCES
below)
.B smartd
will attempt to enable S.M.A.R.T. monitoring on ATA devices, and polls
these and SCSI devices every 30 minutes, logging S.M.A.R.T. errors and
changes of S.M.A.R.T. Attributes via the SYSLOG interface. These
notifications and warnings normally appear in
.B /var/log/messages. smartd
can be configured at start-up using the file
.B /etc/smartd.conf.
Note that
.B smartd
only reads the configuration file at start-up: changes to the
configuration file take effect only after the
.B smartd
daemon is restarted. If you send a HUP signal to
.B smartd
it will log a polite message saying that it ignores this signal and
that it has
.I not
re-read the configuration file.
On startup, in the absence of the configuration file
.B /etc/smartd.conf,
the
.B smartd
daemon first scans for all devices that support S.M.A.R.T., using
.B "/dev/hd[a-l]"
for IDE/ATA devices, and
.B "/dev/sd[a-z]"
for SCSI
devices. It then monitors for
.I all
possible S.M.A.R.T. errors (corresponding to the
.B '\-a'
Directive in the configuration file (see
.B CONFIGURATION FILE
below). Note that when there is no configuration file, and
.B smartd
scans for devices on startup,
.B warning messages may appear in /var/log/messages,
about missing block-major-xx devices. These messages are usually
harmless. Alternatively, the configuration file can be used to exclude
non-existent devices by giving a list of devices to monitor at
start-up.
.PP
.SH SYNTAX
.PP
.B smartd
takes either zero, one, or two arguments. The optional arguments
begins with a '\-' followed by a letter or letters.
.P
.SH
OPTIONS
.TP
.B V
Version: Prints license, copyright, and CVS version information onto
STDOUT and then exits. Please include this information if you are
reporting bugs, or have specific questions about the behavior of
.B smartd.
.TP
.B X
eXamine: Runs
.B smartd
in "debug" mode. In this mode, it does not
.B fork
(2) and displays status information to STDOUT. It also prints more
verbose information about what it is doing.
.SH EXAMPLES
.B
smartd
.fi
Runs the daemon in forked mode. This is the normal way to run
.B smartd.
Entries are logged to
.B /var/log/messages.
.fi
Note that
.B smartmontools
provides a start-up script in
.B /etc/rc.d/init.d/smartd
which is responsible for starting and stopping the daemon via the
normal init interface.
Using this script, you can start
.B smartd
by giving the command:
.nf
.B /etc/rc.d/init.d/smartd start
.fi
and stop it by using the command:
.nf
.B /etc/rc.d/init.d/smartd stop
.fi
If you want
.B smartd
to start running whenever your machine is booted, this can be enabled
by using the command:
.nf
.B /sbin/chkconfig --add smartd
.fi
and disabled using the command:
.nf
.B /sbin/chkconfig --del smartd
\# STARTINCLUDE
.SH CONFIGURATION FILE /etc/smartd.conf
In the absence of a configuration file,
.B smartd
will try to open the 12 ATA devices
.B /dev/hd[a-l]
and the 26 SCSI
devices
.B /dev/sd[a-z].
This can be annoying if you have an ATA or SCSI device that hangs or
misbehaves when receiving SMART commands. Even if this causes no
problems, you may be annoyed by the string of error log messages about
block-major devices that can't be found, and SCSI devices that can't
be opened.
One can avoid this problem, and gain more control over the types of
events monitored by
.B smartd,
by using the configuration file
.B /etc/smartd.conf.
This file contains a list of devices to monitor, with one device per
line. An example file is included with the
.B smartmontools
distribution, and is normally placed in
.B /etc/smartd.conf.example.
If
.B smartmontools
was properly installed on your system, you will also find this sample
configuration file in
.B /usr/share/doc/smartmontools-5.0/.
For security, the configuration file should not be writable by anyone
but root. The syntax of the file is as follows:
.IP
There should be one device listed per line, although you may have
lines that are entirely comments or white space.
Any text following a hash sign (#) and up to the end of the line is
taken to be a comment, and ignored.
Lines may be continued by using a backslash (\(rs) as the last
non-whitespace or non-comment item on a line.
.PP 0
.fi
Here is an example configuration file. It's for illustrative purposes
only; please don't copy it onto your system without reading to the end
of the
.B DIRECTIVES
Section below!
.nf
.B ################################################
.B # This is an example smartd startup config
.B # file /etc/smartd.conf for monitoring three
.B # ATA disks and two SCSI disks.
.B #
.nf
.B # First ATA disk on each of two interfaces:
.B #
.B \ \ /dev/hda -a
.B \ \ /dev/hdc -a -I 194 -I 5 -i 12
.B #
.nf
.B # SCSI disk:
.B #
.B \ \ /dev/sda
.B #
.nf
.B # Strange device. It's SCSI:
.B #
.B \ \ /dev/weird -S
.B #
.nf
.B # The following line enables monitoring of the
.B # ATA Error Log and the Self-Test Error Log.
.B # It also tracks changes in both Prefailure
.B # and Usage Attributes, apart from Attributes
.B # 9, 194, and 231, and shows continued lines:
.B #
.B \ \ /dev/hdd\ -L\ -l\ -t\ \ \(rs\ \ # Attributes not tracked:
.B\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -I\ 194\ \(rs\ \ # temperature
.B\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -I\ 231\ \(rs\ \ # also temperature
.B\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -I 9\ \ \ \ \ \ # power-on hours
.B #
.B ################################################
.fi
.PP
.SH CONFIGURATION FILE DIRECTIVES
.PP
If the first non-comment entry in the configuration file is the text
string
.B DEVICESCAN
in capital letters, then
.B smartd
will ignore the configuration file, and will scan for devices.
.sp 2
The following are the Directives that may appear following the device
name on any line of the
.B /etc/smartd.conf
configuration file. Note that
.B these are NOT command-line options for
.B smartd.
The Directives below may appear in any order,
following the device name. For the moment, apart from the '\-S'
Directive, these Directives only apply to ATA disks.
.B For ATA disks, if
.B no Directives appear, the disk will not be monitored.
The '\-a' Directive will try to monitor everything possible.
.TP
.B \-A
ATA: The device is an ATA device. Don't try issuing SCSI commands to it.
.TP
.B \-S
SCSI: The device is a SCSI device. Don't try issuing IDE/ATA
commands to it.
In the absence of either of these Directives,
.B smartd
will attempt to guess the device type by looking at whether the fifth
character in the device name is an 's' or an 'h'. If it can't guess
from this fifth character, then it will simply try to access the
device using first ATA and then SCSI ioctl()s.
.TP
.B \-C <N>
This sets the time in between disk checks to be
.B <N>
seconds apart, where N is a decimal integer. Note that although you can give this Directive
multiple times on different lines of the configuration file, only the
final value that is given is used. That final value applies to all the disks.
The default value of
.B <N>
is 1800 sec, and the minimum allowed value is
ten seconds.
.TP
.B \-P
Permissive: Even if the disk appears to lack SMART capabilities, try
to monitor it anyway. This may be required for some old disks (prior
to ATA-3 revision 4) that implemented SMART before the SMART standards
were incorporated into the ATA/ATAPI Specifications. [Please see the
.B smartctl \-P
command-line option.]
.TP
.B \-c
Check: Will check the SMART status of the disk. If any Prefailure
Attributes are less than or equal to their threshold values, then disk
failure is predicted in less than 24 hours, and a message at priority
.B 'CRITICAL'
will be logged to syslog. [Please see the
.B smartctl \-c
command-line option.]
.TP
.B \-l
Log: Report if that the number of ATA errors reported in the ATA
Error Log has increased since the last check.
[Please see the
.B smartctl \-l
command-line option.]
.TP
.B \-L
Log: Report if that the number of errors reported in the SMART
Self-Test Log has increased since the last check. Note that such
errors will
.I only
be logged if you run self-tests on the disk (and it fails the
tests!). [Self-Tests can be run by using the
.B '\-SXsx'
options of
.B smartctl,
and the results of the testing can be observed using the
.B smartctl \-L
command line option.]
.TP
.B \-f
Fail: Check for 'failure' of any Usage Attributes. If these
Attributes are less than or equal to the threshold, it does NOT
indicate imminent disk failure. It "indicates an advisory condition
where the usage or age of the device has exceeded its intended design
life period."
[Please see the
.B smartctl \-v
command-line option.]
.TP
.B \-M <ADD>
Mail: Send a warning email to the email address <ADD> if the '\-c', '\-l', '\-L', or '\-f'
Directives detect a failure or a new error. This Directive only
works in conjunction with these other Directives (or with the equivalent '\-a'
Directive). To prevent your email in-box from getting filled up
with warning messages, only a single warning will be sent for each of
the enabled test types, '\-c', '\-l', '\-L', or '\-f', even if more
than one failure or error is detected.
The email is sent using the system
.B mail
command. In order that
.B smartd
find the mail command (normally /bin/mail) the
.B mail
command must be in the path of the
shell or environment from which
.B smartd
was started.
If you want to send email to more than one user, you can use the form
.B user1@add1,user2@add2,...,userN@addN
with no spaces for <ADD>.
.TP
.B \-p
Prefail: Report anytime that a Prefail Attribute has changed
its value since the last check, 30 minutes ago. [Please see the
.B smartctl \-v
command-line option.]
.TP
.B \-u
Usage: Report anytime that a Usage Attribute has changed its value
since the last check, N seconds ago. [Please see the
.B smartctl \-v
command-line option.]
.TP
.B \-t
Track: Equivalent to turning on the two previous flags '\-t' and '\-u'.
Tracks changes in
.I all
device Attributes. [Please see the
.B smartctl \-v
command-line option.]
.TP
.B \-i <ID>
Ignore: This Directive modifies the behavior of the '\-f' Directive
and has no effect without it.
.I This Directive requires a decimal integer argument <ID> in the range from 1 to 255.
It means to ignore device Attribute number <ID>, when checking for
failure of Usage Attributes. This is useful, for example, if you have
a very old disk and don't want to keep getting messages about the
hours-on-lifetime Attribute (usually Attribute 9) failing. This
Directive may appear multiple times for a single device, if you want
to ignore multiple Attributes.
.TP
.B \-I <ID>
Ignore: This Directive modifies the
behavior of the '\-p', '\-u', and '\-t' Directives
and has no effect without one of them.
.I This Directive requires a decimal integer argument <ID> in the range from 1 to 255.
It means to ignore device Attribute <ID>, when tracking changes in the
Attribute values. This is useful, for example, if one of the device
Attributes is the disk temperature (usually Attribute 194 or
231). It's annoying to get reports each time the temperature changes.
This Directive may appear multiple times for a single device, if you
want to ignore multiple Attributes.
.TP
.B \-a
All: equivalent to turning on the following Directives:
.B '\-c'
to check the SMART status,
.B '\-f'
to report failures of Usage (rather than Prefail) Attributes,
.B '\-t'
to track changes in both Prefailure and Usage Attributes,
.B '\-L'
to report increases in the number of Self-Test Log errors, and
.B '\-l'
to report increases in the number of ATA errors.
.TP
.B #
Comment: ignore the remainder of the line.
.TP
.B \(rs
Continuation character: if this is the last non-white or non-comment
character on a line, then the following line is a continuation of the current
one.
.PP
If you are not sure which Directives to use, I suggest experimenting
for a few minutes with
.B smartctl
to see what SMART functionality your disk(s) support(s). If you do
not like voluminous syslog messages, a good choice of
.B smartd
configuration file Directives might be
.B \-c \-L \-l \-f.
If you want more frequent information, use
.B -a.
\# ENDINCLUDE
.SH NOTES
.B smartd
will make log entries at loglevel
.B LOG_INFO
if SMART Attribute values have changed, as reported using the
.B '\-t', '\-p', or '\-u'
Directives. For example:
.nf
.B 'Device: /dev/hda, SMART Attribute: 194 Temperature_Centigrade changed from 94 to 93'
.fi
Note that in this message, the value given is the 'Normalized' not
the 'Raw' Attribute value (the disk temperature in this case is about 22
Centigrade). See the
.B smartctl
manual page for further explanation.
.B smartd
will make log entries at loglevel
.B LOG_CRIT
if a SMART Attribute has failed, for example:
.nf
.B 'Device: /dev/hdc, Failed SMART Attribute: 5 Reallocated_Sector_Ct'
.fi
This loglevel is used for reporting enabled by the
.B '\-c', \-f', '\-L', and '\-l'
Directives. Entries reporting failure of SMART Prefailure Attributes
should not be ignored: they mean that the disk is failing. Use the
.B smartctl
utility to investigate.
.PP
.SH AUTHOR
Bruce Allen
.B smartmontools-support@lists.sourceforge.net
.fi
University of Wisconsin - Milwaukee Physics Department
.PP
.SH CREDITS
.fi
This code was derived from the smartsuite package, written by Michael
Cornwell, and from the previous ucsc smartsuite package. It extends
these to cover ATA-5 disks. This code was originally developed as a
Senior Thesis by Michael Cornwell at the Concurrent Systems Laboratory
(now part of the Storage Systems Research Center), Jack Baskin School
of Engineering, University of California, Santa
Cruz. http://ssrc.soe.ucsc.edu/.
.SH
HOME PAGE FOR SMARTMONTOOLS:
.fi
Please see the following web site for updates, further documentation, bug
reports and patches:
.nf
.B
http://smartmontools.sourceforge.net/
.SH
SEE ALSO:
.B smartd.conf
(5),
.B smartctl
(8),
.B syslogd
(8)
.SH
REFERENCES FOR S.M.A.R.T.
.fi
If you would like to understand better how S.M.A.R.T. works, and what
it does, a good place to start is Section 8.41 of the 'AT
Attachment with Packet Interface-5' (ATA/ATAPI-5) specification. This
documents the S.M.A.R.T. functionality which the
.B smartmontools
utilities provide access to. You can find Revision 1 of this document
at:
.nf
.B
http://www.t13.org/project/d1321r1c.pdf
.fi
Future versions of the specifications (ATA/ATAPI-6 and ATA/ATAPI-7),
and later revisions (2, 3) of the ATA/ATAPI-5 specification are
available from:
.nf
.B
http://www.t13.org/#FTP_site
.fi
The functioning of S.M.A.R.T. is also described by the SFF-8035i
revision 2 specification. This is a publication of the Small Form
Factors (SFF) Committee, and can be obtained from:
.TP
\
SFF Committee
.nf
14426 Black Walnut Ct.
.nf
Saratoga, CA 95070, USA
.nf
SFF FaxAccess: +01 408-741-1600
.nf
Ph: +01 408-867-6630
.nf
Fax: +01 408-867-2115
.nf
E-Mail: 250-1752@mcimail.com.
.PP
Please let us know if there is an on\-line source for this document.
.SH
CVS ID OF THIS PAGE:
$Id: smartd.8,v 1.26 2002/11/12 21:16:25 ballen4705 Exp $