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