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