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