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