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