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