]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - smartd.conf.5.in
import smartmontools 7.0
[mirror_smartmontools-debian.git] / smartd.conf.5.in
CommitLineData
832b75ed 1.ig
a86ec89e 2Copyright (C) 2002-10 Bruce Allen
ff28b140 3Copyright (C) 2004-18 Christian Franke
832b75ed 4
ff28b140 5SPDX-License-Identifier: GPL-2.0-or-later
832b75ed 6
ff28b140 7$Id: smartd.conf.5.in 4856 2018-12-11 21:42:16Z chrfranke $
ee38a438 8
832b75ed 9..
f9e10201
JD
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 '
a86ec89e 27.TH SMARTD.CONF 5 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools"
832b75ed
GG
28.SH NAME
29\fBsmartd.conf\fP \- SMART Disk Monitoring Daemon Configuration File\fP
ff28b140 30.Sp
832b75ed 31.SH DESCRIPTION
d008864d
GI
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
832b75ed 37\fB/usr/local/etc/smartd.conf\fP is the configuration file for the \fBsmartd\fP
ee38a438 38daemon.
f9e10201 39.PP
832b75ed 40If the configuration file \fB/usr/local/etc/smartd.conf\fP is present,
f9e10201
JD
41\fBsmartd\fP reads it at startup.
42If \fBsmartd\fP subsequently receives a \fBHUP\fP signal,
832b75ed
GG
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
f9e10201
JD
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
832b75ed 47running.
f9e10201 48.PP
d008864d 49In the absence of a configuration file
ee38a438
GI
50\fBsmartd\fP will try to open all available devices
51(see \fBsmartd\fP(8) man page).
f9e10201 52A configuration file with a single line \fB\*(AqDEVICESCAN \-a\*(Aq\fP
ee38a438 53would have the same effect.
f9e10201 54.PP
832b75ed
GG
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
ee38a438 57problems, you may be annoyed by the string of error log messages about devices
f9e10201
JD
58that can't be opened.
59.PP
832b75ed
GG
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
f9e10201
JD
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:
832b75ed
GG
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
f9e10201 77Any text following a hash sign \*(Aq#\*(Aq and up to the end of the line is
832b75ed
GG
78taken to be a comment, and ignored.
79.IP \(bu 4
f9e10201 80Lines may be continued by using a backslash \*(Aq\e\*(Aq as the last
832b75ed
GG
81non-whitespace or non-comment item on a line.
82.IP \(bu 4
f9e10201 83Note: a line whose first character is a hash sign \*(Aq#\*(Aq is treated as
832b75ed
GG
84a white-space blank line, \fBnot\fP as a non-existent line, and will
85\fBend\fP a continuation line.
d2e702cf 86.PP
f9e10201
JD
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
832b75ed
GG
89of the
90.B DIRECTIVES
91Section below!
f9e10201
JD
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
d008864d 119.\" %IF OS Linux
f9e10201
JD
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
d008864d 135.\" %ENDIF OS Linux
f9e10201
JD
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
ee38a438 142.\" %IF OS Linux
f9e10201
JD
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
ee38a438
GI
146.\" %ENDIF OS Linux
147.\" %IF OS FreeBSD
f9e10201
JD
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
ee38a438 151.\" %ENDIF OS FreeBSD
f9e10201
JD
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
d008864d 158.\" %IF OS Linux
f9e10201
JD
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
d008864d
GI
163.\" %ENDIF OS Linux
164.\" %IF OS FreeBSD
f9e10201
JD
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
d008864d 169.\" %ENDIF OS FreeBSD
f9e10201
JD
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
d008864d 176.\" %IF OS Linux
f9e10201
JD
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
d008864d
GI
180.\" %ENDIF OS Linux
181.\" %IF OS FreeBSD
f9e10201
JD
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
d008864d 185.\" %ENDIF OS FreeBSD
f9e10201
JD
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
d008864d 192.\" %IF OS Linux
f9e10201
JD
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
d008864d
GI
197.\" %ENDIF OS Linux
198.\" %IF OS FreeBSD
f9e10201
JD
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
d008864d 203.\" %ENDIF OS FreeBSD
f9e10201
JD
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
ff28b140 229.SH DEVICESCAN
7f0798ef 230If a non-comment entry in the configuration file is the text string
832b75ed
GG
231.B DEVICESCAN
232in capital letters, then
233\fBsmartd\fP
234will ignore any remaining lines in the configuration file, and will
235scan for devices.
ff28b140
TL
236If
237.B DEVICESCAN
238is not followed by any Directives, then \*(Aq\-a\*(Aq will apply to all
239devices.
240.PP
832b75ed
GG
241.B DEVICESCAN
242may optionally be followed by Directives that will apply to all
ff28b140
TL
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
f9e10201 266.PP
ff28b140
TL
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
d2e702cf 289If an entry in the configuration file starts with
d008864d
GI
290.B DEFAULT
291instead of a device name, then all directives in this entry are set
292as defaults for the next device entries.
d2e702cf 293.PP
d008864d 294This configuration:
d2e702cf 295.PP
f9e10201
JD
296.Vb 7
297\ \ DEFAULT \-a \-R5! \-W 2,40,45 \-I 194 \-s L/../../7/00 \-m admin@example.com
d008864d
GI
298\ \ /dev/sda
299\ \ /dev/sdb
300\ \ /dev/sdc
f9e10201 301\ \ DEFAULT \-H \-m admin@example.com
d008864d 302\ \ /dev/sdd
f9e10201
JD
303\ \ /dev/sde \-d removable
304.Ve
d2e702cf 305.PP
d008864d 306has the same effect as:
d2e702cf 307.PP
f9e10201
JD
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
ff28b140
TL
315.Sp
316.SH CONFIGURATION FILE DIRECTIVES
832b75ed
GG
317The following are the Directives that may appear following the device
318name or
319.B DEVICESCAN
d008864d
GI
320or
321.B DEFAULT
832b75ed
GG
322on any line of the
323.B /usr/local/etc/smartd.conf
f9e10201
JD
324configuration file. Note that
325.B these are NOT command-line options for
832b75ed
GG
326\fBsmartd\fP.
327The Directives below may appear in any order, following the device
f9e10201
JD
328name.
329.PP
832b75ed
GG
330.B For an ATA device,
331if no Directives appear, then the device will be monitored
f9e10201
JD
332as if the \*(Aq\-a\*(Aq Directive (monitor all SMART properties) had been given.
333.PP
832b75ed
GG
334.B If a SCSI disk is listed,
335it will be monitored at the maximum implemented level: roughly
f9e10201
JD
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
832b75ed 341status fails, or if new errors appear in the self-test log.
f9e10201
JD
342.\" %IF OS FreeBSD Linux
343.PP
832b75ed 344.B If a 3ware controller is used
cfbba5b9 345then the corresponding SCSI (/dev/sd?) or character device (/dev/twe?,
f9e10201
JD
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
2127e193 352.B If an Areca controller is used
f9e10201
JD
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).
d008864d
GI
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
2127e193 358these disks. Areca firmware version 1.46 or later which supports
bed94269
GI
359smartmontools must be used; Please see the \fBsmartctl\fP(8) man page
360for further details.
f9e10201 361.\" %ENDIF OS FreeBSD Linux
832b75ed
GG
362.TP
363.B \-d TYPE
cfbba5b9
GI
364Specifies the type of the device.
365The valid arguments to this directive are:
f9e10201 366.Sp
cfbba5b9 367.I auto
ee38a438 368\- attempt to guess the device type from the device name or from
cfbba5b9
GI
369controller type info provided by the operating system or from
370a matching USB ID entry in the drive database.
371This is the default.
f9e10201 372.Sp
832b75ed
GG
373.I ata
374\- the device type is ATA. This prevents
375\fBsmartd\fP
376from issuing SCSI commands to an ATA device.
f9e10201 377.Sp
d008864d 378.\" %IF NOT OS Darwin
832b75ed
GG
379.I scsi
380\- the device type is SCSI. This prevents
381\fBsmartd\fP
382from issuing ATA commands to a SCSI device.
f9e10201 383.Sp
a86ec89e 384.\" %ENDIF NOT OS Darwin
f9e10201 385.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
a86ec89e 386.I nvme[,NSID]
ff28b140 387\- the device type is NVM Express (NVMe).
a86ec89e
GI
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.
f9e10201
JD
392.Sp
393.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
a86ec89e 394.\" %IF NOT OS Darwin
d008864d 395.I sat[,auto][,N]
4d59bff9 396\- the device type is SCSI to ATA Translation (SAT).
f9e10201
JD
397This is for ATA disks that have a SCSI to ATA Translation Layer (SATL)
398between the disk and the operating system.
cfbba5b9
GI
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
f9e10201
JD
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 ").
d008864d 405Otherwise device type SCSI (for SCSI/SAS disks) is used.
f9e10201 406.Sp
cfbba5b9
GI
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
f9e10201 411with \*(Aq\-d usbcypress,0xN\*(Aq, where N is the scsi operation code,
cfbba5b9 412you're running the risk of damage to the device or filesystems on it.
f9e10201 413.Sp
ee38a438
GI
414.I usbjmicron[,p][,x][,PORT]
415\- this device type is for SATA disks that are behind a JMicron USB to
f9e10201
JD
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
cfbba5b9
GI
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.
f9e10201 426CAUTION: Specifying \*(Aq,x\*(Aq for a device which does not support it results
cfbba5b9
GI
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.
f9e10201 429.Sp
ee38a438 430The Prolific PL2507/3507 USB bridges with older firmware support a pass-through
f9e10201 431command similar to JMicron and work with \*(Aq\-d usbjmicron,0\*(Aq.
ee38a438 432Newer Prolific firmware requires a modified command which can be selected by
f9e10201 433\*(Aq\-d usbjmicron,p\*(Aq.
ee38a438 434Note that this does not yet support the SMART status command.
f9e10201 435.Sp
a86ec89e 436.I usbprolific
f9e10201
JD
437\- this device type is for SATA disks that are behind a Prolific
438PL2571/2771/2773/2775 USB to SATA bridge.
439.Sp
cfbba5b9
GI
440.I usbsunplus
441\- this device type is for SATA disks that are behind a SunplusIT USB to SATA
442bridge.
f9e10201 443.Sp
ff28b140
TL
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
d008864d
GI
452.\" %ENDIF NOT OS Darwin
453.\" %IF OS Linux
832b75ed 454.I marvell
cfbba5b9 455\- [Linux only] interact with SATA disks behind Marvell chip-set
832b75ed 456controllers (using the Marvell rather than libata driver).
f9e10201 457.Sp
2127e193 458.I megaraid,N
cfbba5b9
GI
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.
2127e193
GI
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.
f9e10201 465It is possible to set RAID device name as /dev/bus/N, where N is a SCSI bus
ee38a438 466number.
cfbba5b9 467Please see the \fBsmartctl\fP(8) man page for further details.
f9e10201 468.Sp
a86ec89e
GI
469.\" %ENDIF OS Linux
470.\" %IF OS Linux Windows Cygwin
d2e702cf 471.I aacraid,H,L,ID
f9e10201 472\- [Linux, Windows and Cygwin only] the device consists of one or more
ff28b140 473SCSI/SAS or SATA disks connected to an AacRaid controller.
d2e702cf
GI
474The non-negative integers H,L,ID (Host number, Lun, ID) denote which disk
475on the controller is monitored.
f9e10201
JD
476In log files and email messages this disk will be identified as
477aacraid_disk_HH_LL_ID.
d2e702cf 478Please see the \fBsmartctl\fP(8) man page for further details.
f9e10201 479.Sp
a86ec89e 480.\" %ENDIF OS Linux Windows Cygwin
d008864d 481.\" %IF OS FreeBSD Linux
832b75ed 482.I 3ware,N
cfbba5b9
GI
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
2127e193 488with XXX in the range from 000 to 127 inclusive.
f9e10201 489.Sp
cfbba5b9
GI
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
832b75ed 492messages will make the most sense if you always list the 3ware SCSI
cfbba5b9
GI
493logical device corresponding to the particular physical disks.
494Please see the \fBsmartctl\fP(8) man page for further details.
f9e10201 495.Sp
d008864d 496.\" %ENDIF OS FreeBSD Linux
f4e463df 497.\" %IF OS FreeBSD Linux Windows Cygwin
2127e193 498.I areca,N
f9e10201
JD
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
2127e193 504areca_disk_XX with XX in the range from 01 to 24 inclusive.
cfbba5b9 505Please see the \fBsmartctl\fP(8) man page for further details.
f9e10201 506.Sp
f4e463df 507.I areca,N/E
a86ec89e
GI
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.
f4e463df
GI
510The integer N (range 1 to 128) denotes the channel (slot) and E (range
5111 to 8) denotes the enclosure.
ee38a438 512Important: This requires Areca SAS controller firmware version 1.51 or later.
f9e10201 513.Sp
f4e463df 514.\" %ENDIF OS FreeBSD Linux Windows Cygwin
d008864d 515.\" %IF OS FreeBSD Linux
ba59cff1 516.I cciss,N
f9e10201
JD
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.
cfbba5b9 521In log files and email messages this disk will be identified as cciss_disk_XX
ba59cff1 522with XX in the range from 00 to 15 inclusive.
cfbba5b9 523Please see the \fBsmartctl\fP(8) man page for further details.
f9e10201 524.Sp
4d59bff9 525.I hpt,L/M/N
cfbba5b9
GI
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
3d17a85c 530from 1 to 4 inclusive, M are from 1 to 128 inclusive and N from 1 to 4
cfbba5b9
GI
531if PMPort available. And also these values are limited by the model
532of the HighPoint RocketRAID controller.
4d59bff9
GG
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.
cfbba5b9 536Please see the \fBsmartctl\fP(8) man page for further details.
f9e10201 537.Sp
d008864d 538.\" %ENDIF OS FreeBSD Linux
f9e10201
JD
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
ee38a438 545.I ignore
a86ec89e 546\- the device specified by this configuration entry should be ignored.
ee38a438
GI
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.
f9e10201
JD
550This Directive may be used in conjunction with the other \*(Aq\-d\*(Aq
551Directives.
552.Sp
832b75ed
GG
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
f9e10201
JD
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
832b75ed 565.TP
2127e193 566.B \-n POWERMODE[,N][,q]
f9e10201 567[ATA only] This \*(Aqnocheck\*(Aq Directive is used to prevent a disk from
cfbba5b9 568being spun-up when it is periodically polled by \fBsmartd\fP.
f9e10201
JD
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
ee38a438 578be spun up and put into a higher-power mode when it is periodically
832b75ed 579polled by \fBsmartd\fP.
f9e10201 580.Sp
832b75ed
GG
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
f9e10201 583be registered as a device for \fBsmartd\fP to monitor. If a disk is in
ee38a438
GI
584any other low-power mode, then the commands issued by \fBsmartd\fP to
585register the disk will probably cause it to spin-up.
f9e10201
JD
586.Sp
587The \*(Aq\fB\-n\fP\*(Aq (nocheck) Directive specifies if \fBsmartd\fP's
832b75ed 588periodic checks should still be carried out when the device is in a
ee38a438 589low-power mode. It may be used to prevent a disk from being spun-up
832b75ed
GG
590by periodic \fBsmartd\fP polling. The allowed values of POWERMODE
591are:
f9e10201 592.Sp
832b75ed
GG
593.I never
594\- \fBsmartd\fP will poll (check) the device regardless of its power
f9e10201 595mode. This may cause a disk which is spun-down to be spun-up when
832b75ed
GG
596\fBsmartd\fP checks it. This is the default behavior if the '\-n'
597Directive is not given.
f9e10201 598.Sp
832b75ed
GG
599.I sleep
600\- check the device unless it is in SLEEP mode.
f9e10201 601.Sp
832b75ed
GG
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.
f9e10201 607.Sp
832b75ed
GG
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.
f9e10201 612.Sp
2127e193 613Maximum number of skipped checks (in a row) can be specified by
f9e10201
JD
614appending positive number \*(Aq,N\*(Aq to POWERMODE (like
615\*(Aq\-n standby,15\*(Aq).
2127e193
GI
616After N checks are skipped in a row, powermode is ignored and the
617check is performed anyway.
f9e10201 618.Sp
832b75ed 619When a periodic test is skipped, \fBsmartd\fP normally writes an
f9e10201
JD
620informal log message. The message can be suppressed by appending
621the option \*(Aq,q\*(Aq to POWERMODE (like \*(Aq\-n standby,q\*(Aq).
832b75ed 622This prevents a laptop disk from spinning up due to this message.
f9e10201
JD
623.Sp
624Both \*(Aq,N\*(Aq and \*(Aq,q\*(Aq can be specified together.
832b75ed
GG
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:
f9e10201 631.Sp
832b75ed
GG
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.
f9e10201 635.Sp
832b75ed
GG
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
ee38a438
GI
639ATA-3 revision 4) that implemented SMART before the SMART standards
640were incorporated into the ATA/ATAPI Specifications.
832b75ed
GG
641[Please see the \fBsmartctl \-T\fP command-line option.]
642.TP
643.B \-o VALUE
cfbba5b9 644[ATA only] Enables or disables SMART Automatic Offline Testing when
832b75ed
GG
645\fBsmartd\fP
646starts up and has no further effect. The valid arguments to this
647Directive are \fIon\fP and \fIoff\fP.
f9e10201 648.Sp
832b75ed
GG
649The delay between tests is vendor-specific, but is typically four
650hours.
f9e10201 651.Sp
832b75ed
GG
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
a86ec89e
GI
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
832b75ed 668failure is predicted in less than 24 hours, and a message at loglevel
f9e10201 669.B \*(AqLOG_CRIT\*(Aq
832b75ed
GG
670will be logged to syslog. [Please see the
671.B smartctl \-H
672command-line option.]
f9e10201
JD
673.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
674.Sp
ff28b140
TL
675[NVMe] Checks the "Critical Warning" byte from the SMART/Health
676Information log.
f9e10201 677If any warning bit is set, a message at loglevel \fB\*(AqLOG_CRIT\*(Aq\fP
a86ec89e 678will be logged to syslog.
f9e10201 679.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
832b75ed
GG
680.TP
681.B \-l TYPE
e9583e0c 682Reports increases in the number of errors in one of three SMART logs. The
832b75ed 683valid arguments to this Directive are:
f9e10201 684.Sp
832b75ed 685.I error
a86ec89e 686\- [ATA] report if the number of ATA errors reported in the Summary SMART
cfbba5b9 687error log has increased since the last check.
f9e10201
JD
688.Sp
689.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
a86ec89e 690.I error
ff28b140 691\- [NVMe] report if the "Number of Error Information Log Entries" from the
a86ec89e 692SMART/Health Information log has increased since the last check.
f9e10201
JD
693.Sp
694.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
e9583e0c 695.I xerror
a86ec89e 696\- [ATA] report if the number of ATA errors reported in the Extended
d008864d 697Comprehensive SMART error log has increased since the last check.
f9e10201
JD
698.Sp
699If both \*(Aq\-l error\*(Aq and \*(Aq\-l xerror\*(Aq are specified, smartd
700checks the maximum of both values.
701.Sp
e9583e0c 702[Please see the \fBsmartctl \-l xerror\fP command-line option.]
f9e10201
JD
703.Sp
704.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
a86ec89e 705.I xerror
ff28b140 706\- [NVMe] same as \*(Aq\-l error\*(Aq.
f9e10201
JD
707.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
708.Sp
832b75ed
GG
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
f9e10201
JD
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
cfbba5b9 719command-line option.
832b75ed
GG
720[Please see the \fBsmartctl \-l\fP and \fB\-t\fP command-line
721options.]
f9e10201 722.Sp
cfbba5b9 723[ATA only] Failed self-tests outdated by a newer successful extended
ee38a438 724self-test are ignored. The warning email counter is reset if the
d008864d 725number of failed self tests dropped to 0. This typically happens when
ee38a438 726an extended self-test is run after all bad sectors have been reallocated.
f9e10201 727.Sp
d008864d
GI
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,
f9e10201 732therefore \*(Aq\-l offlinests\*(Aq is not enabled by \*(Aq\-a\*(Aq Directive.
d008864d 733.\" %IF NOT OS Cygwin Windows
f9e10201 734.\"! Appending ',ns' (no standby) to this directive is not implemented
d008864d
GI
735.\"! on OS_MAN_FILTER.
736.\" %ENDIF NOT OS Cygwin Windows
737.\" %IF OS Cygwin Windows
f9e10201
JD
738.Sp
739[Windows and Cygwin only] If \*(Aq,ns\*(Aq (no standby) is appended to this
d008864d 740directive, smartd disables system auto standby as long as an Offline
f9e10201 741Data Collection is in progress. See \*(Aq\-l selfteststs,ns\*(Aq below.
d008864d 742.\" %ENDIF OS Cygwin Windows
f9e10201 743.Sp
d008864d
GI
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
f9e10201 749.\"! Appending ',ns' (no standby) to this directive is not implemented
d008864d
GI
750.\"! on OS_MAN_FILTER.
751.\" %ENDIF NOT OS Cygwin Windows
752.\" %IF OS Cygwin Windows
f9e10201
JD
753.Sp
754[Windows and Cygwin only] If \*(Aq,ns\*(Aq (no standby) is appended to this
d008864d
GI
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
f9e10201 758interval (\*(Aq\-i\*(Aq option) should be shorter than the configured idle
d008864d
GI
759timeout. Auto standby is not disabled if the system is running on
760battery.
761.\" %ENDIF OS Cygwin Windows
f9e10201 762.Sp
cfbba5b9 763.I scterc,READTIME,WRITETIME
f4e463df
GI
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.
cfbba5b9
GI
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.]
d008864d 770.TP
ee38a438
GI
771.B \-e NAME[,VALUE]
772Sets non-SMART device settings when \fBsmartd\fP starts up and has no
773further effect.
d008864d
GI
774[Please see the \fBsmartctl \-\-set\fP command-line option.]
775Valid arguments are:
f9e10201 776.Sp
d008864d
GI
777.I aam,[N|off]
778\- [ATA only] Sets the Automatic Acoustic Management (AAM) feature.
f9e10201 779.Sp
d008864d
GI
780.I apm,[N|off]
781\- [ATA only] Sets the Advanced Power Management (APM) feature.
f9e10201 782.Sp
d008864d
GI
783.I lookahead,[on|off]
784\- [ATA only] Sets the read look-ahead feature.
f9e10201 785.Sp
d008864d
GI
786.I security-freeze
787\- [ATA only] Sets ATA Security feature to frozen mode.
f9e10201 788.Sp
d008864d
GI
789.I standby,[N|off]
790\- [ATA only] Sets the standby (spindown) timer and places the drive in the
791IDLE mode.
f9e10201 792.Sp
d008864d
GI
793.I wcache,[on|off]
794\- [ATA only] Sets the volatile write cache feature.
f9e10201
JD
795.Sp
796.I dsn,[on|off]
797\- [ATA only]
798[NEW EXPERIMENTAL SMARTD FEATURE]
799Sets the DSN feature.
832b75ed
GG
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
f9e10201 805match the extended regular expression \fBREGEXP\fP. Here:
832b75ed
GG
806.RS 7
807.IP \fBT\fP 4
808is the type of the test. The values that \fBsmartd\fP will try to
f9e10201
JD
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
832b75ed
GG
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.
f9e10201
JD
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.
cfbba5b9 818The LBA range is based on the first span from the last test.
2127e193
GI
819See the \fBsmartctl \-t select,[next|redo|cont]\fP options for
820further info.
f9e10201
JD
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
f4e463df
GI
824test span is preserved by smartd and used if (and only if) the selective
825self test log is empty.
832b75ed
GG
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
f9e10201 831is the day of the month, expressed with two decimal digits. The
832b75ed
GG
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
f9e10201 839hours after midnight. The range is 00 (midnight to just before 1 am)
832b75ed
GG
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
f9e10201
JD
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
832b75ed 854\fB \-s S/../.././02\fP
f9e10201
JD
855.br
856To schedule a long Self-Test between 4\(en5 am every Sunday morning, use:
857.br
832b75ed 858\fB \-s L/../../7/04\fP
f9e10201
JD
859.br
860To schedule a long Self-Test between 10\(en11 pm on the first and
832b75ed 861fifteenth day of each month, use:
f9e10201 862.br
832b75ed 863\fB \-s L/../(01|15)/./22\fP
f9e10201
JD
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
832b75ed 869\fB \-s (O/../.././(00|06|12|18)|S/../.././01|L/../../6/03)\fP
f9e10201 870.br
2127e193
GI
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.
f9e10201 873To setup a full test of a 1 TB disk within 20 days (one 50 GB span
2127e193
GI
874each day), run this command once:
875.nf
f9e10201 876 smartctl \-t select,0\-99999999 /dev/sda
2127e193 877.fi
f9e10201 878To run the next test spans on Monday\(enFriday between 12\(en13 am, run smartd
2127e193 879with this directive:
f9e10201
JD
880.br
881\fB \-s n/../../[1\-5]/12\fP
882.Sp
832b75ed
GG
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
f9e10201 887if you use the \*(Aq\-i\*(Aq option to make this polling interval more than
832b75ed 888sixty minutes: the poll times may fail to coincide with any of the
2127e193
GI
889testing times that you have specified with \fBREGEXP\fP. In this case
890the test will be run following the next device polling.
f9e10201 891.Sp
832b75ed
GG
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.
f9e10201 896.Sp
832b75ed
GG
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.
f9e10201 899.Sp
a37e7145
GG
900To avoid performance problems during system boot, \fBsmartd\fP will
901not attempt to run any scheduled tests following the very first
f9e10201
JD
902device polling (unless \*(Aq\-q onecheck\*(Aq is specified).
903.Sp
832b75ed 904Each time a test is run, \fBsmartd\fP will log an entry to SYSLOG.
f9e10201 905You can use these or the \*(Aq\-q showtests\*(Aq command-line option to verify
832b75ed
GG
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.
f9e10201 910.Sp
2127e193 911If the scheduled tests are used in conjunction with state persistence
f9e10201
JD
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
2127e193
GI
914during downtime, the longest (see above) of these tests is run after
915second device polling.
f9e10201
JD
916.Sp
917If the \*(Aq\-n\*(Aq directive is used and any test would have been started
2127e193
GI
918during disk standby time, the longest of these tests is run when the
919disk is active again.
f9e10201 920.Sp
832b75ed 921Unix users: please beware that the rules for extended regular
d2e702cf
GI
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
832b75ed
GG
924issue harmless informational warning messages if it detects characters
925in \fBREGEXP\fP that appear to indicate that you have made this
926mistake.
832b75ed
GG
927.TP
928.B \-m ADD
f9e10201
JD
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
832b75ed 935To prevent your email in-box from getting filled up with warning
f9e10201
JD
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
832b75ed
GG
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).
f9e10201
JD
944.Sp
945To test that email is being sent correctly, use the \*(Aq\-M test\*(Aq
832b75ed
GG
946Directive described below to send one test email message on
947\fBsmartd\fP
948startup.
f9e10201 949.Sp
d2e702cf
GI
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
832b75ed
GG
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
f9e10201
JD
956run, please use the \*(Aq\-M exec\*(Aq Directive below.
957.Sp
d008864d 958.\" %IF OS Windows
f9e10201
JD
959[Windows only] On Windows, the \*(Aq\fBBlat\fP\*(Aq mailer
960(<\fBhttp://blat.sourceforge.net/\fP>) is used by default.
832b75ed 961This mailer uses a different command line syntax, see
f9e10201
JD
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
d008864d 971.\" %ENDIF OS Windows
832b75ed
GG
972Note also that there is a special argument
973.B <nomailer>
f9e10201
JD
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
832b75ed
GG
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
f9e10201 980remainder of the output is discarded. If problems are encountered in
832b75ed
GG
981sending mail, this should help you to understand and fix them. If
982you have mail problems, we recommend running \fBsmartd\fP in debug
f9e10201
JD
983mode with the \*(Aq\-d\*(Aq flag, using the \*(Aq\-M test\*(Aq Directive
984described below.
d2e702cf 985.\" %IF ENABLE_SMARTDPLUGINDIR
ee38a438 986.\" %IF NOT OS Windows
f9e10201
JD
987.Sp
988If a word of the comma separated list has the form \*(Aq@plugin\*(Aq, a custom
ee38a438 989script /usr/local/etc/smartd_warning.d/plugin is run and the word is
f9e10201
JD
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/*
ee38a438
GI
993are run instead.
994This is handled by the script /usr/local/etc/smartd_warning.sh
f9e10201 995(see also \*(Aq\-M exec\*(Aq below).
ee38a438 996.\" %ENDIF NOT OS Windows
d2e702cf 997.\" %ENDIF ENABLE_SMARTDPLUGINDIR
d008864d 998.\" %IF OS Windows
f9e10201 999.Sp
a86ec89e
GI
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().
ee38a438 1002This displays message boxes on the desktops of the selected sessions.
f9e10201
JD
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
ee38a438
GI
1006all connected (active or waiting for login) remote sessions.
1007This is handled by the script EXEDIR/smartd_warning.cmd which runs
f9e10201 1008the tool EXEDIR/wtssendmsg.exe (see also \*(Aq\-M exec\*(Aq below).
d008864d 1009.\" %ENDIF OS Windows
832b75ed
GG
1010.TP
1011.B \-M TYPE
1012These Directives modify the behavior of the
1013\fBsmartd\fP
f9e10201
JD
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
832b75ed 1016Directive and can not be used without it.
f9e10201 1017.Sp
832b75ed
GG
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.
f9e10201 1021.Sp
832b75ed
GG
1022The valid arguments to the \-M Directive are (one of the following
1023three):
f9e10201 1024.Sp
832b75ed
GG
1025.I once
1026\- send only one warning email for each type of disk problem detected. This
f9e10201
JD
1027is the default unless state persistence (\*(Aq\-s\*(Aq option) is enabled.
1028.Sp
832b75ed
GG
1029.I daily
1030\- send additional warning reminder emails, once per day, for each type
cfbba5b9 1031of disk problem detected. This is the default if state persistence
f9e10201
JD
1032(\*(Aq\-s\*(Aq option) is enabled.
1033.Sp
832b75ed
GG
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
f9e10201 1037type of disk problem detected. Each interval is twice as long as the
832b75ed 1038previous interval.
f9e10201 1039.Sp
d008864d
GI
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.
f9e10201 1042.Sp
832b75ed 1043In addition, one may add zero or more of the following Directives:
f9e10201 1044.Sp
832b75ed
GG
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.
9ebc753d
GG
1050Note that if this Directive is used,
1051\fBsmartd\fP
f9e10201
JD
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
832b75ed
GG
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.
ee38a438 1060.\" %IF OS Windows
f9e10201 1061.Sp
ee38a438
GI
1062[Windows only] The PATH may contain space characters.
1063Then it must be included in double quotes.
1064.\" %ENDIF OS Windows
f9e10201 1065.Sp
832b75ed
GG
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
f9e10201 1069to all logged-in users, etc.\&) But please be careful. \fBsmartd\fP
832b75ed 1070will \fBblock\fP until the executable PATH returns, so if your
ee38a438
GI
1071executable hangs, then \fBsmartd\fP will also hang.
1072.\" %IF NOT OS Windows
1073Some sample scripts are included in
e9583e0c 1074/usr/local/share/doc/smartmontools/examplescripts/.
ee38a438 1075.\" %ENDIF NOT OS Windows
f9e10201
JD
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
832b75ed
GG
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.
f9e10201 1085.Sp
832b75ed
GG
1086Before running the executable, \fBsmartd\fP sets a number of
1087environment variables. These environment variables may be used to
f9e10201 1088control the executable's behavior. The environment variables
832b75ed
GG
1089exported by \fBsmartd\fP are:
1090.RS 7
1091.IP \fBSMARTD_MAILER\fP 4
f9e10201 1092is set to the argument of \-M exec, if present or else to \*(Aqmail\*(Aq
d2e702cf 1093(examples: /usr/local/bin/mail, mail).
832b75ed 1094.IP \fBSMARTD_DEVICE\fP 4
a86ec89e 1095is set to the device path (example: /dev/sda).
832b75ed 1096.IP \fBSMARTD_DEVICETYPE\fP 4
f9e10201
JD
1097is set to the device type specified by \*(Aq\-d\*(Aq directive or
1098\*(Aqauto\*(Aq if none.
832b75ed 1099.IP \fBSMARTD_DEVICESTRING\fP 4
f9e10201
JD
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.
ee38a438
GI
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.
832b75ed
GG
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:
d2e702cf 1112.br
832b75ed 1113\fIEmailTest\fP: this is an email test message.
d2e702cf 1114.br
832b75ed 1115\fIHealth\fP: the SMART health status indicates imminent failure.
d2e702cf 1116.br
832b75ed 1117\fIUsage\fP: a usage Attribute has failed.
d2e702cf 1118.br
832b75ed 1119\fISelfTest\fP: the number of self-test failures has increased.
d2e702cf 1120.br
832b75ed 1121\fIErrorCount\fP: the number of errors in the ATA error log has increased.
d2e702cf 1122.br
832b75ed
GG
1123\fICurrentPendingSector\fP: one of more disk sectors could not be
1124read and are marked to be reallocated (replaced with spare sectors).
d2e702cf 1125.br
ee38a438 1126\fIOfflineUncorrectableSector\fP: during off-line testing, or self-testing,
832b75ed 1127one or more disk sectors could not be read.
d2e702cf 1128.br
e9583e0c 1129\fITemperature\fP: Temperature reached critical limit (see \-W directive).
d2e702cf 1130.br
832b75ed 1131\fIFailedHealthCheck\fP: the SMART health status command failed.
d2e702cf 1132.br
832b75ed 1133\fIFailedReadSmartData\fP: the command to read SMART Attribute data failed.
d2e702cf 1134.br
832b75ed 1135\fIFailedReadSmartErrorLog\fP: the command to read the SMART error log failed.
d2e702cf 1136.br
f9e10201
JD
1137\fIFailedReadSmartSelfTestLog\fP: the command to read the SMART self-test log
1138failed.
d2e702cf 1139.br
832b75ed
GG
1140\fIFailedOpenDevice\fP: the open() command to the device failed.
1141.IP \fBSMARTD_ADDRESS\fP 4
f9e10201 1142is determined by the address argument ADD of the \*(Aq\-m\*(Aq Directive.
832b75ed
GG
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
d2e702cf 1148quoted, so to use it in a shell script you may want to enclose it in
832b75ed 1149double quotes.
ee38a438
GI
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
832b75ed
GG
1155.IP \fBSMARTD_MESSAGE\fP 4
1156is set to the one sentence summary warning email message string from
f9e10201
JD
1157\fBsmartd\fP.
1158This message string contains space characters and is NOT quoted. So to
d2e702cf 1159use $SMARTD_MESSAGE in a shell script you should probably enclose it in
832b75ed 1160double quotes.
ee38a438 1161.\" %IF NOT OS Windows
832b75ed
GG
1162.IP \fBSMARTD_FULLMESSAGE\fP 4
1163is set to the contents of the entire email warning message string from
f9e10201
JD
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.
ee38a438
GI
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
832b75ed
GG
1177.IP \fBSMARTD_TFIRST\fP 4
1178is a text string giving the time and date at which the first problem
f9e10201
JD
1179of this type was reported. This text string contains space characters
1180and no newlines, and is NOT quoted. For example:
d2e702cf 1181.br
832b75ed
GG
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.
ee38a438
GI
1186.IP \fBSMARTD_PREVCNT\fP 4
1187is an integer specifying the number of previous messages sent.
f9e10201 1188It is set to \*(Aq0\*(Aq for the first message.
ee38a438
GI
1189.IP \fBSMARTD_NEXTDAYS\fP 4
1190is an integer specifying the number of days until the next message will be sent.
f9e10201
JD
1191It it set to empty on \*(Aq\-M once\*(Aq and set to \*(Aq1\*(Aq on
1192\*(Aq\-M daily\*(Aq.
832b75ed
GG
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 \&
f9e10201 1198If the \*(Aq\-m ADD\*(Aq Directive is given with a normal address argument,
832b75ed
GG
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:
f9e10201
JD
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
d008864d 1213.\" %IF OS Windows
f9e10201
JD
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
d008864d 1220.\" %ENDIF OS Windows
f9e10201 1221If the \*(Aq\-m ADD\*(Aq Directive is given with the special address argument
832b75ed
GG
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:
f9e10201
JD
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
832b75ed
GG
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.
f9e10201
JD
1248.Sp
1249Some EXAMPLES of scripts that can be used with the \*(Aq\-M exec\*(Aq
ee38a438
GI
1250Directive are given below.
1251.\" %IF NOT OS Windows
1252Some sample scripts are also included in
e9583e0c 1253/usr/local/share/doc/smartmontools/examplescripts/.
ee38a438 1254.\" %ENDIF NOT OS Windows
f9e10201 1255.Sp
a86ec89e 1256The executable is run by the script
ee38a438
GI
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.
832b75ed
GG
1279.TP
1280.B \-f
f9e10201 1281[ATA only] Check for \*(Aqfailure\*(Aq of any Usage Attributes. If these
cfbba5b9
GI
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."
832b75ed
GG
1285[Please see the \fBsmartctl \-A\fP command-line option.]
1286.TP
1287.B \-p
cfbba5b9 1288[ATA only] Report anytime that a Prefail Attribute has changed
f9e10201 1289its value since the last check. [Please see the
832b75ed
GG
1290.B smartctl \-A
1291command-line option.]
1292.TP
1293.B \-u
cfbba5b9 1294[ATA only] Report anytime that a Usage Attribute has changed its value
f9e10201 1295since the last check. [Please see the
832b75ed
GG
1296.B smartctl \-A
1297command-line option.]
1298.TP
1299.B \-t
f9e10201
JD
1300[ATA only] Equivalent to turning on the two previous flags \*(Aq\-p\*(Aq
1301and \*(Aq\-u\*(Aq.
832b75ed 1302Tracks changes in \fIall\fP device Attributes (both Prefailure and
f9e10201 1303Usage). [Please see the \fBsmartctl\fP \-A command-line option.]
832b75ed
GG
1304.TP
1305.B \-i ID
cfbba5b9
GI
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
f9e10201 1308from 1 to 255. This Directive modifies the behavior of the \*(Aq\-f\*(Aq
832b75ed 1309Directive and has no effect without it.
f9e10201
JD
1310.Sp
1311This is useful, for example, if you have a very old disk and don't
832b75ed
GG
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
cfbba5b9 1317[ATA only] Ignore device Attribute \fBID\fP when tracking changes in the
832b75ed 1318Attribute values. \fBID\fP must be a decimal integer in the range
f9e10201
JD
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
832b75ed 1323This is useful, for example, if one of the device Attributes is the disk
f9e10201 1324temperature (usually Attribute 194 or 231). It's annoying to get reports
832b75ed
GG
1325each time the temperature changes. This Directive may appear multiple
1326times for a single device, if you want to ignore multiple Attributes.
1327.TP
2127e193 1328.B \-r ID[!]
cfbba5b9
GI
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
f9e10201
JD
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
832b75ed
GG
1336A common use of this Directive is to track the device Temperature
1337(often ID=194 or 231).
f9e10201
JD
1338.Sp
1339If the optional flag \*(Aq!\*(Aq is appended, a change of the Normalized
2127e193 1340value is considered critical. The report will be logged as LOG_CRIT
f9e10201 1341and a warning email will be sent if \*(Aq\-m\*(Aq is specified.
832b75ed 1342.TP
2127e193 1343.B \-R ID[!]
cfbba5b9 1344[ATA only] When tracking, report whenever the \fIRaw\fP value of Attribute
832b75ed
GG
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
f9e10201
JD
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
832b75ed
GG
1353Directive for the same Attribute, so that the Raw value of the
1354Attribute is reported.
f9e10201 1355.Sp
832b75ed
GG
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.
f9e10201
JD
1360.Sp
1361If the optional flag \*(Aq!\*(Aq is appended, a change of the Raw
2127e193 1362value is considered critical. The report will be logged as
f9e10201
JD
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.
832b75ed 1365.TP
2127e193 1366.B \-C ID[+]
832b75ed
GG
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
e9583e0c 1373pending sectors). If the name of this Attribute is changed by a
f9e10201 1374\*(Aq\-v 197,FORMAT,NAME\*(Aq directive, the default is changed to
e9583e0c 1375\fB\-C 0\fP.
f9e10201
JD
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
2127e193 1379attribute when a bad sector is reallocated.
f9e10201
JD
1380See also \*(Aq\-v 197,increasing\*(Aq below.
1381.Sp
d008864d
GI
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.
f9e10201 1385.Sp
832b75ed 1386A pending sector is a disk sector (containing 512 bytes of your data)
f9e10201 1387which the device would like to mark as "bad" and reallocate.
832b75ed
GG
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.
832b75ed 1397.TP
2127e193 1398.B \-U ID[+]
832b75ed
GG
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
e9583e0c 1405offline uncorrectable sectors). If the name of this Attribute is changed
f9e10201
JD
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
2127e193 1412attribute when a bad sector is reallocated.
f9e10201
JD
1413See also \*(Aq\-v 198,increasing\*(Aq below.
1414.Sp
d008864d
GI
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.
f9e10201 1418.Sp
832b75ed 1419An offline uncorrectable sector is a disk sector which was not
ee38a438 1420readable during an off-line scan or a self-test. This is important
832b75ed 1421to know, because if you have data stored in this disk sector, and you
f9e10201 1422need to read it, the read will fail. Please see the previous \*(Aq\-C\*(Aq
832b75ed 1423option for more details.
4d59bff9
GG
1424.TP
1425.B \-W DIFF[,INFO[,CRIT]]
1426Report if the current temperature had changed by at least \fBDIFF\fP
2127e193
GI
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
f9e10201
JD
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
d008864d
GI
1435The warning email counter is reset if the temperature dropped below
1436\fBINFO\fP or \fBCRIT\fP-5 if \fBINFO\fP is not specified.
f9e10201 1437.Sp
2127e193 1438If this directive is used in conjunction with state persistence
f9e10201
JD
1439(\*(Aq\-s\*(Aq option), the min and max temperature values are preserved
1440across boot cycles. The minimum temperature value is not updated
2127e193 1441during the first 30 minutes after startup.
f9e10201 1442.Sp
4d59bff9 1443To disable any of the 3 reports, set the corresponding limit to 0.
f9e10201
JD
1444Trailing zero arguments may be omitted. By default, all temperature
1445reports are disabled (\*(Aq\-W 0\*(Aq).
1446.Sp
4d59bff9 1447To track temperature changes of at least 2 degrees, use:
f9e10201 1448.br
f4e463df 1449.B \-W 2
f9e10201 1450.br
4d59bff9 1451To log informal messages on temperatures of at least 40 degrees, use:
f9e10201 1452.br
f4e463df 1453.B \-W 0,40
f9e10201 1454.br
4d59bff9 1455For warning messages/mails on temperatures of at least 45 degrees, use:
f9e10201 1456.br
f4e463df 1457.B \-W 0,0,45
f9e10201 1458.br
4d59bff9 1459To combine all of the above reports, use:
f9e10201 1460.br
f4e463df 1461.B \-W 2,40,45
f9e10201 1462.Sp
ee38a438 1463For ATA devices, smartd interprets Attribute 194 or 190 as Temperature Celsius
f9e10201
JD
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
a86ec89e
GI
1468For NVMe devices, smartd checks the maximum of the Composite Temperature value
1469and all Temperature Sensor values reported by SMART/Health Information log.
f9e10201 1470.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
832b75ed
GG
1471.TP
1472.B \-F TYPE
ee38a438
GI
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:
f9e10201 1476.Sp
832b75ed 1477.I none
e9583e0c 1478\- Assume that the device firmware obeys the ATA specifications. This
f9e10201 1479is the default, unless the device has presets for \*(Aq\-F\*(Aq in the
d2e702cf 1480drive database. Using this directive will override any preset values.
f9e10201 1481.Sp
ee38a438
GI
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.
f9e10201 1486.Sp
832b75ed
GG
1487.I samsung
1488\- In some Samsung disks (example: model SV4012H Firmware Version:
ee38a438
GI
1489RM100-08) some of the two- and four-byte quantities in the SMART data
1490structures are byte-swapped (relative to the ATA specification).
832b75ed 1491Enabling this option tells \fBsmartd\fP to evaluate these quantities
ee38a438
GI
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;
832b75ed
GG
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.
f9e10201 1496.Sp
832b75ed 1497.I samsung2
e9583e0c
GI
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
ee38a438 1500byte-reversed order.
f9e10201 1501.Sp
a37e7145 1502.I samsung3
ee38a438
GI
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
f9e10201
JD
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
ee38a438
GI
1508.I xerrorlba
1509\- This only affects \fBsmartctl\fP.
f9e10201 1510.Sp
832b75ed 1511[Please see the \fBsmartctl \-F\fP command-line option.]
832b75ed 1512.TP
a23d5117 1513.B \-v ID,FORMAT[:BYTEORDER][,NAME]
ee38a438 1514[ATA only] Sets a vendor-specific raw value print FORMAT, an optional
a23d5117 1515BYTEORDER and an optional NAME for Attribute ID.
bed94269 1516This directive may be used multiple times.
f9e10201
JD
1517Please see \fBsmartctl \-v\fP command-line option for further details.
1518.Sp
bed94269 1519The following arguments affect smartd warning output:
f9e10201 1520.Sp
2127e193
GI
1521.I 197,increasing
1522\- Raw Attribute number 197 (Current Pending Sector Count) is not
f9e10201
JD
1523reset if uncorrectable sectors are reallocated. This sets \*(Aq\-C 197+\*(Aq
1524if no other \*(Aq\-C\*(Aq directive is specified.
1525.Sp
2127e193
GI
1526.I 198,increasing
1527\- Raw Attribute number 198 (Offline Uncorrectable Sector Count) is not
f9e10201
JD
1528reset if uncorrectable sectors are reallocated. This sets \*(Aq\-U 198+\*(Aq
1529if no other \*(Aq\-U\*(Aq directive is specified.
832b75ed
GG
1530.TP
1531.B \-P TYPE
cfbba5b9
GI
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:
f9e10201 1535.Sp
832b75ed
GG
1536.I use
1537\- use any presets that are available for this drive. This is the default.
f9e10201 1538.Sp
832b75ed
GG
1539.I ignore
1540\- do not use any presets for this drive.
f9e10201 1541.Sp
832b75ed
GG
1542.I show
1543\- show the presets listed for this drive in the database.
f9e10201 1544.Sp
832b75ed
GG
1545.I showall
1546\- show the presets that are available for all drives and then exit.
f9e10201 1547.Sp
832b75ed
GG
1548[Please see the
1549.B smartctl \-P
1550command-line option.]
832b75ed
GG
1551.TP
1552.B \-a
f9e10201
JD
1553Equivalent to turning on all of the following Directives:
1554.B \*(Aq\-H\*(Aq
832b75ed 1555to check the SMART health status,
f9e10201 1556.B \*(Aq\-f\*(Aq
832b75ed 1557to report failures of Usage (rather than Prefail) Attributes,
f9e10201 1558.B \*(Aq\-t\*(Aq
832b75ed 1559to track changes in both Prefailure and Usage Attributes,
f9e10201 1560.B \*(Aq\-l\ error\*(Aq
832b75ed 1561to report increases in the number of ATA errors,
f9e10201 1562.B \*(Aq\-l\ selftest\*(Aq
d008864d 1563to report increases in the number of Self-Test Log errors,
f9e10201 1564.B \*(Aq\-l\ selfteststs\*(Aq
d008864d 1565to report changes of Self-Test execution status,
f9e10201 1566.B \*(Aq\-C 197\*(Aq
832b75ed 1567to report nonzero values of the current pending sector count, and
f9e10201 1568.B \*(Aq\-U 198\*(Aq
832b75ed 1569to report nonzero values of the offline pending sector count.
f9e10201 1570.Sp
832b75ed
GG
1571Note that \-a is the default for ATA devices. If none of these other
1572Directives is given, then \-a is assumed.
832b75ed
GG
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:
f9e10201
JD
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
832b75ed 1594.TP
f9e10201
JD
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
832b75ed 1599Directive.
f9e10201
JD
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
832b75ed 1604to the output of the smartd email warning message and sends it to ADDRESS.
f9e10201
JD
1605.Sp
1606.Vb 4
d2e702cf 1607#! /bin/sh
832b75ed
GG
1608
1609# Save the email message (STDIN) to a file:
1610cat > /root/msg
1611
f9e10201
JD
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
832b75ed 1615
f9e10201
JD
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
832b75ed 1623then powers down the machine.
f9e10201
JD
1624.Sp
1625.Vb 4
d2e702cf 1626#! /bin/sh
832b75ed
GG
1627
1628# Warn all users of a problem
d2e702cf
GI
1629wall <<EOF
1630Problem detected with disk: $SMARTD_DEVICESTRING
1631Warning message from smartd is: $SMARTD_MESSAGE
1632Shutting down machine in 30 seconds...
1633EOF
1634
832b75ed
GG
1635# Wait half a minute
1636sleep 30
d2e702cf 1637
832b75ed 1638# Power down the machine
f9e10201
JD
1639/sbin/shutdown \-hf now
1640.Ve
1641.Sp
832b75ed 1642Some example scripts are distributed with the smartmontools package,
e9583e0c 1643in /usr/local/share/doc/smartmontools/examplescripts/.
f9e10201 1644.Sp
832b75ed
GG
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.
f9e10201 1649.Sp
832b75ed
GG
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.
f9e10201 1654.Sp
d2e702cf
GI
1655.\" %IF NOT OS Windows
1656.SH FILES
1657.TP
1658.B /usr/local/etc/smartd.conf
1659full path of this file.
f9e10201 1660.Sp
d2e702cf
GI
1661.\" %ENDIF NOT OS Windows
1662.SH SEE ALSO
1663\fBsmartd\fP(8), \fBsmartctl\fP(8),
1664\fBmail\fP(1), \fBregex\fP(7).
f9e10201 1665.Sp
a86ec89e
GI
1666.SH PACKAGE VERSION
1667CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
1668.br
ff28b140 1669$Id: smartd.conf.5.in 4856 2018-12-11 21:42:16Z chrfranke $