]> git.proxmox.com Git - mirror_smartmontools-debian.git/blob - smartd.conf.5.in
Imported Upstream version 5.38+svn2956
[mirror_smartmontools-debian.git] / smartd.conf.5.in
1 .ig
2 Copyright (C) 2002-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
3
4 $Id: smartd.conf.5.in 2921 2009-09-20 19:19:32Z samm2 $
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
9 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., 675
13 Mass Ave, Cambridge, MA 02139, USA.
14
15 This code was originally developed as a Senior Thesis by Michael Cornwell
16 at the Concurrent Systems Laboratory (now part of the Storage Systems
17 Research Center), Jack Baskin School of Engineering, University of
18 California, Santa Cruz. http://ssrc.soe.ucsc.edu/
19 ..
20 .TH SMARTD.CONF 5 CURRENT_CVS_DATE CURRENT_CVS_VERSION CURRENT_CVS_DATE
21 .SH NAME
22 \fBsmartd.conf\fP \- SMART Disk Monitoring Daemon Configuration File\fP
23
24 .SH FULL PATH
25 .B /usr/local/etc/smartd.conf
26
27 .SH PACKAGE VERSION
28 CURRENT_CVS_VERSION released CURRENT_CVS_DATE at CURRENT_CVS_TIME
29
30 .SH DESCRIPTION
31 \fB/usr/local/etc/smartd.conf\fP is the configuration file for the \fBsmartd\fP
32 daemon, which monitors the Self-Monitoring, Analysis and Reporting
33 Technology (SMART) system built into many ATA-3 and later ATA, IDE and
34 SCSI-3 hard drives.
35
36 If the configuration file \fB/usr/local/etc/smartd.conf\fP is present,
37 \fBsmartd\fP reads it at startup, before \fBfork\fP(2)ing into the
38 background. If \fBsmartd\fP subsequently receives a \fBHUP\fP signal,
39 it will then re-read the configuration file. If \fBsmartd\fP is
40 running in debug mode, then an \fBINT\fP signal will also make it
41 re-read the configuration file. This signal can be generated by typing
42 \fB\<CONTROL-C\>\fP in the terminal window where \fBsmartd\fP is
43 running.
44
45 .\" DO NOT MODIFY THIS OR THE FOLLOWING TWO LINES. WHAT FOLLOWS
46 .\" IS AUTOMATICALLY INCLUDED FROM THE FILE smartd.8.in
47 .\" STARTINCLUDE
48
49 .SH CONFIGURATION FILE /usr/local/etc/smartd.conf
50 In the absence of a configuration file, under Linux
51 \fBsmartd\fP
52 will try to open the 20 ATA devices
53 .B /dev/hd[a-t]
54 and the 26 SCSI devices
55 .B /dev/sd[a-z].
56 Under FreeBSD,
57 \fBsmartd\fP
58 will try to open all existing ATA devices (with entries in /dev)
59 .B /dev/ad[0-9]+
60 and all existing SCSI devices
61 .B /dev/da[0-9]+.
62 Under NetBSD/OpenBSD,
63 \fBsmartd\fP
64 will try to open all existing ATA devices (with entries in /dev)
65 .B /dev/wd[0-9]+c
66 and all existing SCSI devices
67 .B /dev/sd[0-9]+c.
68 Under Solaris \fBsmartd\fP will try to open all entries \fB"/dev/rdsk/c?t?d?s?"\fP for IDE/ATA and SCSI disk
69 devices, and entries \fB"/dev/rmt/*"\fP for SCSI tape devices.
70 Under Windows \fBsmartd\fP will try to open all entries \fB"/dev/hd[a-j]"\fP ("\\\\.\\PhysicalDrive[0-9]")
71 for IDE/ATA devices on WinNT4/2000/XP, \fB"/dev/hd[a-d]"\fP
72 (bitmask from "\\\\.\\SMARTVSD") for IDE/ATA devices on Win95/98/98SE/ME,
73 and \fB"/dev/scsi[0-9][0-7]"\fP (ASPI adapter 0-9, ID 0-7) for SCSI
74 devices on all versions of Windows.
75 Under Darwin, \fBsmartd\fP will open any ATA block storage device.
76
77 This can be annoying if you have an ATA or SCSI device that hangs or
78 misbehaves when receiving SMART commands. Even if this causes no
79 problems, you may be annoyed by the string of error log messages about
80 block-major devices that can\'t be found, and SCSI devices that can\'t
81 be opened.
82
83 One can avoid this problem, and gain more control over the types of
84 events monitored by
85 \fBsmartd\fP,
86 by using the configuration file
87 .B /usr/local/etc/smartd.conf.
88 This file contains a list of devices to monitor, with one device per
89 line. An example file is included with the
90 .B smartmontools
91 distribution. You will find this sample configuration file in
92 \fB/usr/local/share/doc/smartmontools-5.1/\fP. For security, the configuration file
93 should not be writable by anyone but root. The syntax of the file is as
94 follows:
95 .IP \(bu 4
96 There should be one device listed per line, although you may have
97 lines that are entirely comments or white space.
98 .IP \(bu 4
99 Any text following a hash sign \'#\' and up to the end of the line is
100 taken to be a comment, and ignored.
101 .IP \(bu 4
102 Lines may be continued by using a backslash \'\e\' as the last
103 non-whitespace or non-comment item on a line.
104 .IP \(bu 4
105 Note: a line whose first character is a hash sign \'#\' is treated as
106 a white-space blank line, \fBnot\fP as a non-existent line, and will
107 \fBend\fP a continuation line.
108 .PP 0
109 .fi
110 Here is an example configuration file. It\'s for illustrative purposes
111 only; please don\'t copy it onto your system without reading to the end
112 of the
113 .B DIRECTIVES
114 Section below!
115
116 .nf
117 .B ################################################
118 .B # This is an example smartd startup config file
119 .B # /usr/local/etc/smartd.conf for monitoring three
120 .B # ATA disks, three SCSI disks, six ATA disks
121 .B # behind two 3ware controllers, three SATA disks
122 .B # directly connected to the HighPoint Rocket-
123 .B # RAID controller, two SATA disks connected to
124 .B # the HighPoint RocketRAID controller via a pmport
125 .B # device, four SATA disks connected to an Areca
126 .B # RAID controller, and one SATA disk.
127 .B #
128 .nf
129 .B # First ATA disk on two different interfaces. On
130 .B # the second disk, start a long self-test every
131 .B # Sunday between 3 and 4 am.
132 .B #
133 .B \ \ /dev/hda -a -m admin@example.com,root@localhost
134 .B \ \ /dev/hdc -a -I 194 -I 5 -i 12 -s L/../../7/03
135 .B #
136 .nf
137 .B # SCSI disks. Send a TEST warning email to admin on
138 .B # startup.
139 .B #
140 .B \ \ /dev/sda
141 .B \ \ /dev/sdb -m admin@example.com -M test
142 .B #
143 .nf
144 .B # Strange device. It\'s SCSI. Start a scheduled
145 .B # long self test between 5 and 6 am Monday/Thursday
146 .B \ \ /dev/weird -d scsi -s L/../../(1|4)/05
147 .B #
148 .nf
149 .B # An ATA disk may appear as a SCSI device to the
150 .B # OS. If a SCSI to ATA Translation (SAT) layer
151 .B # is between the OS and the device then this can be
152 .B # flagged with the '-d sat' option. This situation
153 .B # may become common with SATA disks in SAS and FC
154 .B # environments.
155 .B \ \ /dev/sda -a -d sat
156 .B #
157 .nf
158 .B # Three disks connected to a MegaRAID controller
159 .B # Start short self-tests daily between 1-2, 2-3, and
160 .B # 3-4 am.
161 .B \ \ /dev/sda -d megaraid,0 -a -s S/../.././01
162 .B \ \ /dev/sda -d megaraid,1 -a -s S/../.././02
163 .B \ \ /dev/sda -d megaraid,2 -a -s S/../.././03
164 .B
165 .B #
166 .nf
167 .B # Four ATA disks on a 3ware 6/7/8000 controller.
168 .B # Start short self-tests daily between midnight and 1am,
169 .B # 1-2, 2-3, and 3-4 am. Starting with the Linux 2.6
170 .B # kernel series, /dev/sdX is deprecated in favor of
171 .B # /dev/tweN. For example replace /dev/sdc by /dev/twe0
172 .B # and /dev/sdd by /dev/twe1.
173 .B \ \ /dev/sdc -d 3ware,0 -a -s S/../.././00
174 .B \ \ /dev/sdc -d 3ware,1 -a -s S/../.././01
175 .B \ \ /dev/sdd -d 3ware,2 -a -s S/../.././02
176 .B \ \ /dev/sdd -d 3ware,3 -a -s S/../.././03
177 .B #
178 .nf
179 .B # Two ATA disks on a 3ware 9000 controller.
180 .B # Start long self-tests Sundays between midnight and
181 .B # 1am and 2-3 am
182 .B \ \ /dev/twa0 -d 3ware,0 -a -s L/../../7/00
183 .B \ \ /dev/twa0 -d 3ware,1 -a -s L/../../7/02
184 .B #
185 .nf
186 .B # Three SATA disks on a HighPoint RocketRAID controller.
187 .B # Start short self-tests daily between 1-2, 2-3, and
188 .B # 3-4 am.
189 .B # under Linux
190 .B \ \ /dev/sde -d hpt,1/1 -a -s S/../.././01
191 .B \ \ /dev/sde -d hpt,1/2 -a -s S/../.././02
192 .B \ \ /dev/sde -d hpt,1/3 -a -s S/../.././03
193 .B # or under FreeBSD
194 .B # /dev/hptrr -d hpt,1/1 -a -s S/../.././01
195 .B # /dev/hptrr -d hpt,1/2 -a -s S/../.././02
196 .B # /dev/hptrr -d hpt,1/3 -a -s S/../.././03
197 .B #
198 .nf
199 .B # Two SATA disks connected to a HighPoint RocketRAID
200 .B # via a pmport device. Start long self-tests Sundays
201 .B # between midnight and 1am and 2-3 am.
202 .B # under Linux
203 .B \ \ /dev/sde -d hpt,1/4/1 -a -s L/../../7/00
204 .B \ \ /dev/sde -d hpt,1/4/2 -a -s L/../../7/02
205 .B # or under FreeBSD
206 .B # /dev/hptrr -d hpt,1/4/1 -a -s L/../../7/00
207 .B # /dev/hptrr -d hpt,1/4/2 -a -s L/../../7/02
208 .B #
209 .nf
210 .B # Three SATA disks connected to an Areca
211 .B # RAID controller. Start long self-tests Sundays
212 .B # between midnight and 3 am.
213 .B \ \ /dev/sg2 -d areca,1 -a -s L/../../7/00
214 .B \ \ /dev/sg2 -d areca,2 -a -s L/../../7/01
215 .B \ \ /dev/sg2 -d areca,3 -a -s L/../../7/02
216 .B #
217 .nf
218 .B # The following line enables monitoring of the
219 .B # ATA Error Log and the Self-Test Error Log.
220 .B # It also tracks changes in both Prefailure
221 .B # and Usage Attributes, apart from Attributes
222 .B # 9, 194, and 231, and shows continued lines:
223 .B #
224 .B \ \ /dev/hdd\ -l\ error\ \e
225 .B \ \ \ \ \ \ \ \ \ \ \ -l\ selftest\ \e
226 .B \ \ \ \ \ \ \ \ \ \ \ -t\ \e\ \ \ \ \ \ # Attributes not tracked:
227 .B \ \ \ \ \ \ \ \ \ \ \ -I\ 194\ \e\ \ # temperature
228 .B \ \ \ \ \ \ \ \ \ \ \ -I\ 231\ \e\ \ # also temperature
229 .B \ \ \ \ \ \ \ \ \ \ \ -I 9\ \ \ \ \ \ # power-on hours
230 .B #
231 .B ################################################
232 .fi
233
234 .PP
235 .SH CONFIGURATION FILE DIRECTIVES
236 .PP
237
238 If the first non-comment entry in the configuration file is the text
239 string
240 .B DEVICESCAN
241 in capital letters, then
242 \fBsmartd\fP
243 will ignore any remaining lines in the configuration file, and will
244 scan for devices.
245 .B DEVICESCAN
246 may optionally be followed by Directives that will apply to all
247 devices that are found in the scan. Please see below for additional
248 details.
249
250 .sp 2
251 The following are the Directives that may appear following the device
252 name or
253 .B DEVICESCAN
254 on any line of the
255 .B /usr/local/etc/smartd.conf
256 configuration file. Note that
257 .B these are NOT command-line options for
258 \fBsmartd\fP.
259 The Directives below may appear in any order, following the device
260 name.
261
262 .B For an ATA device,
263 if no Directives appear, then the device will be monitored
264 as if the \'\-a\' Directive (monitor all SMART properties) had been given.
265
266 .B If a SCSI disk is listed,
267 it will be monitored at the maximum implemented level: roughly
268 equivalent to using the \'\-H \-l selftest\' options for an ATA disk.
269 So with the exception of \'\-d\', \'\-m\', \'\-l selftest\', \'\-s\', and
270 \'\-M\', the Directives below are ignored for SCSI disks. For SCSI
271 disks, the \'\-m\' Directive sends a warning email if the SMART status
272 indicates a disk failure or problem, if the SCSI inquiry about disk
273 status fails, or if new errors appear in the self-test log.
274
275 .B If a 3ware controller is used
276 then the corresponding SCSI (/dev/sd?) or character device (/dev/twe?
277 or /dev/twa?) must be listed, along with the \'\-d 3ware,N\' Directive
278 (see below). The individual ATA disks hosted by the 3ware controller
279 appear to \fBsmartd\fP as normal ATA devices. Hence all the ATA
280 directives can be used for these disks (but see note below).
281
282 .B If an Areca controller is used
283 then the corresponding SCSI generic device (/dev/sg?) must be listed,
284 along with the \'\-d areca,N\' Directive (see below). The individual
285 SATA disks hosted by the Areca controller appear to \fBsmartd\fP as
286 normal ATA devices. Hence all the ATA directives can be used for
287 these disks. Areca firmware version 1.46 or later which supports
288 smartmontools must be used; Please see the \fBsmartctl\fP man page for
289 further details.
290
291 .TP
292 .B \-d TYPE
293 Specifies the type of the device. This Directive may be used multiple
294 times for one device, but the arguments \fIata\fP, \fIscsi\fP,
295 \fIsat\fP, \fImarvell\fP, \fIcciss,N\fP, \fIareca,N\fP, \fImegaraid,N\fP
296 and \fI3ware,N\fP are mutually-exclusive. If more than one is given then
297 \fBsmartd\fP will use the last one which appears.
298
299 If none of these three arguments is given, then \fBsmartd\fP will
300 first attempt to guess the device type by looking at whether the sixth
301 character in the device name is an \'s\' or an \'h\'. This will work for
302 device names like /dev/hda or /dev/sdb, and corresponds to choosing
303 \fIata\fP or \fIscsi\fP respectively. If
304 \fBsmartd\fP
305 can\'t guess from this sixth character, then it will simply try to
306 access the device using first ATA and then SCSI ioctl()s.
307
308 The valid arguments to this Directive are:
309
310 .I ata
311 \- the device type is ATA. This prevents
312 \fBsmartd\fP
313 from issuing SCSI commands to an ATA device.
314
315 .I scsi
316 \- the device type is SCSI. This prevents
317 \fBsmartd\fP
318 from issuing ATA commands to a SCSI device.
319
320 .I sat
321 \- the device type is SCSI to ATA Translation (SAT).
322 \fBsmartd\fP
323 will generate ATA (smart) commands and then package them in
324 the SAT defined ATA PASS THROUGH SCSI commands. The commands
325 are then routed through the SCSI pass through interface to the
326 operating system. There are two types of ATA PASS THROUGH
327 SCSI commands: a 12 byte and 16 byte variant.
328 \fBsmartd\fP
329 can use either and defaults to the 16 byte variant. This can
330 be overridden with this syntax: \'\-d sat,12\' or \'\-d sat,16\'.
331
332 .I marvell
333 \- Under Linux, interact with SATA disks behind Marvell chip-set
334 controllers (using the Marvell rather than libata driver).
335
336 .I megaraid,N
337 \- the device consists of one or more SCSI/SAS/SATA disks connected
338 to a MegaRAID controller. The non-negative integer N (in the range
339 of 0 to 127 inclusive) denotes which disk on the controller is monitored.
340 In log files and email messages this disk will be identified as
341 megaraid_disk_XXX with XXX in the range from 000 to 127 inclusive.
342
343 .I 3ware,N
344 \- the device consists of one or more ATA disks connected to a 3ware
345 RAID controller. The non-negative integer N (in the range from 0 to 127
346 inclusive) denotes which disk on the controller is monitored. In log
347 files and email messages this disk will be identified as 3ware_disk_XXX
348 with XXX in the range from 000 to 127 inclusive.
349
350 This Directive may at first appear confusing, because the 3ware
351 controller is a SCSI device (such as /dev/sda) and should be listed as
352 such in the the configuration file.
353 However when the \'\-d 3ware,N\'
354 Directive is used, then the corresponding disk is addressed using
355 native ATA commands which are \'passed through\' the SCSI driver. All
356 ATA Directives listed in this man page may be used. Note that while
357 you may use \fBany\fP of the 3ware SCSI logical devices /dev/sd? to
358 address \fBany\fP of the physical disks (3ware ports), error and log
359 messages will make the most sense if you always list the 3ware SCSI
360 logical device corresponding to the particular physical disks. Please
361 see the \fBsmartctl\fP man page for further details.
362
363 ATA disks behind 3ware controllers may alternatively be accessed via a
364 character device interface /dev/twe0-15 (3ware 6000/7000/8000
365 controllers) and /dev/twa0-15 (3ware 9000 series controllers). Note
366 that the 9000 series controllers may \fBonly\fP be accessed using the
367 character device interface /dev/twa0-15 and not the SCSI device
368 interface /dev/sd?. Please see the \fBsmartctl\fP man page for
369 further details.
370
371 Note that older 3w-xxxx drivers do not pass the \'Enable Autosave\'
372 (\fB-S on\fP) and \'Enable Automatic Offline\' (\fB-o on\fP) commands
373 to the disk, if the SCSI interface is used, and produce these types of
374 harmless syslog error messages instead: \fB\'3w-xxxx: tw_ioctl():
375 Passthru size (123392) too big\'\fP. This can be fixed by upgrading to
376 version 1.02.00.037 or later of the 3w-xxxx driver, or by applying a
377 patch to older versions. See
378 \fBhttp://smartmontools.sourceforge.net/\fP for instructions.
379 Alternatively use the character device interfaces /dev/twe0-15 (3ware
380 6/7/8000 series controllers) or /dev/twa0-15 (3ware 9000 series
381 controllers).
382
383 .I areca,N
384 \- the device consists of one or more SATA disks connected to an Areca
385 SATA RAID controller. The positive integer N (in the range from 1 to
386 24 inclusive) denotes which disk on the controller is monitored. In
387 log files and email messages this disk will be identifed as
388 areca_disk_XX with XX in the range from 01 to 24 inclusive.
389
390 .I cciss,N
391 \- the device consists of one or more SCSI disks connected to a cciss
392 RAID controller. The non-negative integer N (in the range from 0 to 15
393 inclusive) denotes which disk on the controller is monitored. In log
394 files and email messages this disk will be identified as cciss_disk_XX
395 with XX in the range from 00 to 15 inclusive.
396
397 .B 3ware and cciss controllers are currently ONLY supported under Linux and FreeBSD.
398
399 .B MegaRAID and Areca controllers are currently ONLY supported under Linux.
400
401 .I hpt,L/M/N
402 \- the device consists of one or more ATA disks connected to a HighPoint
403 RocketRAID controller. The integer L is the controller id, the integer M
404 is the channel number, and the integer N is the PMPort number if it is
405 available. The allowed values of L are from 1 to 4 inclusive, M are from
406 1 to 8 inclusive and N from 1 to 4 if PMPort available. And also these
407 values are limited by the model of the HighPoint RocketRAID controller.
408 In log files and email messages this disk will be identified as
409 hpt_X/X/X and X/X/X is the same as L/M/N, note if no N indicated, N set
410 to the default value 1.
411
412 .B HighPoint RocketRAID controllers are currently ONLY supported under Linux and FreeBSD.
413
414 .I removable
415 \- the device or its media is removable. This indicates to
416 \fBsmartd\fP
417 that it should continue (instead of exiting, which is the default
418 behavior) if the device does not appear to be present when
419 \fBsmartd\fP is started. This Directive may be used in conjunction
420 with the other \'\-d\' Directives.
421
422 .TP
423 .B \-n POWERMODE[,N][,q]
424 This \'nocheck\' Directive is used to prevent a disk from being
425 spun-up when it is periodically polled by \fBsmartd\fP.
426
427 ATA disks have five different power states. In order of increasing
428 power consumption they are: \'OFF\', \'SLEEP\', \'STANDBY\', \'IDLE\',
429 and \'ACTIVE\'. Typically in the OFF, SLEEP, and STANDBY modes the
430 disk\'s platters are not spinning. But usually, in response to SMART
431 commands issued by \fBsmartd\fP, the disk platters are spun up. So if
432 this option is not used, then a disk which is in a low\-power mode may
433 be spun up and put into a higher\-power mode when it is periodically
434 polled by \fBsmartd\fP.
435
436 Note that if the disk is in SLEEP mode when \fBsmartd\fP is started,
437 then it won't respond to \fBsmartd\fP commands, and so the disk won't
438 be registered as a device for \fBsmartd\fP to monitor. If a disk is in
439 any other low\-power mode, then the commands issued by \fBsmartd\fP to
440 register the disk will probably cause it to spin\-up.
441
442 The \'\fB\-n\fP\' (nocheck) Directive specifies if \fBsmartd\fP\'s
443 periodic checks should still be carried out when the device is in a
444 low\-power mode. It may be used to prevent a disk from being spun\-up
445 by periodic \fBsmartd\fP polling. The allowed values of POWERMODE
446 are:
447
448 .I never
449 \- \fBsmartd\fP will poll (check) the device regardless of its power
450 mode. This may cause a disk which is spun\-down to be spun\-up when
451 \fBsmartd\fP checks it. This is the default behavior if the '\-n'
452 Directive is not given.
453
454 .I sleep
455 \- check the device unless it is in SLEEP mode.
456
457 .I standby
458 \- check the device unless it is in SLEEP or STANDBY mode. In
459 these modes most disks are not spinning, so if you want to prevent
460 a laptop disk from spinning up each time that \fBsmartd\fP polls,
461 this is probably what you want.
462
463 .I idle
464 \- check the device unless it is in SLEEP, STANDBY or IDLE mode.
465 In the IDLE state, most disks are still spinning, so this is probably
466 not what you want.
467
468 Maximum number of skipped checks (in a row) can be specified by
469 appending positive number \',N\' to POWERMODE (like \'\-n standby,15\').
470 After N checks are skipped in a row, powermode is ignored and the
471 check is performed anyway.
472
473 When a periodic test is skipped, \fBsmartd\fP normally writes an
474 informal log message. The message can be suppressed by appending
475 the option \',q\' to POWERMODE (like \'\-n standby,q\').
476 This prevents a laptop disk from spinning up due to this message.
477
478 Both \',N\' and \',q\' can be specified together.
479
480 .TP
481 .B \-T TYPE
482 Specifies how tolerant
483 \fBsmartd\fP
484 should be of SMART command failures. The valid arguments to this
485 Directive are:
486
487 .I normal
488 \- do not try to monitor the disk if a mandatory SMART command fails, but
489 continue if an optional SMART command fails. This is the default.
490
491 .I permissive
492 \- try to monitor the disk even if it appears to lack SMART
493 capabilities. This may be required for some old disks (prior to
494 ATA\-3 revision 4) that implemented SMART before the SMART standards
495 were incorporated into the ATA/ATAPI Specifications. This may also be
496 needed for some Maxtor disks which fail to comply with the ATA
497 Specifications and don't properly indicate support for error\- or
498 self\-test logging.
499
500 [Please see the \fBsmartctl \-T\fP command-line option.]
501 .TP
502 .B \-o VALUE
503 Enables or disables SMART Automatic Offline Testing when
504 \fBsmartd\fP
505 starts up and has no further effect. The valid arguments to this
506 Directive are \fIon\fP and \fIoff\fP.
507
508 The delay between tests is vendor-specific, but is typically four
509 hours.
510
511 Note that SMART Automatic Offline Testing is \fBnot\fP part of the ATA
512 Specification. Please see the
513 .B smartctl \-o
514 command-line option documentation for further information about this
515 feature.
516 .TP
517 .B \-S VALUE
518 Enables or disables Attribute Autosave when \fBsmartd\fP
519 starts up and has no further effect. The valid arguments to this
520 Directive are \fIon\fP and \fIoff\fP. Also affects SCSI devices.
521 [Please see the \fBsmartctl \-S\fP command-line option.]
522 .TP
523 .B \-H
524 Check the SMART health status of the disk. If any Prefailure
525 Attributes are less than or equal to their threshold values, then disk
526 failure is predicted in less than 24 hours, and a message at loglevel
527 .B \'LOG_CRITICAL\'
528 will be logged to syslog. [Please see the
529 .B smartctl \-H
530 command-line option.]
531 .TP
532 .B \-l TYPE
533 Reports increases in the number of errors in one of the two SMART logs. The
534 valid arguments to this Directive are:
535
536 .I error
537 \- report if the number of ATA errors reported in the ATA Error Log
538 has increased since the last check.
539
540 .I selftest
541 \- report if the number of failed tests reported in the SMART
542 Self-Test Log has increased since the last check, or if the timestamp
543 associated with the most recent failed test has increased. Note that
544 such errors will \fBonly\fP be logged if you run self-tests on the
545 disk (and it fails a test!). Self-Tests can be run automatically by
546 \fBsmartd\fP: please see the \fB\'\-s\'\fP Directive below.
547 Self-Tests can also be run manually by using the \fB\'\-t\ short\'\fP
548 and \fB\'\-t\ long\'\fP options of \fBsmartctl\fP and the results of
549 the testing can be observed using the \fBsmartctl \'\-l\ selftest\'\fP
550 command-line option.]
551
552 [Please see the \fBsmartctl \-l\fP and \fB\-t\fP command-line
553 options.]
554 .TP
555 .B \-s REGEXP
556 Run Self-Tests or Offline Immediate Tests, at scheduled times. A
557 Self- or Offline Immediate Test will be run at the end of periodic
558 device polling, if all 12 characters of the string \fBT/MM/DD/d/HH\fP
559 match the extended regular expression \fBREGEXP\fP. Here:
560 .RS 7
561 .IP \fBT\fP 4
562 is the type of the test. The values that \fBsmartd\fP will try to
563 match (in turn) are: \'L\' for a \fBL\fPong Self-Test, \'S\' for a
564 \fBS\fPhort Self-Test, \'C\' for a \fBC\fPonveyance Self-Test (ATA
565 only), and \'O\' for an \fBO\fPffline Immediate Test (ATA only). As
566 soon as a match is found, the test will be started and no additional
567 matches will be sought for that device and that polling cycle.
568
569 [NEW EXPERIMENTAL SMARTD FEATURE] To run scheduled Selective
570 Self-Tests, use \'n\' for \fBn\fPext span, \'r\' to \fBr\fPedo last
571 span, or \'c\' to \fBc\fPontinue with next span or redo last span
572 based on status of last test. The LBA range is based on the first
573 span from the last test.
574 See the \fBsmartctl \-t select,[next|redo|cont]\fP options for
575 further info.
576
577 .IP \fBMM\fP 4
578 is the month of the year, expressed with two decimal digits. The
579 range is from 01 (January) to 12 (December) inclusive. Do \fBnot\fP
580 use a single decimal digit or the match will always fail!
581 .IP \fBDD\fP 4
582 is the day of the month, expressed with two decimal digits. The
583 range is from 01 to 31 inclusive. Do \fBnot\fP
584 use a single decimal digit or the match will always fail!
585 .IP \fBd\fP 4
586 is the day of the week, expressed with one decimal digit. The
587 range is from 1 (Monday) to 7 (Sunday) inclusive.
588 .IP \fBHH\fP 4
589 is the hour of the day, written with two decimal digits, and given in
590 hours after midnight. The range is 00 (midnight to just before 1am)
591 to 23 (11pm to just before midnight) inclusive. Do \fBnot\fP use a
592 single decimal digit or the match will always fail!
593 .RE
594 .\" The following two lines are a workaround for a man2html bug. Please leave them.
595 .\" They define a non-existent option; useful because man2html can't correctly reset the margins.
596 .TP
597 .B \&
598 Some examples follow. In reading these, keep in mind that in extended
599 regular expressions a dot \fB\'.\'\fP matches any single character, and
600 a parenthetical expression such as \fB\'(A|B|C)\'\fP denotes any one of the three possibilities \fBA\fP,
601 \fBB\fP, or \fBC\fP.
602
603 To schedule a short Self-Test between 2-3am every morning, use:
604 .nf
605 \fB \-s S/../.././02\fP
606 .fi
607 To schedule a long Self-Test between 4-5am every Sunday morning, use:
608 .nf
609 \fB \-s L/../../7/04\fP
610 .fi
611 To schedule a long Self-Test between 10-11pm on the first and
612 fifteenth day of each month, use:
613 .nf
614 \fB \-s L/../(01|15)/./22\fP
615 .fi
616 To schedule an Offline Immediate test after every midnight, 6am,
617 noon,and 6pm, plus a Short Self-Test daily at 1-2am and a Long
618 Self-Test every Saturday at 3-4am, use:
619 .nf
620 \fB \-s (O/../.././(00|06|12|18)|S/../.././01|L/../../6/03)\fP
621 .fi
622 If Long Self-Tests of a large disks take longer than the system uptime,
623 a full disk test can be performed by several Selective Self-Tests.
624 To setup a full test of a 1TB disk within 20 days (one 50GB span
625 each day), run this command once:
626 .nf
627 smartctl -t select,0-99999999 /dev/sda
628 .fi
629 To run the next test spans on Monday-Friday between 12-13am, run smartd
630 with this directive:
631 .nf
632 \fB \-s n/../../[1-5]/12\fP
633 .fi
634
635
636 Scheduled tests are run immediately following the regularly-scheduled
637 device polling, if the current local date, time, and test type, match
638 \fBREGEXP\fP. By default the regularly-scheduled device polling
639 occurs every thirty minutes after starting \fBsmartd\fP. Take caution
640 if you use the \'\-i\' option to make this polling interval more than
641 sixty minutes: the poll times may fail to coincide with any of the
642 testing times that you have specified with \fBREGEXP\fP. In this case
643 the test will be run following the next device polling.
644
645 Before running an offline or self-test, \fBsmartd\fP checks to be sure
646 that a self-test is not already running. If a self-test \fBis\fP
647 already running, then this running self test will \fBnot\fP be
648 interrupted to begin another test.
649
650 \fBsmartd\fP will not attempt to run \fBany\fP type of test if another
651 test was already started or run in the same hour.
652
653 To avoid performance problems during system boot, \fBsmartd\fP will
654 not attempt to run any scheduled tests following the very first
655 device polling (unless \'\-q onecheck\' is specified).
656
657 Each time a test is run, \fBsmartd\fP will log an entry to SYSLOG.
658 You can use these or the '-q showtests' command-line option to verify
659 that you constructed \fBREGEXP\fP correctly. The matching order
660 (\fBL\fP before \fBS\fP before \fBC\fP before \fBO\fP) ensures that
661 if multiple test types are all scheduled for the same hour, the
662 longer test type has precedence. This is usually the desired behavior.
663
664 If the scheduled tests are used in conjunction with state persistence
665 (\'\-s\' option), smartd will also try to match the hours since last
666 shutdown (or 90 days at most). If any test would have been started
667 during downtime, the longest (see above) of these tests is run after
668 second device polling.
669
670 If the \'\-n\' directive is used and any test would have been started
671 during disk standby time, the longest of these tests is run when the
672 disk is active again.
673
674 Unix users: please beware that the rules for extended regular
675 expressions [regex(7)] are \fBnot\fP the same as the rules for
676 file\-name pattern matching by the shell [glob(7)]. \fBsmartd\fP will
677 issue harmless informational warning messages if it detects characters
678 in \fBREGEXP\fP that appear to indicate that you have made this
679 mistake.
680
681 .TP
682 .B \-m ADD
683 Send a warning email to the email address \fBADD\fP if the \'\-H\',
684 \'\-l\', \'\-f\', \'\-C\', or \'\-O\' Directives detect a failure or a
685 new error, or if a SMART command to the disk fails. This Directive
686 only works in conjunction with these other Directives (or with the
687 equivalent default \'\-a\' Directive).
688
689 To prevent your email in-box from getting filled up with warning
690 messages, by default only a single warning will be sent for each of
691 the enabled alert types, \'\-H\', \'\-l\', \'\-f\', \'\-C\', or
692 \'\-O\' even if more than one failure or error is detected or if the
693 failure or error persists. [This behavior can be modified; see the
694 \'\-M\' Directive below.]
695
696 To send email to more than one user, please use the following "comma
697 separated" form for the address: \fBuser1@add1,user2@add2,...,userN@addN\fP
698 (with no spaces).
699
700 To test that email is being sent correctly, use the \'\-M test\'
701 Directive described below to send one test email message on
702 \fBsmartd\fP
703 startup.
704
705 By default, email is sent using the system
706 .B mail
707 command. In order that
708 \fBsmartd\fP
709 find the mail command (normally /bin/mail) an executable named
710 .B \'mail\'
711 must be in the path of the shell or environment from which
712 \fBsmartd\fP
713 was started. If you wish to specify an explicit path to the mail
714 executable (for example /usr/local/bin/mail) or a custom script to
715 run, please use the \'\-M exec\' Directive below.
716
717 Note that by default under Solaris, in the previous paragraph,
718 \'\fBmailx\fP\' and \'\fB/bin/mailx\fP\' are used, since Solaris
719 \'/bin/mail\' does not accept a \'\-s\' (Subject) command-line
720 argument.
721
722 On Windows, the \'\fBBlat\fP\' mailer
723 (\fBhttp://blat.sourceforge.net/\fP) is used by default.
724 This mailer uses a different command line syntax, see
725 \'\-M exec\' below.
726
727 Note also that there is a special argument
728 .B <nomailer>
729 which can be given to the \'\-m\' Directive in conjunction with the \'\-M
730 exec\' Directive. Please see below for an explanation of its effect.
731
732 If the mailer or the shell running it produces any STDERR/STDOUT
733 output, then a snippet of that output will be copied to SYSLOG. The
734 remainder of the output is discarded. If problems are encountered in
735 sending mail, this should help you to understand and fix them. If
736 you have mail problems, we recommend running \fBsmartd\fP in debug
737 mode with the \'-d\' flag, using the \'-M test\' Directive described
738 below.
739
740 The following extension is available on Windows:
741 By specifying \'\fBmsgbox\fP\' as a mail address, a warning
742 "email" is displayed as a message box on the screen.
743 Using both \'\fBmsgbox\fP\' and regular mail addresses is possible,
744 if \'\fBmsgbox\fP\' is the first word in the comma separated list.
745 With \'\fBsysmsgbox\fP\', a system modal (always on top) message box
746 is used. If running as a service, a service notification message box
747 (always shown on current visible desktop) is used.
748
749 .TP
750 .B \-M TYPE
751 These Directives modify the behavior of the
752 \fBsmartd\fP
753 email warnings enabled with the \'\-m\' email Directive described above.
754 These \'\-M\' Directives only work in conjunction with the \'\-m\'
755 Directive and can not be used without it.
756
757 Multiple \-M Directives may be given. If more than one of the
758 following three \-M Directives are given (example: \-M once \-M daily)
759 then the final one (in the example, \-M daily) is used.
760
761 The valid arguments to the \-M Directive are (one of the following
762 three):
763
764 .I once
765 \- send only one warning email for each type of disk problem detected. This
766 is the default.
767
768 .I daily
769 \- send additional warning reminder emails, once per day, for each type
770 of disk problem detected.
771
772 .I diminishing
773 \- send additional warning reminder emails, after a one-day interval,
774 then a two-day interval, then a four-day interval, and so on for each
775 type of disk problem detected. Each interval is twice as long as the
776 previous interval.
777
778 In addition, one may add zero or more of the following Directives:
779
780 .I test
781 \- send a single test email
782 immediately upon
783 \fBsmartd\fP
784 startup. This allows one to verify that email is delivered correctly.
785 Note that if this Directive is used,
786 \fBsmartd\fP
787 will also send the normal email warnings that were enabled with the \'\-m\' Directive,
788 in addition to the single test email!
789
790 .I exec PATH
791 \- run the executable PATH instead of the default mail command, when
792 \fBsmartd\fP
793 needs to send email. PATH must point to an executable binary file or
794 script.
795
796 By setting PATH to point to a customized script, you can make
797 \fBsmartd\fP perform useful tricks when a disk problem is detected
798 (beeping the console, shutting down the machine, broadcasting warnings
799 to all logged-in users, etc.) But please be careful. \fBsmartd\fP
800 will \fBblock\fP until the executable PATH returns, so if your
801 executable hangs, then \fBsmartd\fP will also hang. Some sample
802 scripts are included in
803 /usr/local/share/doc/smartmontools-5.1/examplescripts/.
804
805 The return status of the executable is recorded by \fBsmartd\fP in
806 SYSLOG. The executable is not expected to write to STDOUT or
807 STDERR. If it does, then this is interpreted as indicating that
808 something is going wrong with your executable, and a fragment of this
809 output is logged to SYSLOG to help you to understand the problem.
810 Normally, if you wish to leave some record behind, the executable
811 should send mail or write to a file or device.
812
813 Before running the executable, \fBsmartd\fP sets a number of
814 environment variables. These environment variables may be used to
815 control the executable\'s behavior. The environment variables
816 exported by \fBsmartd\fP are:
817 .RS 7
818 .IP \fBSMARTD_MAILER\fP 4
819 is set to the argument of \-M exec, if present or else to \'mail\'
820 (examples: /bin/mail, mail).
821 .IP \fBSMARTD_DEVICE\fP 4
822 is set to the device path (examples: /dev/hda, /dev/sdb).
823 .IP \fBSMARTD_DEVICETYPE\fP 4
824 is set to the device type (possible values: ata, scsi, 3ware,N,
825 areca,N, hpt,L/M/N). Here N=0,...,127 denotes the ATA disk behind a
826 3ware RAID controller and L/M/N denotes the SATA disk behind a
827 HighPoint RocketRAID controller.
828 .IP \fBSMARTD_DEVICESTRING\fP 4
829 is set to the device description. For SMARTD_DEVICETYPE of ata or
830 scsi, this is the same as SMARTD_DEVICE. For 3ware RAID controllers,
831 the form used is \'/dev/sdc [3ware_disk_01]\'. For HighPoint
832 RocketRAID controller, the form is \'/dev/sdd [hpt_1/1/1]\' under Linux
833 or \'/dev/hptrr [hpt_1/1/1]\' under FreeBSD. For Areca controllers, the
834 form is \'/dev/sg2 [areca_disk_09]\'. In these cases the device string
835 contains a space and is NOT quoted. So to use $SMARTD_DEVICESTRING in a
836 bash script you should probably enclose it in double quotes.
837 .IP \fBSMARTD_FAILTYPE\fP 4
838 gives the reason for the warning or message email. The possible values that
839 it takes and their meanings are:
840 .nf
841 .fi
842 \fIEmailTest\fP: this is an email test message.
843 .nf
844 .fi
845 \fIHealth\fP: the SMART health status indicates imminent failure.
846 .nf
847 .fi
848 \fIUsage\fP: a usage Attribute has failed.
849 .nf
850 .fi
851 \fISelfTest\fP: the number of self-test failures has increased.
852 .nf
853 .fi
854 \fIErrorCount\fP: the number of errors in the ATA error log has increased.
855 .nf
856 .fi
857 \fICurrentPendingSector\fP: one of more disk sectors could not be
858 read and are marked to be reallocated (replaced with spare sectors).
859 .nf
860 .fi
861 \fIOfflineUncorrectableSector\fP: during off\-line testing, or self\-testing,
862 one or more disk sectors could not be read.
863 .nf
864 .fi
865 \fIFailedHealthCheck\fP: the SMART health status command failed.
866 .nf
867 .fi
868 \fIFailedReadSmartData\fP: the command to read SMART Attribute data failed.
869 .nf
870 .fi
871 \fIFailedReadSmartErrorLog\fP: the command to read the SMART error log failed.
872 .nf
873 .fi
874 \fIFailedReadSmartSelfTestLog\fP: the command to read the SMART self-test log failed.
875 .nf
876 .fi
877 \fIFailedOpenDevice\fP: the open() command to the device failed.
878 .IP \fBSMARTD_ADDRESS\fP 4
879 is determined by the address argument ADD of the \'\-m\' Directive.
880 If ADD is \fB<nomailer>\fP, then \fBSMARTD_ADDRESS\fP is not set.
881 Otherwise, it is set to the comma-separated-list of email addresses
882 given by the argument ADD, with the commas replaced by spaces
883 (example:admin@example.com root). If more than one email address is
884 given, then this string will contain space characters and is NOT
885 quoted, so to use it in a bash script you may want to enclose it in
886 double quotes.
887 .IP \fBSMARTD_MESSAGE\fP 4
888 is set to the one sentence summary warning email message string from
889 \fBsmartd\fP.
890 This message string contains space characters and is NOT quoted. So to
891 use $SMARTD_MESSAGE in a bash script you should probably enclose it in
892 double quotes.
893 .IP \fBSMARTD_FULLMESSAGE\fP 4
894 is set to the contents of the entire email warning message string from
895 \fBsmartd\fP.
896 This message string contains space and return characters and is NOT quoted. So to
897 use $SMARTD_FULLMESSAGE in a bash script you should probably enclose it in
898 double quotes.
899 .IP \fBSMARTD_TFIRST\fP 4
900 is a text string giving the time and date at which the first problem
901 of this type was reported. This text string contains space characters
902 and no newlines, and is NOT quoted. For example:
903 .nf
904 .fi
905 Sun Feb 9 14:58:19 2003 CST
906 .IP \fBSMARTD_TFIRSTEPOCH\fP 4
907 is an integer, which is the unix epoch (number of seconds since Jan 1,
908 1970) for \fBSMARTD_TFIRST\fP.
909 .RE
910 .\" The following two lines are a workaround for a man2html bug. Please leave them.
911 .\" They define a non-existent option; useful because man2html can't correctly reset the margins.
912 .TP
913 .B \&
914 The shell which is used to run PATH is system-dependent. For vanilla
915 Linux/glibc it\'s bash. For other systems, the man page for
916 \fBpopen\fP(3) should say what shell is used.
917
918 If the \'\-m ADD\' Directive is given with a normal address argument,
919 then the executable pointed to by PATH will be run in a shell with
920 STDIN receiving the body of the email message, and with the same
921 command-line arguments:
922 .nf
923 -s "$SMARTD_SUBJECT" $SMARTD_ADDRESS
924 .fi
925 that would normally be provided to \'mail\'. Examples include:
926 .nf
927 .B -m user@home -M exec /bin/mail
928 .B -m admin@work -M exec /usr/local/bin/mailto
929 .B -m root -M exec /Example_1/bash/script/below
930 .fi
931
932 Note that on Windows, the syntax of the \'\fBBlat\fP\' mailer is
933 used:
934 .nf
935 - -q -subject "$SMARTD_SUBJECT" -to "$SMARTD_ADDRESS"
936 .fi
937
938 If the \'\-m ADD\' Directive is given with the special address argument
939 .B <nomailer>
940 then the executable pointed to by PATH is run in a shell with
941 .B no
942 STDIN and
943 .B no
944 command-line arguments, for example:
945 .nf
946 .B -m <nomailer> -M exec /Example_2/bash/script/below
947 .fi
948 If the executable produces any STDERR/STDOUT output, then \fBsmartd\fP
949 assumes that something is going wrong, and a snippet of that output
950 will be copied to SYSLOG. The remainder of the output is then
951 discarded.
952
953 Some EXAMPLES of scripts that can be used with the \'\-M exec\'
954 Directive are given below. Some sample scripts are also included in
955 /usr/local/share/doc/smartmontools-5.1/examplescripts/.
956
957 .TP
958 .B \-f
959 Check for \'failure\' of any Usage Attributes. If these Attributes are
960 less than or equal to the threshold, it does NOT indicate imminent
961 disk failure. It "indicates an advisory condition where the usage or
962 age of the device has exceeded its intended design life period."
963 [Please see the \fBsmartctl \-A\fP command-line option.]
964 .TP
965 .B \-p
966 Report anytime that a Prefail Attribute has changed
967 its value since the last check, 30 minutes ago. [Please see the
968 .B smartctl \-A
969 command-line option.]
970 .TP
971 .B \-u
972 Report anytime that a Usage Attribute has changed its value
973 since the last check, 30 minutes ago. [Please see the
974 .B smartctl \-A
975 command-line option.]
976 .TP
977 .B \-t
978 Equivalent to turning on the two previous flags \'\-p\' and \'\-u\'.
979 Tracks changes in \fIall\fP device Attributes (both Prefailure and
980 Usage). [Please see the \fBsmartctl\fP \-A command-line option.]
981 .TP
982 .B \-i ID
983 Ignore device Attribute number \fBID\fP when checking for failure of
984 Usage Attributes. \fBID\fP must be a decimal integer in the range
985 from 1 to 255. This Directive modifies the behavior of the \'\-f\'
986 Directive and has no effect without it.
987
988 This is useful, for example, if you have a very old disk and don\'t
989 want to keep getting messages about the hours-on-lifetime Attribute
990 (usually Attribute 9) failing. This Directive may appear multiple
991 times for a single device, if you want to ignore multiple Attributes.
992 .TP
993 .B \-I ID
994 Ignore device Attribute \fBID\fP when tracking changes in the
995 Attribute values. \fBID\fP must be a decimal integer in the range
996 from 1 to 255. This Directive modifies the behavior of the \'\-p\',
997 \'\-u\', and \'\-t\' tracking Directives and has no effect without one
998 of them.
999
1000 This is useful, for example, if one of the device Attributes is the disk
1001 temperature (usually Attribute 194 or 231). It\'s annoying to get reports
1002 each time the temperature changes. This Directive may appear multiple
1003 times for a single device, if you want to ignore multiple Attributes.
1004 .TP
1005 .B \-r ID[!]
1006 When tracking, report the \fIRaw\fP value of Attribute \fBID\fP along
1007 with its (normally reported) \fINormalized\fP value. \fBID\fP must be
1008 a decimal integer in the range from 1 to 255. This Directive modifies
1009 the behavior of the \'\-p\', \'\-u\', and \'\-t\' tracking Directives
1010 and has no effect without one of them. This Directive may be given
1011 multiple times.
1012
1013 A common use of this Directive is to track the device Temperature
1014 (often ID=194 or 231).
1015
1016 If the optional flag \'!\' is appended, a change of the Normalized
1017 value is considered critical. The report will be logged as LOG_CRIT
1018 and a warning email will be sent if \'-m\' is specified.
1019
1020 .TP
1021 .B \-R ID[!]
1022 When tracking, report whenever the \fIRaw\fP value of Attribute
1023 \fBID\fP changes. (Normally \fBsmartd\fP only tracks/reports changes
1024 of the \fINormalized\fP Attribute values.) \fBID\fP must be a decimal
1025 integer in the range from 1 to 255. This Directive modifies the
1026 behavior of the \'\-p\', \'\-u\', and \'\-t\' tracking Directives and
1027 has no effect without one of them. This Directive may be given
1028 multiple times.
1029
1030 If this Directive is given, it automatically implies the \'\-r\'
1031 Directive for the same Attribute, so that the Raw value of the
1032 Attribute is reported.
1033
1034 A common use of this Directive is to track the device Temperature
1035 (often ID=194 or 231). It is also useful for understanding how
1036 different types of system behavior affects the values of certain
1037 Attributes.
1038
1039 If the optional flag \'!\' is appended, a change of the Raw
1040 value is considered critical. The report will be logged as
1041 LOG_CRIT and a warning email will be sent if \'-m\' is specified.
1042 An example is \'-R 5!\' to warn when new sectors are reallocated.
1043
1044 .TP
1045 .B \-C ID[+]
1046 [ATA only] Report if the current number of pending sectors is
1047 non-zero. Here \fBID\fP is the id number of the Attribute whose raw
1048 value is the Current Pending Sector count. The allowed range of
1049 \fBID\fP is 0 to 255 inclusive. To turn off this reporting, use
1050 ID\ =\ 0. If the \fB\-C ID\fP option is not given, then it defaults to
1051 \fB\-C 197\fP (since Attribute 197 is generally used to monitor
1052 pending sectors).
1053
1054 If \'+\' is specified, a report is only printed if the number of sectors
1055 has increased between two check cycles. Some disks do not reset this
1056 attribute when a bad sector is reallocated.
1057 See also \'\-v 197,increasing\' below.
1058
1059 A pending sector is a disk sector (containing 512 bytes of your data)
1060 which the device would like to mark as ``bad" and reallocate.
1061 Typically this is because your computer tried to read that sector, and
1062 the read failed because the data on it has been corrupted and has
1063 inconsistent Error Checking and Correction (ECC) codes. This is
1064 important to know, because it means that there is some unreadable data
1065 on the disk. The problem of figuring out what file this data belongs
1066 to is operating system and file system specific. You can typically
1067 force the sector to reallocate by writing to it (translation: make the
1068 device substitute a spare good sector for the bad one) but at the
1069 price of losing the 512 bytes of data stored there.
1070
1071 .TP
1072 .B \-U ID[+]
1073 [ATA only] Report if the number of offline uncorrectable sectors is
1074 non-zero. Here \fBID\fP is the id number of the Attribute whose raw
1075 value is the Offline Uncorrectable Sector count. The allowed range of
1076 \fBID\fP is 0 to 255 inclusive. To turn off this reporting, use
1077 ID\ =\ 0. If the \fB\-U ID\fP option is not given, then it defaults to
1078 \fB\-U 198\fP (since Attribute 198 is generally used to monitor
1079 offline uncorrectable sectors).
1080
1081 If \'+\' is specified, a report is only printed if the number of sectors
1082 has increased since the last check cycle. Some disks do not reset this
1083 attribute when a bad sector is reallocated.
1084 See also \'\-v 198,increasing\' below.
1085
1086 An offline uncorrectable sector is a disk sector which was not
1087 readable during an off\-line scan or a self\-test. This is important
1088 to know, because if you have data stored in this disk sector, and you
1089 need to read it, the read will fail. Please see the previous \'\-C\'
1090 option for more details.
1091
1092 .TP
1093 .B \-W DIFF[,INFO[,CRIT]]
1094 Report if the current temperature had changed by at least \fBDIFF\fP
1095 degrees since last report, or if new min or max temperature is detected.
1096 Report or Warn if the temperature is greater or equal than one of
1097 \fBINFO\fP or \fBCRIT\fP degrees Celsius.
1098 If the limit \fBCRIT\fP is reached, a message with loglevel
1099 \fB\'LOG_CRITICAL\'\fP will be logged to syslog and a warning email
1100 will be send if '-m' is specified. If only the limit \fBINFO\fP is
1101 reached, a message with loglevel \fB\'LOG_INFO\'\fP will be logged.
1102
1103 If this directive is used in conjunction with state persistence
1104 (\'\-s\' option), the min and max temperature values are preserved
1105 across boot cycles. The minimum temperature value is not updated
1106 during the first 30 minutes after startup.
1107
1108 To disable any of the 3 reports, set the corresponding limit to 0.
1109 Trailing zero arguments may be omitted. By default, all temperature
1110 reports are disabled (\'-W 0\').
1111
1112 To track temperature changes of at least 2 degrees, use:
1113 .nf
1114 \fB \-W 2
1115 .fi
1116 To log informal messages on temperatures of at least 40 degrees, use:
1117 .nf
1118 \fB \-W 0,40
1119 .fi
1120 For warning messages/mails on temperatures of at least 45 degrees, use:
1121 .nf
1122 \fB \-W 0,0,45
1123 .fi
1124 To combine all of the above reports, use:
1125 .nf
1126 \fB \-W 2,40,45
1127 .fi
1128
1129 For ATA devices, smartd interprets Attribute 194 as Temperature Celsius
1130 by default. This can be changed to Attribute 9 or 220 by the drive
1131 database or by the \'-v\' directive, see below.
1132
1133 .TP
1134 .B \-F TYPE
1135 [ATA only] Modifies the behavior of \fBsmartd\fP to compensate for
1136 some known and understood device firmware bug. The arguments to this
1137 Directive are exclusive, so that only the final Directive given is
1138 used. The valid values are:
1139
1140 .I none
1141 \- Assume that the device firmware obeys the ATA specifications. This is
1142 the default, unless the device has presets for \'\-F\' in the device
1143 database.
1144
1145 .I samsung
1146 \- In some Samsung disks (example: model SV4012H Firmware Version:
1147 RM100-08) some of the two- and four-byte quantities in the SMART data
1148 structures are byte-swapped (relative to the ATA specification).
1149 Enabling this option tells \fBsmartd\fP to evaluate these quantities
1150 in byte-reversed order. Some signs that your disk needs this option
1151 are (1) no self-test log printed, even though you have run self-tests;
1152 (2) very large numbers of ATA errors reported in the ATA error log;
1153 (3) strange and impossible values for the ATA error log timestamps.
1154
1155 .I samsung2
1156 \- In more recent Samsung disks (firmware revisions ending in "\-23") the
1157 number of ATA errors reported is byte swapped. Enabling this option
1158 tells \fBsmartd\fP to evaluate this quantity in byte-reversed order.
1159
1160 .I samsung3
1161 \- Some Samsung disks (at least SP2514N with Firmware VF100\-37) report
1162 a self\-test still in progress with 0% remaining when the test was already
1163 completed. If this directive is specified, \fBsmartd\fP will not skip the
1164 next scheduled self\-test (see Directive \'\-s\' above) in this case.
1165
1166 Note that an explicit \'\-F\' Directive will over-ride any preset
1167 values for \'\-F\' (see the \'\-P\' option below).
1168
1169
1170 [Please see the \fBsmartctl \-F\fP command-line option.]
1171
1172 .TP
1173 .B \-v N,OPTION
1174 Modifies the labeling for Attribute N, for disks which use
1175 non-standard Attribute definitions. This is useful in connection with
1176 the Attribute tracking/reporting Directives.
1177
1178 This Directive may appear multiple times. Valid arguments to this
1179 Directive are:
1180
1181 .I 9,minutes
1182 \- Raw Attribute number 9 is power-on time in minutes. Its raw value
1183 will be displayed in the form \'Xh+Ym\'. Here X is hours, and Y is
1184 minutes in the range 0-59 inclusive. Y is always printed with two
1185 digits, for example \'06\' or \'31\' or \'00\'.
1186
1187 .I 9,seconds
1188 \- Raw Attribute number 9 is power-on time in seconds. Its raw value
1189 will be displayed in the form \'Xh+Ym+Zs\'. Here X is hours, Y is
1190 minutes in the range 0-59 inclusive, and Z is seconds in the range
1191 0-59 inclusive. Y and Z are always printed with two digits, for
1192 example \'06\' or \'31\' or \'00\'.
1193
1194 .I 9,halfminutes
1195 \- Raw Attribute number 9 is power-on time, measured in units of 30
1196 seconds. This format is used by some Samsung disks. Its raw value
1197 will be displayed in the form \'Xh+Ym\'. Here X is hours, and Y is
1198 minutes in the range 0-59 inclusive. Y is always printed with two
1199 digits, for example \'06\' or \'31\' or \'00\'.
1200
1201 .I 9,temp
1202 \- Raw Attribute number 9 is the disk temperature in Celsius.
1203
1204 .I 192,emergencyretractcyclect
1205 \- Raw Attribute number 192 is the Emergency Retract Cycle Count.
1206
1207 .I 193,loadunload
1208 \- Raw Attribute number 193 contains two values. The first is the
1209 number of load cycles. The second is the number of unload cycles.
1210 The difference between these two values is the number of times that
1211 the drive was unexpectedly powered off (also called an emergency
1212 unload). As a rule of thumb, the mechanical stress created by one
1213 emergency unload is equivalent to that created by one hundred normal
1214 unloads.
1215
1216 .I 194,10xCelsius
1217 \- Raw Attribute number 194 is ten times the disk temperature in
1218 Celsius. This is used by some Samsung disks (example: model SV1204H
1219 with RK100-13 firmware).
1220
1221 .I 194,unknown
1222 \- Raw Attribute number 194 is NOT the disk temperature, and its
1223 interpretation is unknown. This is primarily useful for the -P
1224 (presets) Directive.
1225
1226 .I 197,increasing
1227 \- Raw Attribute number 197 (Current Pending Sector Count) is not
1228 reset if uncorrectable sectors are reallocated. This also sets
1229 \'-C 197+\' if no other \'-C\' directive is specified.
1230
1231 .I 198,increasing
1232 \- Raw Attribute number 198 (Offline Uncorrectable Sector Count) is not
1233 reset if uncorrectable sector are reallocated. This also sets
1234 \'-U 198+\' if no other \'-U\' directive is specified.
1235
1236 .I 198,offlinescanuncsectorct
1237 \- Raw Attribute number 198 is the Offline Scan UNC Sector Count.
1238
1239 .I 200,writeerrorcount
1240 \- Raw Attribute number 200 is the Write Error Count.
1241
1242 .I 201,detectedtacount
1243 \- Raw Attribute number 201 is the Detected TA Count.
1244
1245 .I 220,temp
1246 \- Raw Attribute number 220 is the disk temperature in Celsius.
1247
1248 Note: a table of hard drive models, listing which Attribute
1249 corresponds to temperature, can be found at:
1250 \fBhttp://www.guzu.net/linux/hddtemp.db\fP
1251
1252 .I N,raw8
1253 \- Print the Raw value of Attribute N as six 8-bit unsigned base-10
1254 integers. This may be useful for decoding the meaning of the Raw
1255 value. The form \'N,raw8\' prints Raw values for ALL Attributes in this
1256 form. The form (for example) \'123,raw8\' only prints the Raw value for
1257 Attribute 123 in this form.
1258
1259 .I N,raw16
1260 \- Print the Raw value of Attribute N as three 16-bit unsigned base-10
1261 integers. This may be useful for decoding the meaning of the Raw
1262 value. The form \'N,raw16\' prints Raw values for ALL Attributes in this
1263 form. The form (for example) \'123,raw16\' only prints the Raw value for
1264 Attribute 123 in this form.
1265
1266 .I N,raw48
1267 \- Print the Raw value of Attribute N as a 48-bit unsigned base-10
1268 integer. This may be useful for decoding the meaning of the Raw
1269 value. The form \'N,raw48\' prints Raw values for ALL Attributes in
1270 this form. The form (for example) \'123,raw48\' only prints the Raw
1271 value for Attribute 123 in this form.
1272
1273 .TP
1274 .B \-P TYPE
1275 Specifies whether
1276 \fBsmartd\fP
1277 should use any preset options that are available for this drive. The
1278 valid arguments to this Directive are:
1279
1280 .I use
1281 \- use any presets that are available for this drive. This is the default.
1282
1283 .I ignore
1284 \- do not use any presets for this drive.
1285
1286 .I show
1287 \- show the presets listed for this drive in the database.
1288
1289 .I showall
1290 \- show the presets that are available for all drives and then exit.
1291
1292 [Please see the
1293 .B smartctl \-P
1294 command-line option.]
1295
1296 .TP
1297 .B \-a
1298 Equivalent to turning on all of the following Directives:
1299 .B \'\-H\'
1300 to check the SMART health status,
1301 .B \'\-f\'
1302 to report failures of Usage (rather than Prefail) Attributes,
1303 .B \'\-t\'
1304 to track changes in both Prefailure and Usage Attributes,
1305 .B \'\-l\ selftest\'
1306 to report increases in the number of Self-Test Log errors,
1307 .B \'\-l\ error\'
1308 to report increases in the number of ATA errors,
1309 .B \'\-C 197\'
1310 to report nonzero values of the current pending sector count, and
1311 .B \'\-U 198\'
1312 to report nonzero values of the offline pending sector count.
1313
1314 Note that \-a is the default for ATA devices. If none of these other
1315 Directives is given, then \-a is assumed.
1316
1317 .TP
1318 .B #
1319 Comment: ignore the remainder of the line.
1320 .TP
1321 .B \e
1322 Continuation character: if this is the last non-white or non-comment
1323 character on a line, then the following line is a continuation of the current
1324 one.
1325 .PP
1326 If you are not sure which Directives to use, I suggest experimenting
1327 for a few minutes with
1328 .B smartctl
1329 to see what SMART functionality your disk(s) support(s). If you do
1330 not like voluminous syslog messages, a good choice of
1331 \fBsmartd\fP
1332 configuration file Directives might be:
1333 .nf
1334 .B \-H \-l\ selftest \-l\ error \-f.
1335 .fi
1336 If you want more frequent information, use:
1337 .B -a.
1338
1339 .TP
1340 .B ADDITIONAL DETAILS ABOUT DEVICESCAN
1341 If the first non-comment entry in the configuration file is the text
1342 string \fBDEVICESCAN\fP in capital letters, then \fBsmartd\fP will
1343 ignore any remaining lines in the configuration file, and will scan
1344 for devices.
1345
1346 If \fBDEVICESCAN\fP is not followed by any Directives, then smartd
1347 will scan for both ATA and SCSI devices, and will monitor all possible
1348 SMART properties of any devices that are found.
1349
1350 \fBDEVICESCAN\fP may optionally be followed by any valid Directives,
1351 which will be applied to all devices that are found in the scan. For
1352 example
1353 .nf
1354 .B DEVICESCAN -m root@example.com
1355 .fi
1356 will scan for all devices, and then monitor them. It will send one
1357 email warning per device for any problems that are found.
1358 .nf
1359 .B DEVICESCAN -d ata -m root@example.com
1360 .fi
1361 will do the same, but restricts the scan to ATA devices only.
1362 .nf
1363 .B DEVICESCAN -H -d ata -m root@example.com
1364 .fi
1365 will do the same, but only monitors the SMART health status of the
1366 devices, (rather than the default \-a, which monitors all SMART
1367 properties).
1368
1369 .TP
1370 .B EXAMPLES OF SHELL SCRIPTS FOR \'\-M exec\'
1371 These are two examples of shell scripts that can be used with the \'\-M
1372 exec PATH\' Directive described previously. The paths to these scripts
1373 and similar executables is the PATH argument to the \'\-M exec PATH\'
1374 Directive.
1375
1376 Example 1: This script is for use with \'\-m ADDRESS -M exec PATH\'. It appends
1377 the output of
1378 .B smartctl -a
1379 to the output of the smartd email warning message and sends it to ADDRESS.
1380
1381 .nf
1382 \fB
1383 #! /bin/bash
1384
1385 # Save the email message (STDIN) to a file:
1386 cat > /root/msg
1387
1388 # Append the output of smartctl -a to the message:
1389 /usr/local/sbin/smartctl -a -d $SMART_DEVICETYPE $SMARTD_DEVICE >> /root/msg
1390
1391 # Now email the message to the user at address ADD:
1392 /bin/mail -s "$SMARTD_SUBJECT" $SMARTD_ADDRESS < /root/msg
1393 \fP
1394 .fi
1395
1396 Example 2: This script is for use with \'\-m <nomailer> \-M exec
1397 PATH\'. It warns all users about a disk problem, waits 30 seconds, and
1398 then powers down the machine.
1399
1400 .nf
1401 \fB
1402 #! /bin/bash
1403
1404 # Warn all users of a problem
1405 wall \'Problem detected with disk: \' "$SMARTD_DEVICESTRING"
1406 wall \'Warning message from smartd is: \' "$SMARTD_MESSAGE"
1407 wall \'Shutting down machine in 30 seconds... \'
1408
1409 # Wait half a minute
1410 sleep 30
1411
1412 # Power down the machine
1413 /sbin/shutdown -hf now
1414 \fP
1415 .fi
1416
1417 Some example scripts are distributed with the smartmontools package,
1418 in /usr/local/share/doc/smartmontools-5.1/examplescripts/.
1419
1420 Please note that these scripts typically run as root, so any files
1421 that they read/write should not be writable by ordinary users or
1422 reside in directories like /tmp that are writable by ordinary users
1423 and may expose your system to symlink attacks.
1424
1425 As previously described, if the scripts write to STDOUT or STDERR,
1426 this is interpreted as indicating that there was an internal error
1427 within the script, and a snippet of STDOUT/STDERR is logged to SYSLOG.
1428 The remainder is flushed.
1429
1430 .\" ENDINCLUDE
1431 .\" DO NOT MODIFY THIS OR PREVIOUS/NEXT LINES. THIS DEFINES THE
1432 .\" END OF THE INCLUDED SECTION FROM smartd.8.in
1433
1434 .PP
1435 .SH AUTHOR
1436 \fBBruce Allen\fP smartmontools-support@lists.sourceforge.net
1437 .fi
1438 University of Wisconsin \- Milwaukee Physics Department
1439
1440 .PP
1441 .SH CONTRIBUTORS
1442 The following have made large contributions to smartmontools:
1443 .nf
1444 \fBCasper Dik\fP (Solaris SCSI interface)
1445 \fBChristian Franke\fP (Windows interface, C++ redesign, USB support, ...)
1446 \fBDouglas Gilbert\fP (SCSI subsystem)
1447 \fBGuido Guenther\fP (Autoconf/Automake packaging)
1448 \fBGeoffrey Keating\fP (Darwin ATA interface)
1449 \fBEduard Martinescu\fP (FreeBSD interface)
1450 \fBFr\*'ed\*'eric L. W. Meunier\fP (Web site and Mailing list)
1451 \fBGabriele Pohl\fP (Web site and Wiki, conversion from CVS to SVN)
1452 \fBKeiji Sawada\fP (Solaris ATA interface)
1453 \fBManfred Schwarb\fP (Drive database)
1454 \fBSergey Svishchev\fP (NetBSD interface)
1455 \fBDavid Snyder and Sergey Svishchev\fP (OpenBSD interface)
1456 \fBPhil Williams\fP (User interface and drive database)
1457 \fBShengfeng Zhou\fP (Linux/FreeBSD HighPoint RocketRAID interface)
1458 .fi
1459 Many other individuals have made smaller contributions and corrections.
1460
1461 .PP
1462 .SH CREDITS
1463 .fi
1464 This code was derived from the smartsuite package, written by Michael
1465 Cornwell, and from the previous ucsc smartsuite package. It extends
1466 these to cover ATA-5 disks. This code was originally developed as a
1467 Senior Thesis by Michael Cornwell at the Concurrent Systems Laboratory
1468 (now part of the Storage Systems Research Center), Jack Baskin School
1469 of Engineering, University of California, Santa
1470 Cruz. \fBhttp://ssrc.soe.ucsc.edu/\fP .
1471 .SH
1472 HOME PAGE FOR SMARTMONTOOLS:
1473 .fi
1474 Please see the following web site for updates, further documentation, bug
1475 reports and patches:
1476 .nf
1477 .B
1478 http://smartmontools.sourceforge.net/
1479
1480 .SH
1481 SEE ALSO:
1482 \fBsmartd\fP(8), \fBsmartctl\fP(8), \fBsyslogd\fP(8),
1483 \fBsyslog.conf\fP(5), \fBbadblocks\fP(8), \fBide\-smart\fP(8), \fBregex\fP(7).
1484
1485 .SH
1486 SVN ID OF THIS PAGE:
1487 $Id: smartd.conf.5.in 2921 2009-09-20 19:19:32Z samm2 $