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