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