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