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