root/trunk/smartmontools/smartd.conf.5.in @ 3549

Revision 3549, 61.2 KB (checked in by chrfranke, 23 months ago)

smartctl.8.in, smartd.conf.5.in: Document '-d areca N/E' support for Windows.

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