]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - smartd.8.in
Updated changelog
[mirror_smartmontools-debian.git] / smartd.8.in
CommitLineData
832b75ed 1.ig
e9583e0c 2Copyright (C) 2002-10 Bruce Allen <smartmontools-support@lists.sourceforge.net>
832b75ed 3
cfbba5b9 4$Id: smartd.8.in 3284 2011-03-04 21:33:35Z chrfranke $
832b75ed
GG
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11You should have received a copy of the GNU General Public License (for
12example COPYING); if not, write to the Free Software Foundation, Inc.,
13675 Mass Ave, Cambridge, MA 02139, USA.
14
15This code was originally developed as a Senior Thesis by Michael
16Cornwell at the Concurrent Systems Laboratory (now part of the Storage
17Systems Research Center), Jack Baskin School of Engineering,
18University of California, Santa Cruz. http://ssrc.soe.ucsc.edu/
19..
e9583e0c 20.TH SMARTD 8 CURRENT_SVN_DATE CURRENT_SVN_VERSION CURRENT_SVN_DATE
832b75ed
GG
21.SH NAME
22\fBsmartd\fP \- SMART Disk Monitoring Daemon
23
24.SH SYNOPSIS
25.B smartd [options]
26
27.SH FULL PATH
28.B /usr/local/sbin/smartd
29
30.SH PACKAGE VERSION
e9583e0c 31CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
832b75ed
GG
32
33.SH DESCRIPTION
34\fBsmartd\fP is a daemon that monitors the Self-Monitoring, Analysis
35and Reporting Technology (SMART) system built into many ATA-3 and
36later ATA, IDE and SCSI-3 hard drives. The purpose of SMART is to
37monitor the reliability of the hard drive and predict drive failures,
38and to carry out different types of drive self-tests. This version of
39\fBsmartd\fP is compatible with ATA/ATAPI-7 and earlier standards (see
40\fBREFERENCES\fP below).
41
42\fBsmartd\fP will attempt to enable SMART monitoring on ATA devices
43(equivalent to \fBsmartctl -s on\fP) and polls these and SCSI devices
44every 30 minutes (configurable), logging SMART errors and changes of
45SMART Attributes via the SYSLOG interface. The default location for
e9583e0c
GI
46these SYSLOG notifications and warnings is system-dependent
47(typically \fB/var/log/messages\fP or \fB/var/log/syslog\fP).
832b75ed
GG
48To change this default location, please see the \fB\'-l\'\fP
49command-line option described below.
50
51In addition to logging to a file, \fBsmartd\fP can also be configured
52to send email warnings if problems are detected. Depending upon the
53type of problem, you may want to run self\-tests on the disk, back up
54the disk, replace the disk, or use a manufacturer\'s utility to force
55reallocation of bad or unreadable disk sectors. If disk problems are
56detected, please see the \fBsmartctl\fP manual page and the
57\fBsmartmontools\fP web page/FAQ for further guidance.
58
59If you send a \fBUSR1\fP signal to \fBsmartd\fP it will immediately
60check the status of the disks, and then return to polling the disks
61every 30 minutes. See the \fB\'\-i\'\fP option below for additional
62details.
63
64\fBsmartd\fP can be configured at start-up using the configuration
e9583e0c 65file \fB/usr/local/etc/smartd.conf\fP (Windows: \fBEXEDIR/smartd.conf\fP).
832b75ed
GG
66If the configuration file is subsequently modified, \fBsmartd\fP
67can be told to re-read the configuration file by sending it a
68\fBHUP\fP signal, for example with the command:
69.fi
70\fBkillall -HUP smartd\fP.
71.fi
72(Windows: See NOTES below.)
73
74On startup, if \fBsmartd\fP finds a syntax error in the configuration
75file, it will print an error message and then exit. However if
76\fBsmartd\fP is already running, then is told with a \fBHUP\fP signal
77to re-read the configuration file, and then find a syntax error in
78this file, it will print an error message and then continue, ignoring
79the contents of the (faulty) configuration file, as if the \fBHUP\fP
80signal had never been received.
81
82When \fBsmartd\fP is running in debug mode, the \fBINT\fP signal
83(normally generated from a shell with CONTROL\-C) is treated in the
84same way as a \fBHUP\fP signal: it makes \fBsmartd\fP reload its
85configuration file. To exit \fBsmartd\fP use CONTROL-\e
86(Cygwin: 2x CONTROL\-C, Windows: CONTROL\-Break).
87
88On startup, in the absence of the configuration file
89\fB/usr/local/etc/smartd.conf\fP, the \fBsmartd\fP daemon first scans for all
90devices that support SMART. The scanning is done as follows:
91.IP \fBLINUX:\fP 9
92Examine all entries \fB"/dev/hd[a-t]"\fP for IDE/ATA
7f0798ef
GI
93devices, and \fB"/dev/sd[a-z]"\fP, \fB"/dev/sd[a-c][a-z]"\fP
94for SCSI or SATA devices.
832b75ed 95.IP \fBFREEBSD:\fP 9
eb07ddf2 96Authoritative list of disk devices is obtained from SCSI (CAM) and ATA subsystems.
832b75ed
GG
97.IP \fBNETBSD/OPENBSD:\fP 9
98Authoritative list of disk devices is obtained from sysctl
99\'hw.disknames\'.
100.IP \fBSOLARIS:\fP 9
101Examine all entries \fB"/dev/rdsk/c?t?d?s?"\fP for IDE/ATA and SCSI disk
102devices, and entries \fB"/dev/rmt/*"\fP for SCSI tape devices.
103.IP \fBDARWIN:\fP 9
104The IOService plane is scanned for ATA block storage devices.
a37e7145
GG
105.IP \fBWINDOWS\ 9x/ME\fP: 9
106Examine all entries \fB"/dev/hd[a-d]"\fP (bitmask
107from "\\\\.\\SMARTVSD") for IDE/ATA devices.
108Examine all entries \fB"/dev/scsi[0\-9][0\-f]"\fP for SCSI devices
ba59cff1 109on ASPI adapter 0\-9, ID 0\-15.
cfbba5b9 110.IP \fBWINDOWS\ NT4/2000/XP/2003/Vista/Win7/2008\fP: 9
a37e7145
GG
111Examine all entries \fB"/dev/sd[a-j]"\fP ("\\\\.\\PhysicalDrive[0-9]")
112for IDE/(S)ATA and SCSI disk devices
113
4d59bff9 114If a 3ware 9000 controller is installed, examine all entries
a37e7145
GG
115\fB"/dev/sdX,N"\fP for the first logical drive (\'unit\'
116\fB"/dev/sdX"\fP) and all physical disks (\'ports\' \fB",N"\fP)
4d59bff9 117detected behind this controller. Same for a second controller if present.
cfbba5b9
GI
118
119[NEW EXPERIMENTAL SMARTD FEATURE] If directive \'\-d csmi\' is specified,
120examine all entries \fB"/dev/csmi[0\-9],N"\fP for drives behind Intel
121Matrix RAID driver.
832b75ed 122.IP \fBCYGWIN\fP: 9
cfbba5b9 123See "WINDOWS NT4/2000/XP/2003/Vista/Win7/2008" above.
832b75ed
GG
124.IP \fBOS/2,eComStation\fP: 9
125Use the form \fB"/dev/hd[a\-z]"\fP for IDE/ATA devices.
126.PP
127\fBsmartd\fP then monitors
128for \fIall\fP possible SMART errors (corresponding to the \fB\'\-a\'\fP
129Directive in the configuration file; see \fBCONFIGURATION FILE\fP
130below).
131
132.SH
133OPTIONS
2127e193 134
832b75ed 135.TP
2127e193 136.B \-A PREFIX, \-\-attributelog=PREFIX
cfbba5b9
GI
137[ATA only] Writes \fBsmartd\fP attribute information (normalized and raw
138attribute values) to files \'PREFIX\'\'MODEL\-SERIAL.ata.csv\'. At each
139check cycle attributes are logged as a line of semicolon separated triplets
140of the form "attribute-ID;attribute-norm-value;attribute-raw-value;".
141Each line is led by a date string of the form "yyyy-mm-dd HH:MM:SS" (in UTC).
2127e193
GI
142
143.\" BEGIN ENABLE_ATTRIBUTELOG
144If this option is not specified, attribute information is written to files
145\'/usr/local/var/lib/smartmontools/attrlog.MODEL\-SERIAL.ata.csv\'.
146To disable attribute log files, specify this option with an empty string
147argument: \'-A ""\'.
148.\" END ENABLE_ATTRIBUTELOG
149MODEL and SERIAL are build from drive identify information, invalid
150characters are replaced by underline.
151
152If the PREFIX has the form \'/path/dir/\' (e.g. \'/var/lib/smartd/\'), then
153files \'MODEL\-SERIAL.ata.csv\' are created in directory \'/path/dir\'.
154If the PREFIX has the form \'/path/name\' (e.g. \'/var/lib/misc/attrlog\-\'),
155then files 'nameMODEL\-SERIAL.ata.csv' are created in directory '/path/'.
156The path must be absolute, except if debug mode is enabled.
2127e193
GI
157.TP
158.B \-B [+]FILE, \-\-drivedb=[+]FILE
cfbba5b9
GI
159[ATA only] Read the drive database from FILE. The new database replaces
160the built in database by default. If \'+\' is specified, then the new entries
161prepend the built in entries.
bed94269 162Please see the \fBsmartctl\fP(8) man page for further details.
2127e193
GI
163.TP
164.B \-c FILE, \-\-configfile=FILE
832b75ed 165Read \fBsmartd\fP configuration Directives from FILE, instead of from
e9583e0c 166the default location \fB/usr/local/etc/smartd.conf\fP (Windows: \fBEXEDIR/smartd.conf\fP).
832b75ed
GG
167If FILE does \fBnot\fP exist, then \fBsmartd\fP will print an error
168message and exit with nonzero status. Thus, \'\-c /usr/local/etc/smartd.conf\'
169can be used to verify the existence of the default configuration file.
170
171By using \'\-\' for FILE, the configuration is read from standard
172input. This is useful for commands like:
173.nf
174.B echo /dev/hdb \-m user@home \-M test | smartd \-c \- \-q onecheck
175.fi
176to perform quick and simple checks without a configuration file.
a23d5117
GI
177.\" BEGIN ENABLE_CAPABILITIES
178.TP
179.B \-C, \-\-capabilities
180Use \fBcapabilities(7)\fP (EXPERIMENTAL).
181
182Warning: Mail notification does not work when used.
a23d5117 183.\" END ENABLE_CAPABILITIES
832b75ed
GG
184.TP
185.B \-d, \-\-debug
186Runs \fBsmartd\fP in "debug" mode. In this mode, it displays status
187information to STDOUT rather than logging it to SYSLOG and does not
188\fBfork(2)\fP into the background and detach from the controlling
189terminal. In this mode, \fBsmartd\fP also prints more verbose
190information about what it is doing than when operating in "daemon"
191mode. In this mode, the \fBQUIT\fP signal (normally generated from a
192terminal with CONTROL\-C) makes \fBsmartd\fP reload its configuration
193file. Please use CONTROL-\e to exit
194(Cygwin: 2x CONTROL\-C, Windows: CONTROL\-Break).
195
196Windows only: The "debug" mode can be toggled by the command
197\fBsmartd sigusr2\fP. A new console for debug output is opened when
198debug mode is enabled.
199.TP
200.B \-D, \-\-showdirectives
201Prints a list (to STDOUT) of all the possible Directives which may
202appear in the configuration file /usr/local/etc/smartd.conf, and then exits.
203These Directives are also described later in this man page. They may
204appear in the configuration file following the device name.
205.TP
206.B \-h, \-\-help, \-\-usage
207Prints usage message to STDOUT and exits.
208.TP
209.B \-i N, \-\-interval=N
210Sets the interval between disk checks to \fIN\fP seconds, where
211\fIN\fP is a decimal integer. The minimum allowed value is ten and
212the maximum is the largest positive integer that can be represented on
213your system (often 2^31-1). The default is 1800 seconds.
214
215Note that the superuser can make \fBsmartd\fP check the status of the
216disks at any time by sending it the \fBSIGUSR1\fP signal, for example
217with the command:
218.nf
219.B kill -SIGUSR1 <pid>
220.fi
221where \fB<pid>\fP is the process id number of \fBsmartd\fP. One may
222also use:
223.nf
224.B killall -USR1 smartd
225.fi
226for the same purpose.
227.fi
228(Windows: See NOTES below.)
832b75ed
GG
229.TP
230.B \-l FACILITY, \-\-logfacility=FACILITY
231Uses syslog facility FACILITY to log the messages from \fBsmartd\fP.
232Here FACILITY is one of \fIlocal0\fP, \fIlocal1\fP, ..., \fIlocal7\fP,
233or \fIdaemon\fP [default]. If this command-line option is not used,
234then by default messages from \fBsmartd\fP are logged to the facility
235\fIdaemon\fP.
236
237If you would like to have \fBsmartd\fP messages logged somewhere other
e9583e0c
GI
238than the default location, this can typically be accomplished with
239(for example) the following steps:
832b75ed
GG
240.RS 7
241.IP \fB[1]\fP 4
242Modify the script that starts \fBsmartd\fP to include the \fBsmartd\fP
243command-line argument \'\-l local3\'. This tells \fBsmartd\fP to log its
244messages to facility \fBlocal3\fP.
245.IP \fB[2]\fP 4
246Modify the \fBsyslogd\fP configuration file (typically
247\fB/etc/syslog.conf\fP) by adding a line of the form:
248.nf
249\fBlocal3.* /var/log/smartd.log\fP
250.fi
251This tells \fBsyslogd\fP to log all the messages from facility \fBlocal3\fP to
252the designated file: /var/log/smartd.log.
253.IP \fB[3]\fP 4
254Tell \fBsyslogd\fP to re-read its configuration file, typically by
255sending the \fBsyslogd\fP process a \fBSIGHUP\fP hang-up signal.
256.IP \fB[4]\fP 4
257Start (or restart) the \fBsmartd\fP daemon.
258.RE
259.\" The following two lines are a workaround for a man2html bug. Please leave them.
260.\" They define a non-existent option; useful because man2html can't correctly reset the margins.
261.TP
262.B \&
263For more detailed information, please refer to the man pages for
264\fBsyslog.conf\fP, \fBsyslogd\fP, and \fBsyslog\fP. You may also want
265to modify the log rotation configuration files; see the man pages for
266\fBlogrotate\fP and examine your system\'s /etc/logrotate.conf file.
267
268Cygwin: Support for \fBsyslogd\fP as described above is available starting with Cygwin 1.5.15.
269On older releases or if no local \fBsyslogd\fP is running, the \'\-l\' option has no effect.
270In this case, all \fBsyslog\fP messages are written to Windows event log
271or to file \fBC:/CYGWIN_SYSLOG.TXT\fP if the event log is not available.
272
273Windows: Some \fBsyslog\fP functionality is implemented
274internally in \fBsmartd\fP as follows: If no \'\-l\' option
275(or \'\-l daemon\') is specified, messages are written to Windows
276event log or to file \fB./smartd.log\fP if event log is not available
277(Win9x/ME or access denied). By specifying other values of FACILITY,
278log output is redirected as follows:
279\'\-l local0\' to file \fB./smartd.log\fP,
280\'\-l local1\' to standard output (redirect with \'>\' to any file),
281\'\-l local2\' to standard error,
282\'\-l local[3-7]\': to file \fB./smartd[1-5].log\fP.
283
284When using the event log, the enclosed utility \fBsyslogevt.exe\fP
285should be registered as an event message file to avoid error
286messages from the event viewer. Use \'\fBsyslogevt -r smartd\fP\'
287to register, \'\fBsyslogevt -u smartd\fP\' to unregister and
288\'\fBsyslogevt\fP\' for more help.
a37e7145
GG
289.TP
290.B \-n, \-\-no\-fork
291Do not fork into background; this is useful when executed from modern
292init methods like initng, minit or supervise.
293
294On Cygwin, this allows running \fBsmartd\fP as service via cygrunsrv,
295see NOTES below.
296
297On Windows, this option is not available, use \'\-\-service\' instead.
832b75ed
GG
298.TP
299.B \-p NAME, \-\-pidfile=NAME
300Writes pidfile \fINAME\fP containing the \fBsmartd\fP Process ID
301number (PID). To avoid symlink attacks make sure the directory to
302which pidfile is written is only writable for root. Without this
303option, or if the \-\-debug option is given, no PID file is written on
304startup. If \fBsmartd\fP is killed with a maskable signal then the
305pidfile is removed.
306.TP
307.B \-q WHEN, \-\-quit=WHEN
308Specifies when, if ever, \fBsmartd\fP should exit. The valid
309arguments are to this option are:
310
311.I nodev
312\- Exit if there are no devices to monitor, or if any errors are found
313at startup in the configuration file. This is the default.
314
315.I errors
316\- Exit if there are no devices to monitor, or if any errors are found
317in the configuration file /usr/local/etc/smartd.conf at startup or whenever it
318is reloaded.
319
320.I nodevstartup
321\- Exit if there are no devices to monitor at startup. But continue
322to run if no devices are found whenever the configuration file is
323reloaded.
324
325.I never
326\- Only exit if a fatal error occurs (no remaining system memory,
327invalid command line arguments). In this mode, even if there are no
328devices to monitor, or if the configuration file
329\fB/usr/local/etc/smartd.conf\fP has errors, \fBsmartd\fP will continue to run,
330waiting to load a configuration file listing valid devices.
331
332.I onecheck
333\- Start \fBsmartd\fP in debug mode, then register devices, then check
334device\'s SMART status once, and then exit with zero exit status if all
335of these steps worked correctly.
336
337This last option is intended for \'distribution-writers\' who want to
338create automated scripts to determine whether or not to automatically
339start up \fBsmartd\fP after installing smartmontools. After starting
340\fBsmartd\fP with this command-line option, the distribution\'s install
341scripts should wait a reasonable length of time (say ten seconds). If
342\fBsmartd\fP has not exited with zero status by that time, the script
343should send \fBsmartd\fP a SIGTERM or SIGKILL and assume that
344\fBsmartd\fP will not operate correctly on the host. Conversely, if
345\fBsmartd\fP exits with zero status, then it is safe to run
346\fBsmartd\fP in normal daemon mode. If \fBsmartd\fP is unable to
347monitor any devices or encounters other problems then it will return
348with non-zero exit status.
349
350.I showtests
351\- Start \fBsmartd\fP in debug mode, then register devices, then write
352a list of future scheduled self tests to stdout, and then exit with zero
353exit status if all of these steps worked correctly.
354Device's SMART status is not checked.
355
356This option is intended to test whether the '-s REGEX' directives in
357smartd.conf will have the desired effect. The output lists the next test
358schedules, limited to 5 tests per type and device. This is followed by a
359summary of all tests of each device within the next 90 days.
360.TP
361.B \-r TYPE, \-\-report=TYPE
362Intended primarily to help
363.B smartmontools
364developers understand the behavior of
365.B smartmontools
366on non-conforming or poorly-conforming hardware. This option reports
367details of
368\fBsmartd\fP
369transactions with the device. The option can be used multiple times.
370When used just once, it shows a record of the ioctl() transactions
371with the device. When used more than once, the detail of these ioctl()
372transactions are reported in greater detail. The valid arguments to
373this option are:
374
375.I ioctl
376\- report all ioctl() transactions.
377
378.I ataioctl
379\- report only ioctl() transactions with ATA devices.
380
381.I scsiioctl
382\- report only ioctl() transactions with SCSI devices.
383
384Any argument may include a positive integer to specify the level of
385detail that should be reported. The argument should be followed by a
386comma then the integer with no spaces. For example, \fIataioctl,2\fP
387The default level is 1, so \'\-r ataioctl,1\' and \'\-r ataioctl\' are
388equivalent.
2127e193
GI
389.TP
390.B \-s PREFIX, \-\-savestates=PREFIX
cfbba5b9 391[ATA only] Reads/writes \fBsmartd\fP state information from/to files
2127e193
GI
392\'PREFIX\'\'MODEL\-SERIAL.ata.state\'. This preserves SMART attributes, drive
393min and max temperatures (\-W directive), info about last sent warning email
394(\-m directive), and the time of next check of the self-test REGEXP
395(\-s directive) across boot cycles.
396
397.\" BEGIN ENABLE_SAVESTATES
398If this option is not specified, state information is maintained in files
399\'/usr/local/var/lib/smartmontools/smartd.MODEL\-SERIAL.ata.state\'.
400To disable state files, specify this option with an empty string
401argument: \'-s ""\'.
402.\" END ENABLE_SAVESTATES
403MODEL and SERIAL are build from drive identify information, invalid
404characters are replaced by underline.
405
406If the PREFIX has the form \'/path/dir/\' (e.g. \'/var/lib/smartd/\'), then
407files \'MODEL\-SERIAL.ata.state\' are created in directory \'/path/dir\'.
408If the PREFIX has the form \'/path/name\' (e.g. \'/var/lib/misc/smartd\-\'),
409then files 'nameMODEL\-SERIAL.ata.state' are created in directory '/path/'.
410The path must be absolute, except if debug mode is enabled.
411
412The state information files are read on smartd startup. The files are
413always (re)written after reading the configuration file, before rereading
414the configuration file (SIGHUP), before smartd shutdown, and after a check
415forced by SIGUSR1. After a normal check cycle, a file is only rewritten if
416an important change (which usually results in a SYSLOG output) occurred.
832b75ed
GG
417.TP
418.B \-\-service
419Cygwin and Windows only: Enables \fBsmartd\fP to run as a Windows service.
420
a37e7145
GG
421On Cygwin, this option is kept for backward compatibility only.
422It has the same effect as \'\-n, \-\-no\-fork\', see above.
832b75ed
GG
423
424On Windows, this option enables the buildin service support.
425The option must be specified in the service command line as the first
426argument. It should not be used from console.
427See NOTES below for details.
832b75ed
GG
428.TP
429.B \-V, \-\-version, \-\-license, \-\-copyright
2127e193
GI
430Prints version, copyright, license, home page and SVN revision
431information for your copy of \fBsmartd\fP to STDOUT and then exits.
432Please include this information if you are reporting bugs or problems.
832b75ed
GG
433
434.SH EXAMPLES
435
436.B
437smartd
438.fi
439Runs the daemon in forked mode. This is the normal way to run
440\fBsmartd\fP.
e9583e0c 441Entries are logged to SYSLOG.
832b75ed
GG
442
443.B
444smartd -d -i 30
445.fi
446Run in foreground (debug) mode, checking the disk status
447every 30 seconds.
448
449.B
450smartd -q onecheck
451.fi
452Registers devices, and checks the status of the devices exactly
453once. The exit status (the bash
454.B $?
455variable) will be zero if all went well, and nonzero if no devices
456were detected or some other problem was encountered.
457
458.fi
459Note that \fBsmartmontools\fP provides a start-up script in
460\fB/usr/local/etc/rc.d/init.d/smartd\fP which is responsible for starting and
461stopping the daemon via the normal init interface. Using this script,
462you can start \fBsmartd\fP by giving the command:
463.nf
464.B /usr/local/etc/rc.d/init.d/smartd start
465.fi
466and stop it by using the command:
467.nf
468.B /usr/local/etc/rc.d/init.d/smartd stop
832b75ed
GG
469.fi
470
471.\" DO NOT MODIFY THIS OR THE FOLLOWING TWO LINES. THIS MATERIAL
472.\" IS AUTOMATICALLY INCLUDED IN THE FILE smartd.conf.5
473.\" STARTINCLUDE
474
475.SH CONFIGURATION FILE /usr/local/etc/smartd.conf
476In the absence of a configuration file, under Linux
477\fBsmartd\fP
478will try to open the 20 ATA devices
479.B /dev/hd[a-t]
480and the 26 SCSI devices
481.B /dev/sd[a-z].
482Under FreeBSD,
483\fBsmartd\fP
484will try to open all existing ATA devices (with entries in /dev)
485.B /dev/ad[0-9]+
eb07ddf2 486and all existing SCSI devices (using CAM subsystem).
832b75ed
GG
487Under NetBSD/OpenBSD,
488\fBsmartd\fP
489will try to open all existing ATA devices (with entries in /dev)
490.B /dev/wd[0-9]+c
491and all existing SCSI devices
492.B /dev/sd[0-9]+c.
493Under Solaris \fBsmartd\fP will try to open all entries \fB"/dev/rdsk/c?t?d?s?"\fP for IDE/ATA and SCSI disk
494devices, and entries \fB"/dev/rmt/*"\fP for SCSI tape devices.
495Under Windows \fBsmartd\fP will try to open all entries \fB"/dev/hd[a-j]"\fP ("\\\\.\\PhysicalDrive[0-9]")
496for IDE/ATA devices on WinNT4/2000/XP, \fB"/dev/hd[a-d]"\fP
497(bitmask from "\\\\.\\SMARTVSD") for IDE/ATA devices on Win95/98/98SE/ME,
498and \fB"/dev/scsi[0-9][0-7]"\fP (ASPI adapter 0-9, ID 0-7) for SCSI
499devices on all versions of Windows.
500Under Darwin, \fBsmartd\fP will open any ATA block storage device.
501
502This can be annoying if you have an ATA or SCSI device that hangs or
503misbehaves when receiving SMART commands. Even if this causes no
504problems, you may be annoyed by the string of error log messages about
505block-major devices that can\'t be found, and SCSI devices that can\'t
506be opened.
507
508One can avoid this problem, and gain more control over the types of
509events monitored by
510\fBsmartd\fP,
511by using the configuration file
512.B /usr/local/etc/smartd.conf.
513This file contains a list of devices to monitor, with one device per
514line. An example file is included with the
515.B smartmontools
516distribution. You will find this sample configuration file in
e9583e0c 517\fB/usr/local/share/doc/smartmontools/\fP. For security, the configuration file
832b75ed
GG
518should not be writable by anyone but root. The syntax of the file is as
519follows:
520.IP \(bu 4
521There should be one device listed per line, although you may have
522lines that are entirely comments or white space.
523.IP \(bu 4
524Any text following a hash sign \'#\' and up to the end of the line is
525taken to be a comment, and ignored.
526.IP \(bu 4
527Lines may be continued by using a backslash \'\e\' as the last
528non-whitespace or non-comment item on a line.
529.IP \(bu 4
530Note: a line whose first character is a hash sign \'#\' is treated as
531a white-space blank line, \fBnot\fP as a non-existent line, and will
532\fBend\fP a continuation line.
533.PP 0
534.fi
535Here is an example configuration file. It\'s for illustrative purposes
536only; please don\'t copy it onto your system without reading to the end
537of the
538.B DIRECTIVES
539Section below!
540
541.nf
542.B ################################################
543.B # This is an example smartd startup config file
544.B # /usr/local/etc/smartd.conf for monitoring three
545.B # ATA disks, three SCSI disks, six ATA disks
4d59bff9 546.B # behind two 3ware controllers, three SATA disks
2127e193
GI
547.B # directly connected to the HighPoint Rocket-
548.B # RAID controller, two SATA disks connected to
549.B # the HighPoint RocketRAID controller via a pmport
550.B # device, four SATA disks connected to an Areca
551.B # RAID controller, and one SATA disk.
832b75ed
GG
552.B #
553.nf
554.B # First ATA disk on two different interfaces. On
555.B # the second disk, start a long self-test every
556.B # Sunday between 3 and 4 am.
557.B #
558.B \ \ /dev/hda -a -m admin@example.com,root@localhost
559.B \ \ /dev/hdc -a -I 194 -I 5 -i 12 -s L/../../7/03
560.B #
561.nf
562.B # SCSI disks. Send a TEST warning email to admin on
563.B # startup.
564.B #
565.B \ \ /dev/sda
566.B \ \ /dev/sdb -m admin@example.com -M test
567.B #
568.nf
569.B # Strange device. It\'s SCSI. Start a scheduled
570.B # long self test between 5 and 6 am Monday/Thursday
571.B \ \ /dev/weird -d scsi -s L/../../(1|4)/05
572.B #
573.nf
9ebc753d
GG
574.B # An ATA disk may appear as a SCSI device to the
575.B # OS. If a SCSI to ATA Translation (SAT) layer
576.B # is between the OS and the device then this can be
577.B # flagged with the '-d sat' option. This situation
578.B # may become common with SATA disks in SAS and FC
579.B # environments.
580.B \ \ /dev/sda -a -d sat
832b75ed
GG
581.B #
582.nf
2127e193
GI
583.B # Three disks connected to a MegaRAID controller
584.B # Start short self-tests daily between 1-2, 2-3, and
585.B # 3-4 am.
586.B \ \ /dev/sda -d megaraid,0 -a -s S/../.././01
587.B \ \ /dev/sda -d megaraid,1 -a -s S/../.././02
588.B \ \ /dev/sda -d megaraid,2 -a -s S/../.././03
589.B
590.B #
591.nf
832b75ed
GG
592.B # Four ATA disks on a 3ware 6/7/8000 controller.
593.B # Start short self-tests daily between midnight and 1am,
594.B # 1-2, 2-3, and 3-4 am. Starting with the Linux 2.6
595.B # kernel series, /dev/sdX is deprecated in favor of
596.B # /dev/tweN. For example replace /dev/sdc by /dev/twe0
597.B # and /dev/sdd by /dev/twe1.
598.B \ \ /dev/sdc -d 3ware,0 -a -s S/../.././00
599.B \ \ /dev/sdc -d 3ware,1 -a -s S/../.././01
600.B \ \ /dev/sdd -d 3ware,2 -a -s S/../.././02
601.B \ \ /dev/sdd -d 3ware,3 -a -s S/../.././03
602.B #
603.nf
604.B # Two ATA disks on a 3ware 9000 controller.
cfbba5b9 605.B # Start long self-tests Sundays between midnight and
832b75ed
GG
606.B # 1am and 2-3 am
607.B \ \ /dev/twa0 -d 3ware,0 -a -s L/../../7/00
608.B \ \ /dev/twa0 -d 3ware,1 -a -s L/../../7/02
609.B #
610.nf
cfbba5b9
GI
611.B # Two SATA (not SAS) disks on a 3ware 9750 controller.
612.B # Start long self-tests Sundays between midnight and
613.B # 1am and 2-3 am
614.B \ \ /dev/twl0 -d 3ware,0 -a -s L/../../7/00
615.B \ \ /dev/twl0 -d 3ware,1 -a -s L/../../7/02
616.B #
617.nf
2127e193 618.B # Three SATA disks on a HighPoint RocketRAID controller.
4d59bff9
GG
619.B # Start short self-tests daily between 1-2, 2-3, and
620.B # 3-4 am.
2127e193 621.B # under Linux
4d59bff9
GG
622.B \ \ /dev/sde -d hpt,1/1 -a -s S/../.././01
623.B \ \ /dev/sde -d hpt,1/2 -a -s S/../.././02
624.B \ \ /dev/sde -d hpt,1/3 -a -s S/../.././03
2127e193
GI
625.B # or under FreeBSD
626.B # /dev/hptrr -d hpt,1/1 -a -s S/../.././01
627.B # /dev/hptrr -d hpt,1/2 -a -s S/../.././02
628.B # /dev/hptrr -d hpt,1/3 -a -s S/../.././03
4d59bff9
GG
629.B #
630.nf
2127e193 631.B # Two SATA disks connected to a HighPoint RocketRAID
4d59bff9 632.B # via a pmport device. Start long self-tests Sundays
9ebc753d 633.B # between midnight and 1am and 2-3 am.
2127e193 634.B # under Linux
4d59bff9
GG
635.B \ \ /dev/sde -d hpt,1/4/1 -a -s L/../../7/00
636.B \ \ /dev/sde -d hpt,1/4/2 -a -s L/../../7/02
2127e193
GI
637.B # or under FreeBSD
638.B # /dev/hptrr -d hpt,1/4/1 -a -s L/../../7/00
639.B # /dev/hptrr -d hpt,1/4/2 -a -s L/../../7/02
640.B #
641.nf
642.B # Three SATA disks connected to an Areca
643.B # RAID controller. Start long self-tests Sundays
644.B # between midnight and 3 am.
645.B \ \ /dev/sg2 -d areca,1 -a -s L/../../7/00
646.B \ \ /dev/sg2 -d areca,2 -a -s L/../../7/01
647.B \ \ /dev/sg2 -d areca,3 -a -s L/../../7/02
4d59bff9
GG
648.B #
649.nf
832b75ed
GG
650.B # The following line enables monitoring of the
651.B # ATA Error Log and the Self-Test Error Log.
652.B # It also tracks changes in both Prefailure
653.B # and Usage Attributes, apart from Attributes
654.B # 9, 194, and 231, and shows continued lines:
655.B #
656.B \ \ /dev/hdd\ -l\ error\ \e
657.B \ \ \ \ \ \ \ \ \ \ \ -l\ selftest\ \e
658.B \ \ \ \ \ \ \ \ \ \ \ -t\ \e\ \ \ \ \ \ # Attributes not tracked:
659.B \ \ \ \ \ \ \ \ \ \ \ -I\ 194\ \e\ \ # temperature
660.B \ \ \ \ \ \ \ \ \ \ \ -I\ 231\ \e\ \ # also temperature
661.B \ \ \ \ \ \ \ \ \ \ \ -I 9\ \ \ \ \ \ # power-on hours
662.B #
663.B ################################################
664.fi
665
666.PP
667.SH CONFIGURATION FILE DIRECTIVES
668.PP
669
7f0798ef 670If a non-comment entry in the configuration file is the text string
832b75ed
GG
671.B DEVICESCAN
672in capital letters, then
673\fBsmartd\fP
674will ignore any remaining lines in the configuration file, and will
675scan for devices.
676.B DEVICESCAN
677may optionally be followed by Directives that will apply to all
678devices that are found in the scan. Please see below for additional
679details.
680
681.sp 2
682The following are the Directives that may appear following the device
683name or
684.B DEVICESCAN
685on any line of the
686.B /usr/local/etc/smartd.conf
687configuration file. Note that
688.B these are NOT command-line options for
689\fBsmartd\fP.
690The Directives below may appear in any order, following the device
691name.
692
693.B For an ATA device,
694if no Directives appear, then the device will be monitored
695as if the \'\-a\' Directive (monitor all SMART properties) had been given.
696
697.B If a SCSI disk is listed,
698it will be monitored at the maximum implemented level: roughly
699equivalent to using the \'\-H \-l selftest\' options for an ATA disk.
700So with the exception of \'\-d\', \'\-m\', \'\-l selftest\', \'\-s\', and
701\'\-M\', the Directives below are ignored for SCSI disks. For SCSI
702disks, the \'\-m\' Directive sends a warning email if the SMART status
703indicates a disk failure or problem, if the SCSI inquiry about disk
704status fails, or if new errors appear in the self-test log.
705
706.B If a 3ware controller is used
cfbba5b9
GI
707then the corresponding SCSI (/dev/sd?) or character device (/dev/twe?,
708/dev/twa? or /dev/twl?) must be listed, along with the \'\-d 3ware,N\'
709Directive (see below). The individual ATA disks hosted by the 3ware
710controller appear to \fBsmartd\fP as normal ATA devices. Hence all
711the ATA directives can be used for these disks (but see note below).
832b75ed 712
2127e193
GI
713.B If an Areca controller is used
714then the corresponding SCSI generic device (/dev/sg?) must be listed,
715along with the \'\-d areca,N\' Directive (see below). The individual
716SATA disks hosted by the Areca controller appear to \fBsmartd\fP as
717normal ATA devices. Hence all the ATA directives can be used for
718these disks. Areca firmware version 1.46 or later which supports
bed94269
GI
719smartmontools must be used; Please see the \fBsmartctl\fP(8) man page
720for further details.
832b75ed
GG
721.TP
722.B \-d TYPE
cfbba5b9
GI
723Specifies the type of the device.
724The valid arguments to this directive are:
832b75ed 725
cfbba5b9
GI
726.I auto
727- attempt to guess the device type from the device name or from
728controller type info provided by the operating system or from
729a matching USB ID entry in the drive database.
730This is the default.
832b75ed
GG
731
732.I ata
733\- the device type is ATA. This prevents
734\fBsmartd\fP
735from issuing SCSI commands to an ATA device.
736
737.I scsi
738\- the device type is SCSI. This prevents
739\fBsmartd\fP
740from issuing ATA commands to a SCSI device.
741
4d59bff9
GG
742.I sat
743\- the device type is SCSI to ATA Translation (SAT).
cfbba5b9
GI
744This is for ATA disks that have a SCSI to ATA Translation (SAT) Layer
745(SATL) between the disk and the operating system.
746SAT defines two ATA PASS THROUGH SCSI commands, one 12 bytes long and
747the other 16 bytes long. The default is the 16 byte variant which can be
748overridden with either \'\-d sat,12\' or \'\-d sat,16\'.
749
750.I usbcypress
751\- this device type is for ATA disks that are behind a Cypress USB to PATA
752bridge. This will use the ATACB proprietary scsi pass through command.
753The default SCSI operation code is 0x24, but although it can be overridden
754with \'\-d usbcypress,0xN\', where N is the scsi operation code,
755you're running the risk of damage to the device or filesystems on it.
756
757.I usbjmicron
758- this device type is for SATA disks that are behind a JMicron USB to
759PATA/SATA bridge. The 48-bit ATA commands (required e.g. for \'\-l xerror\',
760see below) do not work with all of these bridges and are therefore disabled by
761default. These commands can be enabled by \'\-d usbjmicron,x\'.
762If two disks are connected to a bridge with two ports, an error message is printed
763if no PORT is specified.
764The port can be specified by \'\-d usbjmicron[,x],PORT\' where PORT is 0
765(master) or 1 (slave). This is not necessary if the device uses a port
766multiplier to connect multiple disks to one port. The disks appear under
767separate /dev/ice names then.
768CAUTION: Specifying \',x\' for a device which does not support it results
769in I/O errors and may disconnect the drive. The same applies if the specified
770PORT does not exist or is not connected to a disk.
771
772.I usbsunplus
773\- this device type is for SATA disks that are behind a SunplusIT USB to SATA
774bridge.
4d59bff9 775
832b75ed 776.I marvell
cfbba5b9 777\- [Linux only] interact with SATA disks behind Marvell chip-set
832b75ed
GG
778controllers (using the Marvell rather than libata driver).
779
2127e193 780.I megaraid,N
cfbba5b9
GI
781\- [Linux only] the device consists of one or more SCSI/SAS disks connected
782to a MegaRAID controller. The non-negative integer N (in the range of 0 to
783127 inclusive) denotes which disk on the controller is monitored.
784This interface will also work for Dell PERC controllers.
2127e193
GI
785In log files and email messages this disk will be identified as
786megaraid_disk_XXX with XXX in the range from 000 to 127 inclusive.
cfbba5b9 787Please see the \fBsmartctl\fP(8) man page for further details.
2127e193 788
832b75ed 789.I 3ware,N
cfbba5b9
GI
790\- [FreeBSD and Linux only] the device consists of one or more ATA disks
791connected to a 3ware RAID controller. The non-negative integer N
792(in the range from 0 to 127 inclusive) denotes which disk on the controller
793is monitored.
794In log files and email messages this disk will be identified as 3ware_disk_XXX
2127e193 795with XXX in the range from 000 to 127 inclusive.
832b75ed 796
cfbba5b9
GI
797Note that while you may use \fBany\fP of the 3ware SCSI logical devices /dev/tw*
798to address \fBany\fP of the physical disks (3ware ports), error and log
832b75ed 799messages will make the most sense if you always list the 3ware SCSI
cfbba5b9
GI
800logical device corresponding to the particular physical disks.
801Please see the \fBsmartctl\fP(8) man page for further details.
832b75ed 802
2127e193 803.I areca,N
cfbba5b9
GI
804\- [Linux only] the device consists of one or more SATA disks connected to an
805Areca SATA RAID controller. The positive integer N (in the range from 1 to
80624 inclusive) denotes which disk on the controller is monitored.
807In log files and email messages this disk will be identifed as
2127e193 808areca_disk_XX with XX in the range from 01 to 24 inclusive.
cfbba5b9 809Please see the \fBsmartctl\fP(8) man page for further details.
2127e193 810
ba59cff1 811.I cciss,N
cfbba5b9
GI
812\- [FreeBSD and Linux only] the device consists of one or more SCSI/SAS disks
813connected to a cciss RAID controller. The non-negative integer N (in the range
814from 0 to 15 inclusive) denotes which disk on the controller is monitored.
815In log files and email messages this disk will be identified as cciss_disk_XX
ba59cff1 816with XX in the range from 00 to 15 inclusive.
cfbba5b9 817Please see the \fBsmartctl\fP(8) man page for further details.
832b75ed 818
4d59bff9 819.I hpt,L/M/N
cfbba5b9
GI
820\- [FreeBSD and Linux only] the device consists of one or more ATA disks
821connected to a HighPoint RocketRAID controller. The integer L is the
822controller id, the integer M is the channel number, and the integer N
823is the PMPort number if it is available. The allowed values of L are
824from 1 to 4 inclusive, M are from 1 to 8 inclusive and N from 1 to 4
825if PMPort available. And also these values are limited by the model
826of the HighPoint RocketRAID controller.
4d59bff9
GG
827In log files and email messages this disk will be identified as
828hpt_X/X/X and X/X/X is the same as L/M/N, note if no N indicated, N set
829to the default value 1.
cfbba5b9 830Please see the \fBsmartctl\fP(8) man page for further details.
4d59bff9 831
832b75ed
GG
832.I removable
833\- the device or its media is removable. This indicates to
834\fBsmartd\fP
835that it should continue (instead of exiting, which is the default
836behavior) if the device does not appear to be present when
837\fBsmartd\fP is started. This Directive may be used in conjunction
838with the other \'\-d\' Directives.
832b75ed 839.TP
2127e193 840.B \-n POWERMODE[,N][,q]
cfbba5b9
GI
841[ATA only] This \'nocheck\' Directive is used to prevent a disk from
842being spun-up when it is periodically polled by \fBsmartd\fP.
832b75ed
GG
843
844ATA disks have five different power states. In order of increasing
845power consumption they are: \'OFF\', \'SLEEP\', \'STANDBY\', \'IDLE\',
846and \'ACTIVE\'. Typically in the OFF, SLEEP, and STANDBY modes the
847disk\'s platters are not spinning. But usually, in response to SMART
848commands issued by \fBsmartd\fP, the disk platters are spun up. So if
849this option is not used, then a disk which is in a low\-power mode may
850be spun up and put into a higher\-power mode when it is periodically
851polled by \fBsmartd\fP.
852
853Note that if the disk is in SLEEP mode when \fBsmartd\fP is started,
854then it won't respond to \fBsmartd\fP commands, and so the disk won't
855be registered as a device for \fBsmartd\fP to monitor. If a disk is in
856any other low\-power mode, then the commands issued by \fBsmartd\fP to
857register the disk will probably cause it to spin\-up.
858
859The \'\fB\-n\fP\' (nocheck) Directive specifies if \fBsmartd\fP\'s
860periodic checks should still be carried out when the device is in a
861low\-power mode. It may be used to prevent a disk from being spun\-up
862by periodic \fBsmartd\fP polling. The allowed values of POWERMODE
863are:
864
865.I never
866\- \fBsmartd\fP will poll (check) the device regardless of its power
867mode. This may cause a disk which is spun\-down to be spun\-up when
868\fBsmartd\fP checks it. This is the default behavior if the '\-n'
869Directive is not given.
870
871.I sleep
872\- check the device unless it is in SLEEP mode.
873
874.I standby
875\- check the device unless it is in SLEEP or STANDBY mode. In
876these modes most disks are not spinning, so if you want to prevent
877a laptop disk from spinning up each time that \fBsmartd\fP polls,
878this is probably what you want.
879
880.I idle
881\- check the device unless it is in SLEEP, STANDBY or IDLE mode.
882In the IDLE state, most disks are still spinning, so this is probably
883not what you want.
884
2127e193
GI
885Maximum number of skipped checks (in a row) can be specified by
886appending positive number \',N\' to POWERMODE (like \'\-n standby,15\').
887After N checks are skipped in a row, powermode is ignored and the
888check is performed anyway.
4d59bff9 889
832b75ed
GG
890When a periodic test is skipped, \fBsmartd\fP normally writes an
891informal log message. The message can be suppressed by appending
892the option \',q\' to POWERMODE (like \'\-n standby,q\').
893This prevents a laptop disk from spinning up due to this message.
894
2127e193 895Both \',N\' and \',q\' can be specified together.
832b75ed
GG
896.TP
897.B \-T TYPE
898Specifies how tolerant
899\fBsmartd\fP
900should be of SMART command failures. The valid arguments to this
901Directive are:
902
903.I normal
904\- do not try to monitor the disk if a mandatory SMART command fails, but
905continue if an optional SMART command fails. This is the default.
906
907.I permissive
908\- try to monitor the disk even if it appears to lack SMART
909capabilities. This may be required for some old disks (prior to
910ATA\-3 revision 4) that implemented SMART before the SMART standards
911were incorporated into the ATA/ATAPI Specifications. This may also be
912needed for some Maxtor disks which fail to comply with the ATA
913Specifications and don't properly indicate support for error\- or
914self\-test logging.
915
916[Please see the \fBsmartctl \-T\fP command-line option.]
917.TP
918.B \-o VALUE
cfbba5b9 919[ATA only] Enables or disables SMART Automatic Offline Testing when
832b75ed
GG
920\fBsmartd\fP
921starts up and has no further effect. The valid arguments to this
922Directive are \fIon\fP and \fIoff\fP.
923
924The delay between tests is vendor-specific, but is typically four
925hours.
926
927Note that SMART Automatic Offline Testing is \fBnot\fP part of the ATA
928Specification. Please see the
929.B smartctl \-o
930command-line option documentation for further information about this
931feature.
932.TP
933.B \-S VALUE
934Enables or disables Attribute Autosave when \fBsmartd\fP
935starts up and has no further effect. The valid arguments to this
936Directive are \fIon\fP and \fIoff\fP. Also affects SCSI devices.
937[Please see the \fBsmartctl \-S\fP command-line option.]
938.TP
939.B \-H
cfbba5b9 940[ATA only] Check the SMART health status of the disk. If any Prefailure
832b75ed
GG
941Attributes are less than or equal to their threshold values, then disk
942failure is predicted in less than 24 hours, and a message at loglevel
e9583e0c 943.B \'LOG_CRIT\'
832b75ed
GG
944will be logged to syslog. [Please see the
945.B smartctl \-H
946command-line option.]
947.TP
948.B \-l TYPE
e9583e0c 949Reports increases in the number of errors in one of three SMART logs. The
832b75ed
GG
950valid arguments to this Directive are:
951
952.I error
cfbba5b9
GI
953\- [ATA only] report if the number of ATA errors reported in the Summary SMART
954error log has increased since the last check.
832b75ed 955
e9583e0c 956.I xerror
cfbba5b9
GI
957\- [ATA only] [NEW EXPERIMENTAL SMARTD FEATURE] report if the number of ATA
958errors reported in the Extended Comprehensive SMART error log has increased
959since the last check.
e9583e0c
GI
960
961If both \'\-l error\' and \'\-l xerror\' are specified, smartd checks
962the maximum of both values.
963
964[Please see the \fBsmartctl \-l xerror\fP command-line option.]
965
832b75ed
GG
966.I selftest
967\- report if the number of failed tests reported in the SMART
968Self-Test Log has increased since the last check, or if the timestamp
969associated with the most recent failed test has increased. Note that
970such errors will \fBonly\fP be logged if you run self-tests on the
971disk (and it fails a test!). Self-Tests can be run automatically by
972\fBsmartd\fP: please see the \fB\'\-s\'\fP Directive below.
973Self-Tests can also be run manually by using the \fB\'\-t\ short\'\fP
974and \fB\'\-t\ long\'\fP options of \fBsmartctl\fP and the results of
975the testing can be observed using the \fBsmartctl \'\-l\ selftest\'\fP
cfbba5b9 976command-line option.
832b75ed
GG
977[Please see the \fBsmartctl \-l\fP and \fB\-t\fP command-line
978options.]
cfbba5b9
GI
979
980[ATA only] Failed self-tests outdated by a newer successful extended
981self\-test are ignored.
982
983.I scterc,READTIME,WRITETIME
984\- [ATA only] [NEW EXPERIMENTAL SMARTD FEATURE] sets the SCT Error
985Recovery Control settings to the specified values (deciseconds)
986when \fBsmartd\fP starts up and has no further effect.
987Values of 0 disable the feature, other values less than 65 are probably
988not supported. For RAID configurations, this is typically set to
98970,70 deciseconds.
990[Please see the \fBsmartctl \-l scterc\fP command-line option.]
991
832b75ed
GG
992.TP
993.B \-s REGEXP
994Run Self-Tests or Offline Immediate Tests, at scheduled times. A
995Self- or Offline Immediate Test will be run at the end of periodic
996device polling, if all 12 characters of the string \fBT/MM/DD/d/HH\fP
997match the extended regular expression \fBREGEXP\fP. Here:
998.RS 7
999.IP \fBT\fP 4
1000is the type of the test. The values that \fBsmartd\fP will try to
1001match (in turn) are: \'L\' for a \fBL\fPong Self-Test, \'S\' for a
1002\fBS\fPhort Self-Test, \'C\' for a \fBC\fPonveyance Self-Test (ATA
1003only), and \'O\' for an \fBO\fPffline Immediate Test (ATA only). As
1004soon as a match is found, the test will be started and no additional
1005matches will be sought for that device and that polling cycle.
2127e193 1006
cfbba5b9
GI
1007To run scheduled Selective Self-Tests, use \'n\' for \fBn\fPext span,
1008\'r\' to \fBr\fPedo last span, or \'c\' to \fBc\fPontinue with next span
1009or redo last span based on status of last test.
1010The LBA range is based on the first span from the last test.
2127e193
GI
1011See the \fBsmartctl \-t select,[next|redo|cont]\fP options for
1012further info.
1013
cfbba5b9
GI
1014[NEW EXPERIMENTAL SMARTD FEATURE] Some disks (e.g. WD) do not preserve
1015the selective self test log accross power cycles. If state persistence
1016(\'\-s\' option) is enabled, the last test span is preserved by smartd
1017and used if (and only if) the selective self test log is empty.
1018
832b75ed
GG
1019.IP \fBMM\fP 4
1020is the month of the year, expressed with two decimal digits. The
1021range is from 01 (January) to 12 (December) inclusive. Do \fBnot\fP
1022use a single decimal digit or the match will always fail!
1023.IP \fBDD\fP 4
1024is the day of the month, expressed with two decimal digits. The
1025range is from 01 to 31 inclusive. Do \fBnot\fP
1026use a single decimal digit or the match will always fail!
1027.IP \fBd\fP 4
1028is the day of the week, expressed with one decimal digit. The
1029range is from 1 (Monday) to 7 (Sunday) inclusive.
1030.IP \fBHH\fP 4
1031is the hour of the day, written with two decimal digits, and given in
1032hours after midnight. The range is 00 (midnight to just before 1am)
1033to 23 (11pm to just before midnight) inclusive. Do \fBnot\fP use a
1034single decimal digit or the match will always fail!
1035.RE
1036.\" The following two lines are a workaround for a man2html bug. Please leave them.
1037.\" They define a non-existent option; useful because man2html can't correctly reset the margins.
1038.TP
1039.B \&
1040Some examples follow. In reading these, keep in mind that in extended
1041regular expressions a dot \fB\'.\'\fP matches any single character, and
1042a parenthetical expression such as \fB\'(A|B|C)\'\fP denotes any one of the three possibilities \fBA\fP,
1043\fBB\fP, or \fBC\fP.
1044
1045To schedule a short Self-Test between 2-3am every morning, use:
1046.nf
1047\fB \-s S/../.././02\fP
1048.fi
1049To schedule a long Self-Test between 4-5am every Sunday morning, use:
1050.nf
1051\fB \-s L/../../7/04\fP
1052.fi
1053To schedule a long Self-Test between 10-11pm on the first and
1054fifteenth day of each month, use:
1055.nf
1056\fB \-s L/../(01|15)/./22\fP
1057.fi
1058To schedule an Offline Immediate test after every midnight, 6am,
1059noon,and 6pm, plus a Short Self-Test daily at 1-2am and a Long
1060Self-Test every Saturday at 3-4am, use:
1061.nf
1062\fB \-s (O/../.././(00|06|12|18)|S/../.././01|L/../../6/03)\fP
1063.fi
2127e193
GI
1064If Long Self-Tests of a large disks take longer than the system uptime,
1065a full disk test can be performed by several Selective Self-Tests.
1066To setup a full test of a 1TB disk within 20 days (one 50GB span
1067each day), run this command once:
1068.nf
1069 smartctl -t select,0-99999999 /dev/sda
1070.fi
1071To run the next test spans on Monday-Friday between 12-13am, run smartd
1072with this directive:
1073.nf
1074\fB \-s n/../../[1-5]/12\fP
1075.fi
1076
832b75ed
GG
1077
1078Scheduled tests are run immediately following the regularly-scheduled
1079device polling, if the current local date, time, and test type, match
1080\fBREGEXP\fP. By default the regularly-scheduled device polling
1081occurs every thirty minutes after starting \fBsmartd\fP. Take caution
1082if you use the \'\-i\' option to make this polling interval more than
1083sixty minutes: the poll times may fail to coincide with any of the
2127e193
GI
1084testing times that you have specified with \fBREGEXP\fP. In this case
1085the test will be run following the next device polling.
832b75ed
GG
1086
1087Before running an offline or self-test, \fBsmartd\fP checks to be sure
1088that a self-test is not already running. If a self-test \fBis\fP
1089already running, then this running self test will \fBnot\fP be
1090interrupted to begin another test.
1091
1092\fBsmartd\fP will not attempt to run \fBany\fP type of test if another
1093test was already started or run in the same hour.
1094
a37e7145
GG
1095To avoid performance problems during system boot, \fBsmartd\fP will
1096not attempt to run any scheduled tests following the very first
1097device polling (unless \'\-q onecheck\' is specified).
1098
832b75ed
GG
1099Each time a test is run, \fBsmartd\fP will log an entry to SYSLOG.
1100You can use these or the '-q showtests' command-line option to verify
1101that you constructed \fBREGEXP\fP correctly. The matching order
1102(\fBL\fP before \fBS\fP before \fBC\fP before \fBO\fP) ensures that
1103if multiple test types are all scheduled for the same hour, the
1104longer test type has precedence. This is usually the desired behavior.
1105
2127e193
GI
1106If the scheduled tests are used in conjunction with state persistence
1107(\'\-s\' option), smartd will also try to match the hours since last
1108shutdown (or 90 days at most). If any test would have been started
1109during downtime, the longest (see above) of these tests is run after
1110second device polling.
1111
1112If the \'\-n\' directive is used and any test would have been started
1113during disk standby time, the longest of these tests is run when the
1114disk is active again.
1115
832b75ed
GG
1116Unix users: please beware that the rules for extended regular
1117expressions [regex(7)] are \fBnot\fP the same as the rules for
1118file\-name pattern matching by the shell [glob(7)]. \fBsmartd\fP will
1119issue harmless informational warning messages if it detects characters
1120in \fBREGEXP\fP that appear to indicate that you have made this
1121mistake.
832b75ed
GG
1122.TP
1123.B \-m ADD
1124Send a warning email to the email address \fBADD\fP if the \'\-H\',
1125\'\-l\', \'\-f\', \'\-C\', or \'\-O\' Directives detect a failure or a
1126new error, or if a SMART command to the disk fails. This Directive
1127only works in conjunction with these other Directives (or with the
1128equivalent default \'\-a\' Directive).
1129
1130To prevent your email in-box from getting filled up with warning
1131messages, by default only a single warning will be sent for each of
1132the enabled alert types, \'\-H\', \'\-l\', \'\-f\', \'\-C\', or
1133\'\-O\' even if more than one failure or error is detected or if the
1134failure or error persists. [This behavior can be modified; see the
1135\'\-M\' Directive below.]
1136
1137To send email to more than one user, please use the following "comma
1138separated" form for the address: \fBuser1@add1,user2@add2,...,userN@addN\fP
1139(with no spaces).
1140
1141To test that email is being sent correctly, use the \'\-M test\'
1142Directive described below to send one test email message on
1143\fBsmartd\fP
1144startup.
1145
1146By default, email is sent using the system
1147.B mail
1148command. In order that
1149\fBsmartd\fP
1150find the mail command (normally /bin/mail) an executable named
1151.B \'mail\'
1152must be in the path of the shell or environment from which
1153\fBsmartd\fP
1154was started. If you wish to specify an explicit path to the mail
1155executable (for example /usr/local/bin/mail) or a custom script to
1156run, please use the \'\-M exec\' Directive below.
1157
1158Note that by default under Solaris, in the previous paragraph,
1159\'\fBmailx\fP\' and \'\fB/bin/mailx\fP\' are used, since Solaris
1160\'/bin/mail\' does not accept a \'\-s\' (Subject) command-line
1161argument.
1162
1163On Windows, the \'\fBBlat\fP\' mailer
1164(\fBhttp://blat.sourceforge.net/\fP) is used by default.
1165This mailer uses a different command line syntax, see
1166\'\-M exec\' below.
1167
1168Note also that there is a special argument
1169.B <nomailer>
1170which can be given to the \'\-m\' Directive in conjunction with the \'\-M
1171exec\' Directive. Please see below for an explanation of its effect.
1172
1173If the mailer or the shell running it produces any STDERR/STDOUT
1174output, then a snippet of that output will be copied to SYSLOG. The
1175remainder of the output is discarded. If problems are encountered in
1176sending mail, this should help you to understand and fix them. If
1177you have mail problems, we recommend running \fBsmartd\fP in debug
1178mode with the \'-d\' flag, using the \'-M test\' Directive described
1179below.
1180
1181The following extension is available on Windows:
1182By specifying \'\fBmsgbox\fP\' as a mail address, a warning
1183"email" is displayed as a message box on the screen.
1184Using both \'\fBmsgbox\fP\' and regular mail addresses is possible,
1185if \'\fBmsgbox\fP\' is the first word in the comma separated list.
1186With \'\fBsysmsgbox\fP\', a system modal (always on top) message box
1187is used. If running as a service, a service notification message box
1188(always shown on current visible desktop) is used.
832b75ed
GG
1189.TP
1190.B \-M TYPE
1191These Directives modify the behavior of the
1192\fBsmartd\fP
1193email warnings enabled with the \'\-m\' email Directive described above.
1194These \'\-M\' Directives only work in conjunction with the \'\-m\'
1195Directive and can not be used without it.
1196
1197Multiple \-M Directives may be given. If more than one of the
1198following three \-M Directives are given (example: \-M once \-M daily)
1199then the final one (in the example, \-M daily) is used.
1200
1201The valid arguments to the \-M Directive are (one of the following
1202three):
1203
1204.I once
1205\- send only one warning email for each type of disk problem detected. This
cfbba5b9 1206is the default unless state persistence (\'\-s\' option) is enabled.
832b75ed
GG
1207
1208.I daily
1209\- send additional warning reminder emails, once per day, for each type
cfbba5b9
GI
1210of disk problem detected. This is the default if state persistence
1211(\'\-s\' option) is enabled.
832b75ed
GG
1212
1213.I diminishing
1214\- send additional warning reminder emails, after a one-day interval,
1215then a two-day interval, then a four-day interval, and so on for each
1216type of disk problem detected. Each interval is twice as long as the
1217previous interval.
1218
1219In addition, one may add zero or more of the following Directives:
1220
1221.I test
1222\- send a single test email
1223immediately upon
1224\fBsmartd\fP
1225startup. This allows one to verify that email is delivered correctly.
9ebc753d
GG
1226Note that if this Directive is used,
1227\fBsmartd\fP
1228will also send the normal email warnings that were enabled with the \'\-m\' Directive,
1229in addition to the single test email!
832b75ed
GG
1230
1231.I exec PATH
1232\- run the executable PATH instead of the default mail command, when
1233\fBsmartd\fP
1234needs to send email. PATH must point to an executable binary file or
1235script.
1236
1237By setting PATH to point to a customized script, you can make
1238\fBsmartd\fP perform useful tricks when a disk problem is detected
1239(beeping the console, shutting down the machine, broadcasting warnings
1240to all logged-in users, etc.) But please be careful. \fBsmartd\fP
1241will \fBblock\fP until the executable PATH returns, so if your
1242executable hangs, then \fBsmartd\fP will also hang. Some sample
1243scripts are included in
e9583e0c 1244/usr/local/share/doc/smartmontools/examplescripts/.
832b75ed
GG
1245
1246The return status of the executable is recorded by \fBsmartd\fP in
1247SYSLOG. The executable is not expected to write to STDOUT or
1248STDERR. If it does, then this is interpreted as indicating that
1249something is going wrong with your executable, and a fragment of this
1250output is logged to SYSLOG to help you to understand the problem.
1251Normally, if you wish to leave some record behind, the executable
1252should send mail or write to a file or device.
1253
1254Before running the executable, \fBsmartd\fP sets a number of
1255environment variables. These environment variables may be used to
1256control the executable\'s behavior. The environment variables
1257exported by \fBsmartd\fP are:
1258.RS 7
1259.IP \fBSMARTD_MAILER\fP 4
1260is set to the argument of \-M exec, if present or else to \'mail\'
1261(examples: /bin/mail, mail).
1262.IP \fBSMARTD_DEVICE\fP 4
1263is set to the device path (examples: /dev/hda, /dev/sdb).
1264.IP \fBSMARTD_DEVICETYPE\fP 4
cfbba5b9
GI
1265is set to the device type specified by \'-d\' directive or
1266\'auto\' if none.
832b75ed
GG
1267.IP \fBSMARTD_DEVICESTRING\fP 4
1268is set to the device description. For SMARTD_DEVICETYPE of ata or
1269scsi, this is the same as SMARTD_DEVICE. For 3ware RAID controllers,
2127e193
GI
1270the form used is \'/dev/sdc [3ware_disk_01]\'. For HighPoint
1271RocketRAID controller, the form is \'/dev/sdd [hpt_1/1/1]\' under Linux
1272or \'/dev/hptrr [hpt_1/1/1]\' under FreeBSD. For Areca controllers, the
1273form is \'/dev/sg2 [areca_disk_09]\'. In these cases the device string
1274contains a space and is NOT quoted. So to use $SMARTD_DEVICESTRING in a
1275bash script you should probably enclose it in double quotes.
832b75ed
GG
1276.IP \fBSMARTD_FAILTYPE\fP 4
1277gives the reason for the warning or message email. The possible values that
1278it takes and their meanings are:
1279.nf
1280.fi
1281\fIEmailTest\fP: this is an email test message.
1282.nf
1283.fi
1284\fIHealth\fP: the SMART health status indicates imminent failure.
1285.nf
1286.fi
1287\fIUsage\fP: a usage Attribute has failed.
1288.nf
1289.fi
1290\fISelfTest\fP: the number of self-test failures has increased.
1291.nf
1292.fi
1293\fIErrorCount\fP: the number of errors in the ATA error log has increased.
1294.nf
1295.fi
1296\fICurrentPendingSector\fP: one of more disk sectors could not be
1297read and are marked to be reallocated (replaced with spare sectors).
1298.nf
1299.fi
1300\fIOfflineUncorrectableSector\fP: during off\-line testing, or self\-testing,
1301one or more disk sectors could not be read.
1302.nf
1303.fi
e9583e0c
GI
1304\fITemperature\fP: Temperature reached critical limit (see \-W directive).
1305.nf
1306.fi
832b75ed
GG
1307\fIFailedHealthCheck\fP: the SMART health status command failed.
1308.nf
1309.fi
1310\fIFailedReadSmartData\fP: the command to read SMART Attribute data failed.
1311.nf
1312.fi
1313\fIFailedReadSmartErrorLog\fP: the command to read the SMART error log failed.
1314.nf
1315.fi
1316\fIFailedReadSmartSelfTestLog\fP: the command to read the SMART self-test log failed.
1317.nf
1318.fi
1319\fIFailedOpenDevice\fP: the open() command to the device failed.
1320.IP \fBSMARTD_ADDRESS\fP 4
1321is determined by the address argument ADD of the \'\-m\' Directive.
1322If ADD is \fB<nomailer>\fP, then \fBSMARTD_ADDRESS\fP is not set.
1323Otherwise, it is set to the comma-separated-list of email addresses
1324given by the argument ADD, with the commas replaced by spaces
1325(example:admin@example.com root). If more than one email address is
1326given, then this string will contain space characters and is NOT
1327quoted, so to use it in a bash script you may want to enclose it in
1328double quotes.
1329.IP \fBSMARTD_MESSAGE\fP 4
1330is set to the one sentence summary warning email message string from
1331\fBsmartd\fP.
1332This message string contains space characters and is NOT quoted. So to
1333use $SMARTD_MESSAGE in a bash script you should probably enclose it in
1334double quotes.
1335.IP \fBSMARTD_FULLMESSAGE\fP 4
1336is set to the contents of the entire email warning message string from
1337\fBsmartd\fP.
1338This message string contains space and return characters and is NOT quoted. So to
1339use $SMARTD_FULLMESSAGE in a bash script you should probably enclose it in
1340double quotes.
1341.IP \fBSMARTD_TFIRST\fP 4
1342is a text string giving the time and date at which the first problem
1343of this type was reported. This text string contains space characters
1344and no newlines, and is NOT quoted. For example:
1345.nf
1346.fi
1347Sun Feb 9 14:58:19 2003 CST
1348.IP \fBSMARTD_TFIRSTEPOCH\fP 4
1349is an integer, which is the unix epoch (number of seconds since Jan 1,
13501970) for \fBSMARTD_TFIRST\fP.
1351.RE
1352.\" The following two lines are a workaround for a man2html bug. Please leave them.
1353.\" They define a non-existent option; useful because man2html can't correctly reset the margins.
1354.TP
1355.B \&
1356The shell which is used to run PATH is system-dependent. For vanilla
1357Linux/glibc it\'s bash. For other systems, the man page for
1358\fBpopen\fP(3) should say what shell is used.
1359
1360If the \'\-m ADD\' Directive is given with a normal address argument,
1361then the executable pointed to by PATH will be run in a shell with
1362STDIN receiving the body of the email message, and with the same
1363command-line arguments:
1364.nf
1365-s "$SMARTD_SUBJECT" $SMARTD_ADDRESS
1366.fi
1367that would normally be provided to \'mail\'. Examples include:
1368.nf
1369.B -m user@home -M exec /bin/mail
1370.B -m admin@work -M exec /usr/local/bin/mailto
1371.B -m root -M exec /Example_1/bash/script/below
1372.fi
1373
1374Note that on Windows, the syntax of the \'\fBBlat\fP\' mailer is
1375used:
1376.nf
1377- -q -subject "$SMARTD_SUBJECT" -to "$SMARTD_ADDRESS"
1378.fi
1379
1380If the \'\-m ADD\' Directive is given with the special address argument
1381.B <nomailer>
1382then the executable pointed to by PATH is run in a shell with
1383.B no
1384STDIN and
1385.B no
1386command-line arguments, for example:
1387.nf
1388.B -m <nomailer> -M exec /Example_2/bash/script/below
1389.fi
1390If the executable produces any STDERR/STDOUT output, then \fBsmartd\fP
1391assumes that something is going wrong, and a snippet of that output
1392will be copied to SYSLOG. The remainder of the output is then
1393discarded.
1394
1395Some EXAMPLES of scripts that can be used with the \'\-M exec\'
1396Directive are given below. Some sample scripts are also included in
e9583e0c 1397/usr/local/share/doc/smartmontools/examplescripts/.
832b75ed
GG
1398.TP
1399.B \-f
cfbba5b9
GI
1400[ATA only] Check for \'failure\' of any Usage Attributes. If these
1401Attributes are less than or equal to the threshold, it does NOT indicate
1402imminent disk failure. It "indicates an advisory condition where the usage
1403or age of the device has exceeded its intended design life period."
832b75ed
GG
1404[Please see the \fBsmartctl \-A\fP command-line option.]
1405.TP
1406.B \-p
cfbba5b9 1407[ATA only] Report anytime that a Prefail Attribute has changed
832b75ed
GG
1408its value since the last check, 30 minutes ago. [Please see the
1409.B smartctl \-A
1410command-line option.]
1411.TP
1412.B \-u
cfbba5b9 1413[ATA only] Report anytime that a Usage Attribute has changed its value
832b75ed
GG
1414since the last check, 30 minutes ago. [Please see the
1415.B smartctl \-A
1416command-line option.]
1417.TP
1418.B \-t
cfbba5b9 1419[ATA only] Equivalent to turning on the two previous flags \'\-p\' and \'\-u\'.
832b75ed
GG
1420Tracks changes in \fIall\fP device Attributes (both Prefailure and
1421Usage). [Please see the \fBsmartctl\fP \-A command-line option.]
1422.TP
1423.B \-i ID
cfbba5b9
GI
1424[ATA only] Ignore device Attribute number \fBID\fP when checking for failure
1425of Usage Attributes. \fBID\fP must be a decimal integer in the range
832b75ed
GG
1426from 1 to 255. This Directive modifies the behavior of the \'\-f\'
1427Directive and has no effect without it.
1428
1429This is useful, for example, if you have a very old disk and don\'t
1430want to keep getting messages about the hours-on-lifetime Attribute
1431(usually Attribute 9) failing. This Directive may appear multiple
1432times for a single device, if you want to ignore multiple Attributes.
1433.TP
1434.B \-I ID
cfbba5b9 1435[ATA only] Ignore device Attribute \fBID\fP when tracking changes in the
832b75ed
GG
1436Attribute values. \fBID\fP must be a decimal integer in the range
1437from 1 to 255. This Directive modifies the behavior of the \'\-p\',
1438\'\-u\', and \'\-t\' tracking Directives and has no effect without one
1439of them.
1440
1441This is useful, for example, if one of the device Attributes is the disk
1442temperature (usually Attribute 194 or 231). It\'s annoying to get reports
1443each time the temperature changes. This Directive may appear multiple
1444times for a single device, if you want to ignore multiple Attributes.
1445.TP
2127e193 1446.B \-r ID[!]
cfbba5b9
GI
1447[ATA only] When tracking, report the \fIRaw\fP value of Attribute \fBID\fP
1448along with its (normally reported) \fINormalized\fP value. \fBID\fP must
1449be a decimal integer in the range from 1 to 255. This Directive modifies
832b75ed
GG
1450the behavior of the \'\-p\', \'\-u\', and \'\-t\' tracking Directives
1451and has no effect without one of them. This Directive may be given
1452multiple times.
1453
1454A common use of this Directive is to track the device Temperature
1455(often ID=194 or 231).
1456
2127e193
GI
1457If the optional flag \'!\' is appended, a change of the Normalized
1458value is considered critical. The report will be logged as LOG_CRIT
1459and a warning email will be sent if \'-m\' is specified.
832b75ed 1460.TP
2127e193 1461.B \-R ID[!]
cfbba5b9 1462[ATA only] When tracking, report whenever the \fIRaw\fP value of Attribute
832b75ed
GG
1463\fBID\fP changes. (Normally \fBsmartd\fP only tracks/reports changes
1464of the \fINormalized\fP Attribute values.) \fBID\fP must be a decimal
1465integer in the range from 1 to 255. This Directive modifies the
1466behavior of the \'\-p\', \'\-u\', and \'\-t\' tracking Directives and
1467has no effect without one of them. This Directive may be given
1468multiple times.
1469
1470If this Directive is given, it automatically implies the \'\-r\'
1471Directive for the same Attribute, so that the Raw value of the
1472Attribute is reported.
1473
1474A common use of this Directive is to track the device Temperature
1475(often ID=194 or 231). It is also useful for understanding how
1476different types of system behavior affects the values of certain
1477Attributes.
1478
2127e193
GI
1479If the optional flag \'!\' is appended, a change of the Raw
1480value is considered critical. The report will be logged as
1481LOG_CRIT and a warning email will be sent if \'-m\' is specified.
1482An example is \'-R 5!\' to warn when new sectors are reallocated.
832b75ed 1483.TP
2127e193 1484.B \-C ID[+]
832b75ed
GG
1485[ATA only] Report if the current number of pending sectors is
1486non-zero. Here \fBID\fP is the id number of the Attribute whose raw
1487value is the Current Pending Sector count. The allowed range of
1488\fBID\fP is 0 to 255 inclusive. To turn off this reporting, use
1489ID\ =\ 0. If the \fB\-C ID\fP option is not given, then it defaults to
1490\fB\-C 197\fP (since Attribute 197 is generally used to monitor
e9583e0c
GI
1491pending sectors). If the name of this Attribute is changed by a
1492\'\-v 197,FORMAT,NAME\' directive, the default is changed to
1493\fB\-C 0\fP.
832b75ed 1494
2127e193
GI
1495If \'+\' is specified, a report is only printed if the number of sectors
1496has increased between two check cycles. Some disks do not reset this
1497attribute when a bad sector is reallocated.
1498See also \'\-v 197,increasing\' below.
1499
832b75ed
GG
1500A pending sector is a disk sector (containing 512 bytes of your data)
1501which the device would like to mark as ``bad" and reallocate.
1502Typically this is because your computer tried to read that sector, and
1503the read failed because the data on it has been corrupted and has
1504inconsistent Error Checking and Correction (ECC) codes. This is
1505important to know, because it means that there is some unreadable data
1506on the disk. The problem of figuring out what file this data belongs
1507to is operating system and file system specific. You can typically
1508force the sector to reallocate by writing to it (translation: make the
1509device substitute a spare good sector for the bad one) but at the
1510price of losing the 512 bytes of data stored there.
832b75ed 1511.TP
2127e193 1512.B \-U ID[+]
832b75ed
GG
1513[ATA only] Report if the number of offline uncorrectable sectors is
1514non-zero. Here \fBID\fP is the id number of the Attribute whose raw
1515value is the Offline Uncorrectable Sector count. The allowed range of
1516\fBID\fP is 0 to 255 inclusive. To turn off this reporting, use
1517ID\ =\ 0. If the \fB\-U ID\fP option is not given, then it defaults to
1518\fB\-U 198\fP (since Attribute 198 is generally used to monitor
e9583e0c
GI
1519offline uncorrectable sectors). If the name of this Attribute is changed
1520by a \'\-v 198,FORMAT,NAME\' (except \'\-v 198,FORMAT,Offline_Scan_UNC_SectCt\'),
1521directive, the default is changed to \fB\-U 0\fP.
832b75ed 1522
2127e193
GI
1523If \'+\' is specified, a report is only printed if the number of sectors
1524has increased since the last check cycle. Some disks do not reset this
1525attribute when a bad sector is reallocated.
1526See also \'\-v 198,increasing\' below.
832b75ed
GG
1527
1528An offline uncorrectable sector is a disk sector which was not
1529readable during an off\-line scan or a self\-test. This is important
1530to know, because if you have data stored in this disk sector, and you
1531need to read it, the read will fail. Please see the previous \'\-C\'
1532option for more details.
4d59bff9
GG
1533.TP
1534.B \-W DIFF[,INFO[,CRIT]]
1535Report if the current temperature had changed by at least \fBDIFF\fP
2127e193
GI
1536degrees since last report, or if new min or max temperature is detected.
1537Report or Warn if the temperature is greater or equal than one of
1538\fBINFO\fP or \fBCRIT\fP degrees Celsius.
1539If the limit \fBCRIT\fP is reached, a message with loglevel
e9583e0c 1540\fB\'LOG_CRIT\'\fP will be logged to syslog and a warning email
4d59bff9
GG
1541will be send if '-m' is specified. If only the limit \fBINFO\fP is
1542reached, a message with loglevel \fB\'LOG_INFO\'\fP will be logged.
1543
2127e193
GI
1544If this directive is used in conjunction with state persistence
1545(\'\-s\' option), the min and max temperature values are preserved
1546across boot cycles. The minimum temperature value is not updated
1547during the first 30 minutes after startup.
1548
4d59bff9
GG
1549To disable any of the 3 reports, set the corresponding limit to 0.
1550Trailing zero arguments may be omitted. By default, all temperature
1551reports are disabled (\'-W 0\').
1552
1553To track temperature changes of at least 2 degrees, use:
1554.nf
1555\fB \-W 2
1556.fi
1557To log informal messages on temperatures of at least 40 degrees, use:
1558.nf
1559\fB \-W 0,40
1560.fi
1561For warning messages/mails on temperatures of at least 45 degrees, use:
1562.nf
1563\fB \-W 0,0,45
1564.fi
1565To combine all of the above reports, use:
1566.nf
1567\fB \-W 2,40,45
1568.fi
1569
1570For ATA devices, smartd interprets Attribute 194 as Temperature Celsius
1571by default. This can be changed to Attribute 9 or 220 by the drive
1572database or by the \'-v\' directive, see below.
832b75ed
GG
1573.TP
1574.B \-F TYPE
1575[ATA only] Modifies the behavior of \fBsmartd\fP to compensate for
1576some known and understood device firmware bug. The arguments to this
1577Directive are exclusive, so that only the final Directive given is
1578used. The valid values are:
1579
1580.I none
e9583e0c
GI
1581\- Assume that the device firmware obeys the ATA specifications. This
1582is the default, unless the device has presets for \'\-F\' in the
1583device database.
832b75ed
GG
1584
1585.I samsung
1586\- In some Samsung disks (example: model SV4012H Firmware Version:
e9583e0c
GI
1587RM100\-08) some of the two\- and four\-byte quantities in the SMART data
1588structures are byte\-swapped (relative to the ATA specification).
832b75ed 1589Enabling this option tells \fBsmartd\fP to evaluate these quantities
e9583e0c
GI
1590in byte\-reversed order. Some signs that your disk needs this option
1591are (1) no self\-test log printed, even though you have run self\-tests;
832b75ed
GG
1592(2) very large numbers of ATA errors reported in the ATA error log;
1593(3) strange and impossible values for the ATA error log timestamps.
1594
1595.I samsung2
e9583e0c
GI
1596\- In some Samsung disks the number of ATA errors reported is byte swapped.
1597Enabling this option tells \fBsmartd\fP to evaluate this quantity in
1598byte\-reversed order.
832b75ed 1599
a37e7145
GG
1600.I samsung3
1601\- Some Samsung disks (at least SP2514N with Firmware VF100\-37) report
1602a self\-test still in progress with 0% remaining when the test was already
1603completed. If this directive is specified, \fBsmartd\fP will not skip the
1604next scheduled self\-test (see Directive \'\-s\' above) in this case.
1605
e9583e0c 1606Note that an explicit \'\-F\' Directive will over\-ride any preset
832b75ed
GG
1607values for \'\-F\' (see the \'\-P\' option below).
1608
1609
1610[Please see the \fBsmartctl \-F\fP command-line option.]
832b75ed 1611.TP
a23d5117
GI
1612.B \-v ID,FORMAT[:BYTEORDER][,NAME]
1613[ATA only] Sets a vendor\-specific raw value print FORMAT, an optional
1614BYTEORDER and an optional NAME for Attribute ID.
bed94269
GI
1615This directive may be used multiple times.
1616Please see \fBsmartctl -v\fP command-line option for further details.
832b75ed 1617
bed94269 1618The following arguments affect smartd warning output:
832b75ed 1619
2127e193
GI
1620.I 197,increasing
1621\- Raw Attribute number 197 (Current Pending Sector Count) is not
bed94269
GI
1622reset if uncorrectable sectors are reallocated. This sets \'-C 197+\'
1623if no other \'-C\' directive is specified.
2127e193
GI
1624
1625.I 198,increasing
1626\- Raw Attribute number 198 (Offline Uncorrectable Sector Count) is not
bed94269
GI
1627reset if uncorrectable sector are reallocated. This sets \'-U 198+\'
1628if no other \'-U\' directive is specified.
832b75ed
GG
1629.TP
1630.B \-P TYPE
cfbba5b9
GI
1631[ATA only] Specifies whether \fBsmartd\fP should use any preset options
1632that are available for this drive.
1633The valid arguments to this Directive are:
832b75ed
GG
1634
1635.I use
1636\- use any presets that are available for this drive. This is the default.
1637
1638.I ignore
1639\- do not use any presets for this drive.
1640
1641.I show
1642\- show the presets listed for this drive in the database.
1643
1644.I showall
1645\- show the presets that are available for all drives and then exit.
1646
1647[Please see the
1648.B smartctl \-P
1649command-line option.]
832b75ed
GG
1650.TP
1651.B \-a
1652Equivalent to turning on all of the following Directives:
1653.B \'\-H\'
1654to check the SMART health status,
1655.B \'\-f\'
1656to report failures of Usage (rather than Prefail) Attributes,
1657.B \'\-t\'
1658to track changes in both Prefailure and Usage Attributes,
1659.B \'\-l\ selftest\'
1660to report increases in the number of Self-Test Log errors,
1661.B \'\-l\ error\'
1662to report increases in the number of ATA errors,
1663.B \'\-C 197\'
1664to report nonzero values of the current pending sector count, and
1665.B \'\-U 198\'
1666to report nonzero values of the offline pending sector count.
1667
1668Note that \-a is the default for ATA devices. If none of these other
1669Directives is given, then \-a is assumed.
832b75ed
GG
1670.TP
1671.B #
1672Comment: ignore the remainder of the line.
1673.TP
1674.B \e
1675Continuation character: if this is the last non-white or non-comment
1676character on a line, then the following line is a continuation of the current
1677one.
1678.PP
1679If you are not sure which Directives to use, I suggest experimenting
1680for a few minutes with
1681.B smartctl
1682to see what SMART functionality your disk(s) support(s). If you do
1683not like voluminous syslog messages, a good choice of
1684\fBsmartd\fP
1685configuration file Directives might be:
1686.nf
1687.B \-H \-l\ selftest \-l\ error \-f.
1688.fi
1689If you want more frequent information, use:
1690.B -a.
1691
1692.TP
1693.B ADDITIONAL DETAILS ABOUT DEVICESCAN
7f0798ef 1694If a non-comment entry in the configuration file is the text
832b75ed
GG
1695string \fBDEVICESCAN\fP in capital letters, then \fBsmartd\fP will
1696ignore any remaining lines in the configuration file, and will scan
1697for devices.
1698
7f0798ef
GI
1699[NEW EXPERIMENTAL SMARTD FEATURE] Configuration entries for devices
1700not found by the platform\-specific device scanning may precede the
1701\fBDEVICESCAN\fP entry.
1702
832b75ed
GG
1703If \fBDEVICESCAN\fP is not followed by any Directives, then smartd
1704will scan for both ATA and SCSI devices, and will monitor all possible
1705SMART properties of any devices that are found.
1706
1707\fBDEVICESCAN\fP may optionally be followed by any valid Directives,
1708which will be applied to all devices that are found in the scan. For
1709example
1710.nf
1711.B DEVICESCAN -m root@example.com
1712.fi
1713will scan for all devices, and then monitor them. It will send one
1714email warning per device for any problems that are found.
1715.nf
1716.B DEVICESCAN -d ata -m root@example.com
1717.fi
1718will do the same, but restricts the scan to ATA devices only.
1719.nf
1720.B DEVICESCAN -H -d ata -m root@example.com
1721.fi
1722will do the same, but only monitors the SMART health status of the
1723devices, (rather than the default \-a, which monitors all SMART
1724properties).
1725
1726.TP
1727.B EXAMPLES OF SHELL SCRIPTS FOR \'\-M exec\'
1728These are two examples of shell scripts that can be used with the \'\-M
1729exec PATH\' Directive described previously. The paths to these scripts
1730and similar executables is the PATH argument to the \'\-M exec PATH\'
1731Directive.
1732
1733Example 1: This script is for use with \'\-m ADDRESS -M exec PATH\'. It appends
1734the output of
1735.B smartctl -a
1736to the output of the smartd email warning message and sends it to ADDRESS.
1737
1738.nf
1739\fB
1740#! /bin/bash
1741
1742# Save the email message (STDIN) to a file:
1743cat > /root/msg
1744
1745# Append the output of smartctl -a to the message:
1746/usr/local/sbin/smartctl -a -d $SMART_DEVICETYPE $SMARTD_DEVICE >> /root/msg
1747
1748# Now email the message to the user at address ADD:
1749/bin/mail -s "$SMARTD_SUBJECT" $SMARTD_ADDRESS < /root/msg
1750\fP
1751.fi
1752
1753Example 2: This script is for use with \'\-m <nomailer> \-M exec
1754PATH\'. It warns all users about a disk problem, waits 30 seconds, and
1755then powers down the machine.
1756
1757.nf
1758\fB
1759#! /bin/bash
1760
1761# Warn all users of a problem
1762wall \'Problem detected with disk: \' "$SMARTD_DEVICESTRING"
1763wall \'Warning message from smartd is: \' "$SMARTD_MESSAGE"
1764wall \'Shutting down machine in 30 seconds... \'
1765
1766# Wait half a minute
1767sleep 30
1768
1769# Power down the machine
1770/sbin/shutdown -hf now
1771\fP
1772.fi
1773
1774Some example scripts are distributed with the smartmontools package,
e9583e0c 1775in /usr/local/share/doc/smartmontools/examplescripts/.
832b75ed
GG
1776
1777Please note that these scripts typically run as root, so any files
1778that they read/write should not be writable by ordinary users or
1779reside in directories like /tmp that are writable by ordinary users
1780and may expose your system to symlink attacks.
1781
1782As previously described, if the scripts write to STDOUT or STDERR,
1783this is interpreted as indicating that there was an internal error
1784within the script, and a snippet of STDOUT/STDERR is logged to SYSLOG.
1785The remainder is flushed.
1786
1787.\" ENDINCLUDE
1788.\" DO NOT MODIFY THIS OR PREVIOUS/NEXT LINES. THIS DEFINES THE
1789.\" END OF THE INCLUDE SECTION FOR smartd.conf.5
1790
1791.SH NOTES
1792\fBsmartd\fP
1793will make log entries at loglevel
1794.B LOG_INFO
1795if the Normalized SMART Attribute values have changed, as reported using the
1796.B \'\-t\', \'\-p\',
1797or
1798.B \'\-u\'
1799Directives. For example:
1800.nf
1801.B \'Device: /dev/hda, SMART Attribute: 194 Temperature_Celsius changed from 94 to 93\'
1802.fi
1803Note that in this message, the value given is the \'Normalized\' not the \'Raw\'
1804Attribute value (the disk temperature in this case is about 22
1805Celsius). The
1806.B \'-R\'
1807and
1808.B \'-r\'
1809Directives modify this behavior, so that the information is printed
1810with the Raw values as well, for example:
1811.nf
1812.B \'Device: /dev/hda, SMART Attribute: 194 Temperature_Celsius changed from 94 [Raw 22] to 93 [Raw 23]\'
1813.fi
1814Here the Raw values are the actual disk temperatures in Celsius. The
1815way in which the Raw values are printed, and the names under which the
1816Attributes are reported, is governed by the various
1817.B \'-v Num,Description\'
1818Directives described previously.
1819
1820Please see the
1821.B smartctl
1822manual page for further explanation of the differences between
1823Normalized and Raw Attribute values.
1824
1825\fBsmartd\fP
1826will make log entries at loglevel
1827.B LOG_CRIT
1828if a SMART Attribute has failed, for example:
1829.nf
1830.B \'Device: /dev/hdc, Failed SMART Attribute: 5 Reallocated_Sector_Ct\'
1831.fi
1832 This loglevel is used for reporting enabled by the
1833.B \'\-H\', \-f\', \'\-l\ selftest\',
1834and
1835.B \'\-l\ error\'
1836Directives. Entries reporting failure of SMART Prefailure Attributes
1837should not be ignored: they mean that the disk is failing. Use the
1838.B smartctl
1839utility to investigate.
1840
1841Under Solaris with the default \fB/etc/syslog.conf\fP configuration,
1842messages below loglevel \fBLOG_NOTICE\fP will \fBnot\fP be recorded.
1843Hence all \fBsmartd\fP messages with loglevel \fBLOG_INFO\fP will be
1844lost. If you want to use the existing daemon facility to log all
1845messages from \fBsmartd\fP, you should change \fB/etc/syslog.conf\fP
1846from:
1847.nf
1848 ...;daemon.notice;... /var/adm/messages
1849.fi
1850to read:
1851.nf
1852 ...;daemon.info;... /var/adm/messages
1853.fi
1854Alternatively, you can use a local facility to log messages: please
1855see the \fBsmartd\fP '-l' command-line option described above.
1856
1857On Cygwin and Windows, the log messages are written to the event log
1858or to a file. See documentation of the '-l FACILITY' option above for
1859details.
1860
1861On Windows, the following built-in commands can be used to control
1862\fBsmartd\fP, if running as a daemon:
1863
1864\'\fBsmartd status\fP\' \- check status
1865
1866\'\fBsmartd stop\fP\' \- stop smartd
1867
1868\'\fBsmartd reload\fP\' \- reread config file
1869
1870\'\fBsmartd restart\fP\' \- restart smartd
1871
1872\'\fBsmartd sigusr1\fP\' \- check disks now
1873
1874\'\fBsmartd sigusr2\fP\' \- toggle debug mode
1875
1876On WinNT4/2000/XP, \fBsmartd\fP can also be run as a Windows service:
1877
1878
1879The Cygwin Version of \fBsmartd\fP can be run as a service via the
1880cygrunsrv tool. The start-up script provides Cygwin-specific commands
1881to install and remove the service:
1882.nf
1883.B /usr/local/etc/rc.d/init.d/smartd install [options]
1884.B /usr/local/etc/rc.d/init.d/smartd remove
1885.fi
1886The service can be started and stopped by the start-up script as usual
1887(see \fBEXAMPLES\fP above).
1888
1889
1890The Windows Version of \fBsmartd\fP has buildin support for services:
1891
1892\'\fBsmartd install [options]\fP\' installs a service
1893named "smartd" (display name "SmartD Service") using the command line
1894\'/installpath/smartd.exe --service [options]\'.
1895
1896\'\fBsmartd remove\fP\' can later be used to remove the service entry
1897from registry.
1898
1899Upon startup, the smartd service changes the working directory
1900to its own installation path. If smartd.conf and blat.exe are stored
1901in this directory, no \'-c\' option and \'-M exec\' directive is needed.
1902
1903The debug mode (\'-d\', \'-q onecheck\') does not work if smartd is
1904running as service.
1905
1906The service can be controlled as usual with Windows commands \'net\'
1907or \'sc\' (\'\fBnet start smartd\fP\', \'\fBnet stop smartd\fP\').
1908
1909Pausing the service (\'\fBnet pause smartd\fP\') sets the interval between
1910disk checks (\'-i N\') to infinite.
1911
1912Continuing the paused service (\'\fBnet continue smartd\fP\') resets the
1913interval and rereads the configuration file immediately (like \fBSIGHUP\fP):
1914
1915Continuing a still running service (\'\fBnet continue smartd\fP\' without
1916preceding \'\fBnet pause smartd\fP\') does not reread configuration but
1917checks disks immediately (like \fBSIGUSR1\fP).
1918
1919.SH LOG TIMESTAMP TIMEZONE
1920
1921When \fBsmartd\fP makes log entries, these are time-stamped. The time
1922stamps are in the computer's local time zone, which is generally set
1923using either the environment variable \'\fBTZ\fP\' or using a
1924time-zone file such as \fB/etc/localtime\fP. You may wish to change
1925the timezone while \fBsmartd\fP is running (for example, if you carry
1926a laptop to a new time-zone and don't reboot it). Due to a bug in the
1927\fBtzset(3)\fP function of many unix standard C libraries, the
1928time-zone stamps of \fBsmartd\fP might not change. For some systems,
1929\fBsmartd\fP will work around this problem \fIif\fP the time-zone is
1930set using \fB/etc/localtime\fP. The work-around \fIfails\fP if the
1931time-zone is set using the \'\fBTZ\fP\' variable (or a file that it
1932points to).
1933
1934
1935.SH RETURN VALUES
1936The return value (exit status) of
1937\fBsmartd\fP
1938can have the following values:
1939.TP
1940.B 0:
1941Daemon startup successful, or \fBsmartd\fP was killed by a SIGTERM (or in debug mode, a SIGQUIT).
1942.TP
1943.B 1:
1944Commandline did not parse.
1945.TP
1946.B 2:
1947There was a syntax error in the config file.
1948.TP
1949.B 3:
1950Forking the daemon failed.
1951.TP
1952.B 4:
1953Couldn\'t create PID file.
1954.TP
1955.B 5:
1956Config file does not exist (only returned in conjunction with the \'-c\' option).
1957.TP
1958.B 6:
1959Config file exists, but cannot be read.
1960.TP
1961.B 8:
1962\fBsmartd\fP
1963ran out of memory during startup.
1964.TP
1965.B 9:
1966A compile time constant of\fB smartd\fP was too small. This can be caused by an
1967excessive number of disks, or by lines in \fB /usr/local/etc/smartd.conf\fP that are too long.
1968Please report this problem to \fB smartmontools-support@lists.sourceforge.net\fP.
1969.TP
1970.B 10
1971An inconsistency was found in \fBsmartd\fP\'s internal data
1972structures. This should never happen. It must be due to either a
1973coding or compiler bug. \fIPlease\fP report such failures to
1974smartmontools-support@lists.sourceforge.net.
1975.TP
1976.B 16:
1977A device explicitly listed in
1978.B /usr/local/etc/smartd.conf
1979can\'t be monitored.
1980.TP
1981.B 17:
1982\fBsmartd\fP
1983didn\'t find any devices to monitor.
1984.TP
1985.B 254:
1986When in daemon mode,
1987\fBsmartd\fP
1988received a SIGINT or SIGQUIT. (Note that in debug mode, SIGINT has
1989the same effect as SIGHUP, and makes \fBsmartd\fP reload its
1990configuration file. SIGQUIT has the same effect as SIGTERM and causes
1991\fBsmartd\fP to exit with zero exit status.
1992.TP
1993.B 132 and above
1994\fBsmartd\fP
1995was killed by a signal that is not explicitly listed above. The exit
1996status is then 128 plus the signal number. For example if
1997\fBsmartd\fP
1998is killed by SIGKILL (signal 9) then the exit status is 137.
1999
2000.PP
2001.SH AUTHOR
e9583e0c 2002\fBBruce Allen\fP smartmontools\-support@lists.sourceforge.net
832b75ed
GG
2003.fi
2004University of Wisconsin \- Milwaukee Physics Department
2005
2006.PP
2007.SH CONTRIBUTORS
2008The following have made large contributions to smartmontools:
2009.nf
2010\fBCasper Dik\fP (Solaris SCSI interface)
2127e193 2011\fBChristian Franke\fP (Windows interface, C++ redesign, USB support, ...)
832b75ed
GG
2012\fBDouglas Gilbert\fP (SCSI subsystem)
2013\fBGuido Guenther\fP (Autoconf/Automake packaging)
2014\fBGeoffrey Keating\fP (Darwin ATA interface)
2015\fBEduard Martinescu\fP (FreeBSD interface)
2016\fBFr\*'ed\*'eric L. W. Meunier\fP (Web site and Mailing list)
2127e193 2017\fBGabriele Pohl\fP (Web site and Wiki, conversion from CVS to SVN)
832b75ed 2018\fBKeiji Sawada\fP (Solaris ATA interface)
2127e193 2019\fBManfred Schwarb\fP (Drive database)
832b75ed
GG
2020\fBSergey Svishchev\fP (NetBSD interface)
2021\fBDavid Snyder and Sergey Svishchev\fP (OpenBSD interface)
2022\fBPhil Williams\fP (User interface and drive database)
2127e193 2023\fBShengfeng Zhou\fP (Linux/FreeBSD HighPoint RocketRAID interface)
832b75ed
GG
2024.fi
2025Many other individuals have made smaller contributions and corrections.
2026
2027.PP
2028.SH CREDITS
2029.fi
2030This code was derived from the smartsuite package, written by Michael
e9583e0c
GI
2031Cornwell, and from the previous UCSC smartsuite package. It extends
2032these to cover ATA\-5 disks. This code was originally developed as a
832b75ed
GG
2033Senior Thesis by Michael Cornwell at the Concurrent Systems Laboratory
2034(now part of the Storage Systems Research Center), Jack Baskin School
2035of Engineering, University of California, Santa
2036Cruz. \fBhttp://ssrc.soe.ucsc.edu/\fP .
2037.SH
2038HOME PAGE FOR SMARTMONTOOLS:
2039.fi
2040Please see the following web site for updates, further documentation, bug
2041reports and patches: \fBhttp://smartmontools.sourceforge.net/\fP
2042
e9583e0c
GI
2043.SH
2044SEE ALSO:
832b75ed
GG
2045\fBsmartd.conf\fP(5), \fBsmartctl\fP(8), \fBsyslogd\fP(8),
2046\fBsyslog.conf\fP(5), \fBbadblocks\fP(8), \fBide\-smart\fP(8), \fBregex\fP(7).
2047
2048.SH
2049REFERENCES FOR SMART
2050.fi
2051An introductory article about smartmontools is \fIMonitoring Hard
2052Disks with SMART\fP, by Bruce Allen, Linux Journal, January 2004,
e9583e0c 2053pages 74\-77. This is \fBhttp://www.linuxjournal.com/article/6983\fP
832b75ed
GG
2054online.
2055
2056If you would like to understand better how SMART works, and what it
2057does, a good place to start is with Sections 4.8 and 6.54 of the first
e9583e0c
GI
2058volume of the \'AT Attachment with Packet Interface\-7\' (ATA/ATAPI\-7)
2059specification Revision 4b. This documents the SMART functionality which the
2060\fBsmartmontools\fP utilities provide access to.
2061This and other versions of this Specification are available from
832b75ed
GG
2062the T13 web site \fBhttp://www.t13.org/\fP .
2063
2064.fi
e9583e0c
GI
2065The functioning of SMART was originally defined by the SFF\-8035i
2066revision 2 and the SFF\-8055i revision 1.4 specifications. These are
2067publications of the Small Form Factors (SFF) Committee.
2068
2069Links to these and other documents may be found on the Links page of the
2070\fBsmartmontools\fP Wiki at
2071\fBhttp://sourceforge.net/apps/trac/smartmontools/wiki/Links\fP .
832b75ed
GG
2072
2073.SH
2127e193 2074SVN ID OF THIS PAGE:
cfbba5b9 2075$Id: smartd.8.in 3284 2011-03-04 21:33:35Z chrfranke $