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