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