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