]> git.proxmox.com Git - mirror_smartmontools-debian.git/blob - smartd.8.in
Merge branch 'upstream'
[mirror_smartmontools-debian.git] / smartd.8.in
1 .ig
2 Copyright (C) 2002-6 Bruce Allen <smartmontools-support@lists.sourceforge.net>
3
4 $Id: smartd.8.in,v 1.106 2006/09/27 21:42:03 chrfranke Exp $
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later 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.,
13 675 Mass Ave, Cambridge, MA 02139, USA.
14
15 This code was originally developed as a Senior Thesis by Michael
16 Cornwell at the Concurrent Systems Laboratory (now part of the Storage
17 Systems Research Center), Jack Baskin School of Engineering,
18 University of California, Santa Cruz. http://ssrc.soe.ucsc.edu/
19 ..
20 .TH SMARTD 8 CURRENT_CVS_DATE CURRENT_CVS_VERSION CURRENT_CVS_DATE
21 .SH NAME
22 \fBsmartd\fP \- SMART Disk Monitoring Daemon
23
24 .SH SYNOPSIS
25 .B smartd [options]
26
27 .SH FULL PATH
28 .B /usr/local/sbin/smartd
29
30 .SH PACKAGE VERSION
31 CURRENT_CVS_VERSION released CURRENT_CVS_DATE at CURRENT_CVS_TIME
32
33 .SH DESCRIPTION
34 \fBsmartd\fP is a daemon that monitors the Self-Monitoring, Analysis
35 and Reporting Technology (SMART) system built into many ATA-3 and
36 later ATA, IDE and SCSI-3 hard drives. The purpose of SMART is to
37 monitor the reliability of the hard drive and predict drive failures,
38 and to carry out different types of drive self-tests. This version of
39 \fBsmartd\fP is compatible with ATA/ATAPI-7 and earlier standards (see
40 \fBREFERENCES\fP below).
41
42 \fBsmartd\fP will attempt to enable SMART monitoring on ATA devices
43 (equivalent to \fBsmartctl -s on\fP) and polls these and SCSI devices
44 every 30 minutes (configurable), logging SMART errors and changes of
45 SMART Attributes via the SYSLOG interface. The default location for
46 these SYSLOG notifications and warnings is \fB/var/log/messages\fP.
47 To change this default location, please see the \fB\'-l\'\fP
48 command-line option described below.
49
50 In addition to logging to a file, \fBsmartd\fP can also be configured
51 to send email warnings if problems are detected. Depending upon the
52 type of problem, you may want to run self\-tests on the disk, back up
53 the disk, replace the disk, or use a manufacturer\'s utility to force
54 reallocation of bad or unreadable disk sectors. If disk problems are
55 detected, please see the \fBsmartctl\fP manual page and the
56 \fBsmartmontools\fP web page/FAQ for further guidance.
57
58 If you send a \fBUSR1\fP signal to \fBsmartd\fP it will immediately
59 check the status of the disks, and then return to polling the disks
60 every 30 minutes. See the \fB\'\-i\'\fP option below for additional
61 details.
62
63 \fBsmartd\fP can be configured at start-up using the configuration
64 file \fB/usr/local/etc/smartd.conf\fP (Windows: \fB./smartd.conf\fP).
65 If the configuration file is subsequently modified, \fBsmartd\fP
66 can be told to re-read the configuration file by sending it a
67 \fBHUP\fP signal, for example with the command:
68 .fi
69 \fBkillall -HUP smartd\fP.
70 .fi
71 (Windows: See NOTES below.)
72
73 On startup, if \fBsmartd\fP finds a syntax error in the configuration
74 file, it will print an error message and then exit. However if
75 \fBsmartd\fP is already running, then is told with a \fBHUP\fP signal
76 to re-read the configuration file, and then find a syntax error in
77 this file, it will print an error message and then continue, ignoring
78 the contents of the (faulty) configuration file, as if the \fBHUP\fP
79 signal had never been received.
80
81 When \fBsmartd\fP is running in debug mode, the \fBINT\fP signal
82 (normally generated from a shell with CONTROL\-C) is treated in the
83 same way as a \fBHUP\fP signal: it makes \fBsmartd\fP reload its
84 configuration file. To exit \fBsmartd\fP use CONTROL-\e
85 (Cygwin: 2x CONTROL\-C, Windows: CONTROL\-Break).
86
87 On startup, in the absence of the configuration file
88 \fB/usr/local/etc/smartd.conf\fP, the \fBsmartd\fP daemon first scans for all
89 devices that support SMART. The scanning is done as follows:
90 .IP \fBLINUX:\fP 9
91 Examine all entries \fB"/dev/hd[a-t]"\fP for IDE/ATA
92 devices, and \fB"/dev/sd[a-z]"\fP for SCSI devices.
93 .IP \fBFREEBSD:\fP 9
94 Examine all entries \fB"/dev/ad[0-9]+"\fP for IDE/ATA
95 devices and \fB"/dev/da[0-9]+"\fP for SCSI devices.
96 .IP \fBNETBSD/OPENBSD:\fP 9
97 Authoritative list of disk devices is obtained from sysctl
98 \'hw.disknames\'.
99 .IP \fBSOLARIS:\fP 9
100 Examine all entries \fB"/dev/rdsk/c?t?d?s?"\fP for IDE/ATA and SCSI disk
101 devices, and entries \fB"/dev/rmt/*"\fP for SCSI tape devices.
102 .IP \fBDARWIN:\fP 9
103 The IOService plane is scanned for ATA block storage devices.
104 .IP \fBWINDOWS:\fP 9
105 Examine all entries \fB"/dev/hd[a-j]"\fP ("\\\\.\\PhysicalDrive[0-9]")
106 for IDE/ATA devices on WinNT4/2000/XP, \fB"/dev/hd[a-d]"\fP
107 (bitmask from "\\\\.\\SMARTVSD") for IDE/ATA devices on Win95/98/98SE/ME,
108 and \fB"/dev/scsi[0-9][0-7]"\fP (ASPI adapter 0-9, ID 0-7) for SCSI
109 devices on all versions of Windows.
110 If a 3ware 9000 controller is installed, examine all entries
111 \fB"/dev/hdX,N"\fP for the first logical drive (\'unit\'
112 \fB"/dev/hdX"\fP) and all physical disks (\'ports\' \fB",N"\fP)
113 detected behind this controller. Same for a second controller if present.
114 .IP \fBCYGWIN\fP: 9
115 See "WINDOWS" above.
116 .IP \fBOS/2,eComStation\fP: 9
117 Use the form \fB"/dev/hd[a\-z]"\fP for IDE/ATA devices.
118 .PP
119 \fBsmartd\fP then monitors
120 for \fIall\fP possible SMART errors (corresponding to the \fB\'\-a\'\fP
121 Directive in the configuration file; see \fBCONFIGURATION FILE\fP
122 below).
123
124 .SH
125 OPTIONS
126 Long options are not supported on all systems. Use \fB\'smartd
127 \-h\'\fP to see the available options.
128 .TP
129 .B \-c FILE, \-\-configfile=FILE
130
131 Read \fBsmartd\fP configuration Directives from FILE, instead of from
132 the default location \fB/usr/local/etc/smartd.conf\fP (Windows: \fB./smartd.conf\fP).
133 If FILE does \fBnot\fP exist, then \fBsmartd\fP will print an error
134 message and exit with nonzero status. Thus, \'\-c /usr/local/etc/smartd.conf\'
135 can be used to verify the existence of the default configuration file.
136
137 By using \'\-\' for FILE, the configuration is read from standard
138 input. This is useful for commands like:
139 .nf
140 .B echo /dev/hdb \-m user@home \-M test | smartd \-c \- \-q onecheck
141 .fi
142 to perform quick and simple checks without a configuration file.
143
144 .TP
145 .B \-d, \-\-debug
146 Runs \fBsmartd\fP in "debug" mode. In this mode, it displays status
147 information to STDOUT rather than logging it to SYSLOG and does not
148 \fBfork(2)\fP into the background and detach from the controlling
149 terminal. In this mode, \fBsmartd\fP also prints more verbose
150 information about what it is doing than when operating in "daemon"
151 mode. In this mode, the \fBQUIT\fP signal (normally generated from a
152 terminal with CONTROL\-C) makes \fBsmartd\fP reload its configuration
153 file. Please use CONTROL-\e to exit
154 (Cygwin: 2x CONTROL\-C, Windows: CONTROL\-Break).
155
156 Windows only: The "debug" mode can be toggled by the command
157 \fBsmartd sigusr2\fP. A new console for debug output is opened when
158 debug mode is enabled.
159 .TP
160 .B \-D, \-\-showdirectives
161 Prints a list (to STDOUT) of all the possible Directives which may
162 appear in the configuration file /usr/local/etc/smartd.conf, and then exits.
163 These Directives are also described later in this man page. They may
164 appear in the configuration file following the device name.
165 .TP
166 .B \-h, \-\-help, \-\-usage
167 Prints usage message to STDOUT and exits.
168 .TP
169 .B \-i N, \-\-interval=N
170 Sets the interval between disk checks to \fIN\fP seconds, where
171 \fIN\fP is a decimal integer. The minimum allowed value is ten and
172 the maximum is the largest positive integer that can be represented on
173 your system (often 2^31-1). The default is 1800 seconds.
174
175 Note that the superuser can make \fBsmartd\fP check the status of the
176 disks at any time by sending it the \fBSIGUSR1\fP signal, for example
177 with the command:
178 .nf
179 .B kill -SIGUSR1 <pid>
180 .fi
181 where \fB<pid>\fP is the process id number of \fBsmartd\fP. One may
182 also use:
183 .nf
184 .B killall -USR1 smartd
185 .fi
186 for the same purpose.
187 .fi
188 (Windows: See NOTES below.)
189
190 .TP
191 .B \-l FACILITY, \-\-logfacility=FACILITY
192 Uses syslog facility FACILITY to log the messages from \fBsmartd\fP.
193 Here FACILITY is one of \fIlocal0\fP, \fIlocal1\fP, ..., \fIlocal7\fP,
194 or \fIdaemon\fP [default]. If this command-line option is not used,
195 then by default messages from \fBsmartd\fP are logged to the facility
196 \fIdaemon\fP.
197
198 If you would like to have \fBsmartd\fP messages logged somewhere other
199 than the default \fB/var/log/messages\fP location, this can typically
200 be accomplished with (for example) the following steps:
201 .RS 7
202 .IP \fB[1]\fP 4
203 Modify the script that starts \fBsmartd\fP to include the \fBsmartd\fP
204 command-line argument \'\-l local3\'. This tells \fBsmartd\fP to log its
205 messages to facility \fBlocal3\fP.
206 .IP \fB[2]\fP 4
207 Modify the \fBsyslogd\fP configuration file (typically
208 \fB/etc/syslog.conf\fP) by adding a line of the form:
209 .nf
210 \fBlocal3.* /var/log/smartd.log\fP
211 .fi
212 This tells \fBsyslogd\fP to log all the messages from facility \fBlocal3\fP to
213 the designated file: /var/log/smartd.log.
214 .IP \fB[3]\fP 4
215 Tell \fBsyslogd\fP to re-read its configuration file, typically by
216 sending the \fBsyslogd\fP process a \fBSIGHUP\fP hang-up signal.
217 .IP \fB[4]\fP 4
218 Start (or restart) the \fBsmartd\fP daemon.
219 .RE
220 .\" The following two lines are a workaround for a man2html bug. Please leave them.
221 .\" They define a non-existent option; useful because man2html can't correctly reset the margins.
222 .TP
223 .B \&
224 For more detailed information, please refer to the man pages for
225 \fBsyslog.conf\fP, \fBsyslogd\fP, and \fBsyslog\fP. You may also want
226 to modify the log rotation configuration files; see the man pages for
227 \fBlogrotate\fP and examine your system\'s /etc/logrotate.conf file.
228
229 Cygwin: Support for \fBsyslogd\fP as described above is available starting with Cygwin 1.5.15.
230 On older releases or if no local \fBsyslogd\fP is running, the \'\-l\' option has no effect.
231 In this case, all \fBsyslog\fP messages are written to Windows event log
232 or to file \fBC:/CYGWIN_SYSLOG.TXT\fP if the event log is not available.
233
234 Windows: Some \fBsyslog\fP functionality is implemented
235 internally in \fBsmartd\fP as follows: If no \'\-l\' option
236 (or \'\-l daemon\') is specified, messages are written to Windows
237 event log or to file \fB./smartd.log\fP if event log is not available
238 (Win9x/ME or access denied). By specifying other values of FACILITY,
239 log output is redirected as follows:
240 \'\-l local0\' to file \fB./smartd.log\fP,
241 \'\-l local1\' to standard output (redirect with \'>\' to any file),
242 \'\-l local2\' to standard error,
243 \'\-l local[3-7]\': to file \fB./smartd[1-5].log\fP.
244
245 When using the event log, the enclosed utility \fBsyslogevt.exe\fP
246 should be registered as an event message file to avoid error
247 messages from the event viewer. Use \'\fBsyslogevt -r smartd\fP\'
248 to register, \'\fBsyslogevt -u smartd\fP\' to unregister and
249 \'\fBsyslogevt\fP\' for more help.
250
251 .TP
252 .B \-p NAME, \-\-pidfile=NAME
253 Writes pidfile \fINAME\fP containing the \fBsmartd\fP Process ID
254 number (PID). To avoid symlink attacks make sure the directory to
255 which pidfile is written is only writable for root. Without this
256 option, or if the \-\-debug option is given, no PID file is written on
257 startup. If \fBsmartd\fP is killed with a maskable signal then the
258 pidfile is removed.
259 .TP
260 .B \-q WHEN, \-\-quit=WHEN
261 Specifies when, if ever, \fBsmartd\fP should exit. The valid
262 arguments are to this option are:
263
264 .I nodev
265 \- Exit if there are no devices to monitor, or if any errors are found
266 at startup in the configuration file. This is the default.
267
268 .I errors
269 \- Exit if there are no devices to monitor, or if any errors are found
270 in the configuration file /usr/local/etc/smartd.conf at startup or whenever it
271 is reloaded.
272
273 .I nodevstartup
274 \- Exit if there are no devices to monitor at startup. But continue
275 to run if no devices are found whenever the configuration file is
276 reloaded.
277
278 .I never
279 \- Only exit if a fatal error occurs (no remaining system memory,
280 invalid command line arguments). In this mode, even if there are no
281 devices to monitor, or if the configuration file
282 \fB/usr/local/etc/smartd.conf\fP has errors, \fBsmartd\fP will continue to run,
283 waiting to load a configuration file listing valid devices.
284
285 .I onecheck
286 \- Start \fBsmartd\fP in debug mode, then register devices, then check
287 device\'s SMART status once, and then exit with zero exit status if all
288 of these steps worked correctly.
289
290 This last option is intended for \'distribution-writers\' who want to
291 create automated scripts to determine whether or not to automatically
292 start up \fBsmartd\fP after installing smartmontools. After starting
293 \fBsmartd\fP with this command-line option, the distribution\'s install
294 scripts should wait a reasonable length of time (say ten seconds). If
295 \fBsmartd\fP has not exited with zero status by that time, the script
296 should send \fBsmartd\fP a SIGTERM or SIGKILL and assume that
297 \fBsmartd\fP will not operate correctly on the host. Conversely, if
298 \fBsmartd\fP exits with zero status, then it is safe to run
299 \fBsmartd\fP in normal daemon mode. If \fBsmartd\fP is unable to
300 monitor any devices or encounters other problems then it will return
301 with non-zero exit status.
302
303 .I showtests
304 \- Start \fBsmartd\fP in debug mode, then register devices, then write
305 a list of future scheduled self tests to stdout, and then exit with zero
306 exit status if all of these steps worked correctly.
307 Device's SMART status is not checked.
308
309 This option is intended to test whether the '-s REGEX' directives in
310 smartd.conf will have the desired effect. The output lists the next test
311 schedules, limited to 5 tests per type and device. This is followed by a
312 summary of all tests of each device within the next 90 days.
313 .TP
314 .B \-r TYPE, \-\-report=TYPE
315 Intended primarily to help
316 .B smartmontools
317 developers understand the behavior of
318 .B smartmontools
319 on non-conforming or poorly-conforming hardware. This option reports
320 details of
321 \fBsmartd\fP
322 transactions with the device. The option can be used multiple times.
323 When used just once, it shows a record of the ioctl() transactions
324 with the device. When used more than once, the detail of these ioctl()
325 transactions are reported in greater detail. The valid arguments to
326 this option are:
327
328 .I ioctl
329 \- report all ioctl() transactions.
330
331 .I ataioctl
332 \- report only ioctl() transactions with ATA devices.
333
334 .I scsiioctl
335 \- report only ioctl() transactions with SCSI devices.
336
337 Any argument may include a positive integer to specify the level of
338 detail that should be reported. The argument should be followed by a
339 comma then the integer with no spaces. For example, \fIataioctl,2\fP
340 The default level is 1, so \'\-r ataioctl,1\' and \'\-r ataioctl\' are
341 equivalent.
342
343 .TP
344 .B \-\-service
345 Cygwin and Windows only: Enables \fBsmartd\fP to run as a Windows service.
346
347 On Cygwin, this option simply prevents forking into background mode to
348 allow running \fBsmartd\fP as service via cygrunsrv, see NOTES below.
349
350 On Windows, this option enables the buildin service support.
351 The option must be specified in the service command line as the first
352 argument. It should not be used from console.
353 See NOTES below for details.
354
355 .TP
356 .B \-V, \-\-version, \-\-license, \-\-copyright
357 Prints license, copyright, and CVS version information onto
358 STDOUT and then exits. Please include this information if you are
359 reporting bugs, or have specific questions about the behavior of
360 \fBsmartd\fP.
361
362 .SH EXAMPLES
363
364 .B
365 smartd
366 .fi
367 Runs the daemon in forked mode. This is the normal way to run
368 \fBsmartd\fP.
369 Entries are logged to SYSLOG (by default
370 .B /var/log/messages.)
371
372 .B
373 smartd -d -i 30
374 .fi
375 Run in foreground (debug) mode, checking the disk status
376 every 30 seconds.
377
378 .B
379 smartd -q onecheck
380 .fi
381 Registers devices, and checks the status of the devices exactly
382 once. The exit status (the bash
383 .B $?
384 variable) will be zero if all went well, and nonzero if no devices
385 were detected or some other problem was encountered.
386
387 .fi
388 Note that \fBsmartmontools\fP provides a start-up script in
389 \fB/usr/local/etc/rc.d/init.d/smartd\fP which is responsible for starting and
390 stopping the daemon via the normal init interface. Using this script,
391 you can start \fBsmartd\fP by giving the command:
392 .nf
393 .B /usr/local/etc/rc.d/init.d/smartd start
394 .fi
395 and stop it by using the command:
396 .nf
397 .B /usr/local/etc/rc.d/init.d/smartd stop
398
399 .fi
400 If you want \fBsmartd\fP to start running whenever your machine is
401 booted, this can be enabled by using the command:
402 .nf
403 .B /sbin/chkconfig --add smartd
404 .fi
405 and disabled using the command:
406 .nf
407 .B /sbin/chkconfig --del smartd
408 .fi
409
410 .\" DO NOT MODIFY THIS OR THE FOLLOWING TWO LINES. THIS MATERIAL
411 .\" IS AUTOMATICALLY INCLUDED IN THE FILE smartd.conf.5
412 .\" STARTINCLUDE
413
414 .SH CONFIGURATION FILE /usr/local/etc/smartd.conf
415 In the absence of a configuration file, under Linux
416 \fBsmartd\fP
417 will try to open the 20 ATA devices
418 .B /dev/hd[a-t]
419 and the 26 SCSI devices
420 .B /dev/sd[a-z].
421 Under FreeBSD,
422 \fBsmartd\fP
423 will try to open all existing ATA devices (with entries in /dev)
424 .B /dev/ad[0-9]+
425 and all existing SCSI devices
426 .B /dev/da[0-9]+.
427 Under NetBSD/OpenBSD,
428 \fBsmartd\fP
429 will try to open all existing ATA devices (with entries in /dev)
430 .B /dev/wd[0-9]+c
431 and all existing SCSI devices
432 .B /dev/sd[0-9]+c.
433 Under Solaris \fBsmartd\fP will try to open all entries \fB"/dev/rdsk/c?t?d?s?"\fP for IDE/ATA and SCSI disk
434 devices, and entries \fB"/dev/rmt/*"\fP for SCSI tape devices.
435 Under Windows \fBsmartd\fP will try to open all entries \fB"/dev/hd[a-j]"\fP ("\\\\.\\PhysicalDrive[0-9]")
436 for IDE/ATA devices on WinNT4/2000/XP, \fB"/dev/hd[a-d]"\fP
437 (bitmask from "\\\\.\\SMARTVSD") for IDE/ATA devices on Win95/98/98SE/ME,
438 and \fB"/dev/scsi[0-9][0-7]"\fP (ASPI adapter 0-9, ID 0-7) for SCSI
439 devices on all versions of Windows.
440 Under Darwin, \fBsmartd\fP will open any ATA block storage device.
441
442 This can be annoying if you have an ATA or SCSI device that hangs or
443 misbehaves when receiving SMART commands. Even if this causes no
444 problems, you may be annoyed by the string of error log messages about
445 block-major devices that can\'t be found, and SCSI devices that can\'t
446 be opened.
447
448 One can avoid this problem, and gain more control over the types of
449 events monitored by
450 \fBsmartd\fP,
451 by using the configuration file
452 .B /usr/local/etc/smartd.conf.
453 This file contains a list of devices to monitor, with one device per
454 line. An example file is included with the
455 .B smartmontools
456 distribution. You will find this sample configuration file in
457 \fB/usr/local/share/doc/smartmontools-5.1/\fP. For security, the configuration file
458 should not be writable by anyone but root. The syntax of the file is as
459 follows:
460 .IP \(bu 4
461 There should be one device listed per line, although you may have
462 lines that are entirely comments or white space.
463 .IP \(bu 4
464 Any text following a hash sign \'#\' and up to the end of the line is
465 taken to be a comment, and ignored.
466 .IP \(bu 4
467 Lines may be continued by using a backslash \'\e\' as the last
468 non-whitespace or non-comment item on a line.
469 .IP \(bu 4
470 Note: a line whose first character is a hash sign \'#\' is treated as
471 a white-space blank line, \fBnot\fP as a non-existent line, and will
472 \fBend\fP a continuation line.
473 .PP 0
474 .fi
475 Here is an example configuration file. It\'s for illustrative purposes
476 only; please don\'t copy it onto your system without reading to the end
477 of the
478 .B DIRECTIVES
479 Section below!
480
481 .nf
482 .B ################################################
483 .B # This is an example smartd startup config file
484 .B # /usr/local/etc/smartd.conf for monitoring three
485 .B # ATA disks, three SCSI disks, six ATA disks
486 .B # behind two 3ware controllers, three SATA disks
487 .B # directly connected to the highpoint rocket-
488 .B # raid controller, two SATA disks connected to
489 .B # the highpoint controller via a pmport device
490 .B # and one SATA disk.
491 .B #
492 .nf
493 .B # First ATA disk on two different interfaces. On
494 .B # the second disk, start a long self-test every
495 .B # Sunday between 3 and 4 am.
496 .B #
497 .B \ \ /dev/hda -a -m admin@example.com,root@localhost
498 .B \ \ /dev/hdc -a -I 194 -I 5 -i 12 -s L/../../7/03
499 .B #
500 .nf
501 .B # SCSI disks. Send a TEST warning email to admin on
502 .B # startup.
503 .B #
504 .B \ \ /dev/sda
505 .B \ \ /dev/sdb -m admin@example.com -M test
506 .B #
507 .nf
508 .B # Strange device. It\'s SCSI. Start a scheduled
509 .B # long self test between 5 and 6 am Monday/Thursday
510 .B \ \ /dev/weird -d scsi -s L/../../(1|4)/05
511 .B #
512 .nf
513 .B # Linux-specific: SATA disk using the libata
514 .B # driver. This requires a 2.6.15 or greater
515 .B # kernel. The device entry is SCSI but the
516 .B # underlying disk understands ATA SMART commands
517 .B \ \ /dev/sda -a -d ata
518 .B #
519 .nf
520 .B # Four ATA disks on a 3ware 6/7/8000 controller.
521 .B # Start short self-tests daily between midnight and 1am,
522 .B # 1-2, 2-3, and 3-4 am. Starting with the Linux 2.6
523 .B # kernel series, /dev/sdX is deprecated in favor of
524 .B # /dev/tweN. For example replace /dev/sdc by /dev/twe0
525 .B # and /dev/sdd by /dev/twe1.
526 .B \ \ /dev/sdc -d 3ware,0 -a -s S/../.././00
527 .B \ \ /dev/sdc -d 3ware,1 -a -s S/../.././01
528 .B \ \ /dev/sdd -d 3ware,2 -a -s S/../.././02
529 .B \ \ /dev/sdd -d 3ware,3 -a -s S/../.././03
530 .B #
531 .nf
532 .B # Two ATA disks on a 3ware 9000 controller.
533 .B # Start long self-tests Sundays between midnight and
534 .B # 1am and 2-3 am
535 .B \ \ /dev/twa0 -d 3ware,0 -a -s L/../../7/00
536 .B \ \ /dev/twa0 -d 3ware,1 -a -s L/../../7/02
537 .B #
538 .nf
539 .B # Three SATA disks on a highpoint rocketraid controller.
540 .B # Start short self-tests daily between 1-2, 2-3, and
541 .B # 3-4 am.
542 .B \ \ /dev/sde -d hpt,1/1 -a -s S/../.././01
543 .B \ \ /dev/sde -d hpt,1/2 -a -s S/../.././02
544 .B \ \ /dev/sde -d hpt,1/3 -a -s S/../.././03
545 .B #
546 .nf
547 .B # Two SATA disks connected to a highpoint rocketraid
548 .B # via a pmport device. Start long self-tests Sundays
549 .B # between midnight and 1am and 2-3 am
550 .B \ \ /dev/sde -d hpt,1/4/1 -a -s L/../../7/00
551 .B \ \ /dev/sde -d hpt,1/4/2 -a -s L/../../7/02
552 .B #
553 .nf
554 .B # The following line enables monitoring of the
555 .B # ATA Error Log and the Self-Test Error Log.
556 .B # It also tracks changes in both Prefailure
557 .B # and Usage Attributes, apart from Attributes
558 .B # 9, 194, and 231, and shows continued lines:
559 .B #
560 .B \ \ /dev/hdd\ -l\ error\ \e
561 .B \ \ \ \ \ \ \ \ \ \ \ -l\ selftest\ \e
562 .B \ \ \ \ \ \ \ \ \ \ \ -t\ \e\ \ \ \ \ \ # Attributes not tracked:
563 .B \ \ \ \ \ \ \ \ \ \ \ -I\ 194\ \e\ \ # temperature
564 .B \ \ \ \ \ \ \ \ \ \ \ -I\ 231\ \e\ \ # also temperature
565 .B \ \ \ \ \ \ \ \ \ \ \ -I 9\ \ \ \ \ \ # power-on hours
566 .B #
567 .B ################################################
568 .fi
569
570 .PP
571 .SH CONFIGURATION FILE DIRECTIVES
572 .PP
573
574 If the first non-comment entry in the configuration file is the text
575 string
576 .B DEVICESCAN
577 in capital letters, then
578 \fBsmartd\fP
579 will ignore any remaining lines in the configuration file, and will
580 scan for devices.
581 .B DEVICESCAN
582 may optionally be followed by Directives that will apply to all
583 devices that are found in the scan. Please see below for additional
584 details.
585
586 .sp 2
587 The following are the Directives that may appear following the device
588 name or
589 .B DEVICESCAN
590 on any line of the
591 .B /usr/local/etc/smartd.conf
592 configuration file. Note that
593 .B these are NOT command-line options for
594 \fBsmartd\fP.
595 The Directives below may appear in any order, following the device
596 name.
597
598 .B For an ATA device,
599 if no Directives appear, then the device will be monitored
600 as if the \'\-a\' Directive (monitor all SMART properties) had been given.
601
602 .B If a SCSI disk is listed,
603 it will be monitored at the maximum implemented level: roughly
604 equivalent to using the \'\-H \-l selftest\' options for an ATA disk.
605 So with the exception of \'\-d\', \'\-m\', \'\-l selftest\', \'\-s\', and
606 \'\-M\', the Directives below are ignored for SCSI disks. For SCSI
607 disks, the \'\-m\' Directive sends a warning email if the SMART status
608 indicates a disk failure or problem, if the SCSI inquiry about disk
609 status fails, or if new errors appear in the self-test log.
610
611 .B If a 3ware controller is used
612 then the corresponding SCSI (/dev/sd?) or character device (/dev/twe?
613 or /dev/twa?) must be listed, along with the \'\-d 3ware,N\' Directive
614 (see below). The individual ATA disks hosted by the 3ware controller
615 appear to \fBsmartd\fP as normal ATA devices. Hence all the ATA
616 directives can be used for these disks (but see note below).
617
618 .TP
619 .B \-d TYPE
620 Specifies the type of the device. This Directive may be used multiple
621 times for one device, but the arguments \fIata\fP, \fIscsi\fP, \fIsat\fP,
622 \fImarvell\fP, and \fI3ware,N\fP are mutually-exclusive. If more than
623 one is given then \fBsmartd\fP will use the last one which appears.
624
625 If none of these three arguments is given, then \fBsmartd\fP will
626 first attempt to guess the device type by looking at whether the sixth
627 character in the device name is an \'s\' or an \'h\'. This will work for
628 device names like /dev/hda or /dev/sdb, and corresponds to choosing
629 \fIata\fP or \fIscsi\fP respectively. If
630 \fBsmartd\fP
631 can\'t guess from this sixth character, then it will simply try to
632 access the device using first ATA and then SCSI ioctl()s.
633
634 The valid arguments to this Directive are:
635
636 .I ata
637 \- the device type is ATA. This prevents
638 \fBsmartd\fP
639 from issuing SCSI commands to an ATA device.
640
641 .I scsi
642 \- the device type is SCSI. This prevents
643 \fBsmartd\fP
644 from issuing ATA commands to a SCSI device.
645
646 .I sat
647 \- the device type is SCSI to ATA Translation (SAT).
648 \fBsmartd\fP
649 will generate ATA (smart) commands and then package them in
650 the SAT defined ATA PASS THROUGH SCSI commands. The commands
651 are then routed through the SCSI pass through interface to the
652 operating system. There are two types of ATA PASS THROUGH
653 SCSI commands: a 12 byte and 16 byte variant.
654 \fBsmartd\fP
655 can use either and defaults to the 16 byte variant. This can
656 be overridden with this syntax: \'\-d sat,12\' or \'\-d sat,16\'.
657
658 .I marvell
659 \- Under Linux, interact with SATA disks behind Marvell chip-set
660 controllers (using the Marvell rather than libata driver).
661
662 .I 3ware,N
663 \- the device consists of one or more ATA disks connected to a 3ware
664 RAID controller. The non-negative integer N (in the range from 0 to 15
665 inclusive) denotes which disk on the controller is monitored. In log
666 files and email messages this disk will be identified as 3ware_disk_XX
667 with XX in the range from 00 to 15 inclusive.
668
669 This Directive may at first appear confusing, because the 3ware
670 controller is a SCSI device (such as /dev/sda) and should be listed as
671 such in the the configuration file.
672 However when the \'\-d 3ware,N\'
673 Directive is used, then the corresponding disk is addressed using
674 native ATA commands which are \'passed through\' the SCSI driver. All
675 ATA Directives listed in this man page may be used. Note that while
676 you may use \fBany\fP of the 3ware SCSI logical devices /dev/sd? to
677 address \fBany\fP of the physical disks (3ware ports), error and log
678 messages will make the most sense if you always list the 3ware SCSI
679 logical device corresponding to the particular physical disks. Please
680 see the \fBsmartctl\fP man page for further details.
681
682 ATA disks behind 3ware controllers may alternatively be accessed via a
683 character device interface /dev/twe0-15 (3ware 6000/7000/8000
684 controllers) and /dev/twa0-15 (3ware 9000 series controllers). Note
685 that the 9000 series controllers may \fBonly\fP be accessed using the
686 character device interface /dev/twa0-15 and not the SCSI device
687 interface /dev/sd?. Please see the \fBsmartctl\fP man page for
688 further details.
689
690 Note that older 3w-xxxx drivers do not pass the \'Enable Autosave\'
691 (\fB-S on\fP) and \'Enable Automatic Offline\' (\fB-o on\fP) commands
692 to the disk, if the SCSI interface is used, and produce these types of
693 harmless syslog error messages instead: \fB\'3w-xxxx: tw_ioctl():
694 Passthru size (123392) too big\'\fP. This can be fixed by upgrading to
695 version 1.02.00.037 or later of the 3w-xxxx driver, or by applying a
696 patch to older versions. See
697 \fBhttp://smartmontools.sourceforge.net/\fP for instructions.
698 Alternatively use the character device interfaces /dev/twe0-15 (3ware
699 6/7/8000 series controllers) or /dev/twa0-15 (3ware 9000 series
700 controllers).
701
702
703 .B 3ware controllers are currently ONLY supported under Linux.
704
705 .I hpt,L/M/N
706 \- the device consists of one or more ATA disks connected to a HighPoint
707 RocketRAID controller. The integer L is the controller id, the integer M
708 is the channel number, and the integer N is the PMPort number if it is
709 available. The allowed values of L are from 1 to 4 inclusive, M are from
710 1 to 8 inclusive and N from 1 to 4 if PMPort available. And also these
711 values are limited by the model of the HighPoint RocketRAID controller.
712 In log files and email messages this disk will be identified as
713 hpt_X/X/X and X/X/X is the same as L/M/N, note if no N indicated, N set
714 to the default value 1.
715
716 .B HighPoint RocketRAID controllers are currently ONLY supported under Linux.
717
718 .I removable
719 \- the device or its media is removable. This indicates to
720 \fBsmartd\fP
721 that it should continue (instead of exiting, which is the default
722 behavior) if the device does not appear to be present when
723 \fBsmartd\fP is started. This Directive may be used in conjunction
724 with the other \'\-d\' Directives.
725
726 .TP
727 .B \-n POWERMODE[,q]
728 This \'nocheck\' Directive is used to prevent a disk from being
729 spun-up when it is periodically polled by \fBsmartd\fP.
730
731 ATA disks have five different power states. In order of increasing
732 power consumption they are: \'OFF\', \'SLEEP\', \'STANDBY\', \'IDLE\',
733 and \'ACTIVE\'. Typically in the OFF, SLEEP, and STANDBY modes the
734 disk\'s platters are not spinning. But usually, in response to SMART
735 commands issued by \fBsmartd\fP, the disk platters are spun up. So if
736 this option is not used, then a disk which is in a low\-power mode may
737 be spun up and put into a higher\-power mode when it is periodically
738 polled by \fBsmartd\fP.
739
740 Note that if the disk is in SLEEP mode when \fBsmartd\fP is started,
741 then it won't respond to \fBsmartd\fP commands, and so the disk won't
742 be registered as a device for \fBsmartd\fP to monitor. If a disk is in
743 any other low\-power mode, then the commands issued by \fBsmartd\fP to
744 register the disk will probably cause it to spin\-up.
745
746 The \'\fB\-n\fP\' (nocheck) Directive specifies if \fBsmartd\fP\'s
747 periodic checks should still be carried out when the device is in a
748 low\-power mode. It may be used to prevent a disk from being spun\-up
749 by periodic \fBsmartd\fP polling. The allowed values of POWERMODE
750 are:
751
752 .I never
753 \- \fBsmartd\fP will poll (check) the device regardless of its power
754 mode. This may cause a disk which is spun\-down to be spun\-up when
755 \fBsmartd\fP checks it. This is the default behavior if the '\-n'
756 Directive is not given.
757
758 .I sleep
759 \- check the device unless it is in SLEEP mode.
760
761 .I standby
762 \- check the device unless it is in SLEEP or STANDBY mode. In
763 these modes most disks are not spinning, so if you want to prevent
764 a laptop disk from spinning up each time that \fBsmartd\fP polls,
765 this is probably what you want.
766
767 .I idle
768 \- check the device unless it is in SLEEP, STANDBY or IDLE mode.
769 In the IDLE state, most disks are still spinning, so this is probably
770 not what you want.
771
772 When a self test is scheduled (see \'\-s\' Directive below), the
773 \'\fB\-n\fP\' Directive is ignored, and all tests are carried out.
774
775 When a periodic test is skipped, \fBsmartd\fP normally writes an
776 informal log message. The message can be suppressed by appending
777 the option \',q\' to POWERMODE (like \'\-n standby,q\').
778 This prevents a laptop disk from spinning up due to this message.
779
780 .TP
781 .B \-T TYPE
782 Specifies how tolerant
783 \fBsmartd\fP
784 should be of SMART command failures. The valid arguments to this
785 Directive are:
786
787 .I normal
788 \- do not try to monitor the disk if a mandatory SMART command fails, but
789 continue if an optional SMART command fails. This is the default.
790
791 .I permissive
792 \- try to monitor the disk even if it appears to lack SMART
793 capabilities. This may be required for some old disks (prior to
794 ATA\-3 revision 4) that implemented SMART before the SMART standards
795 were incorporated into the ATA/ATAPI Specifications. This may also be
796 needed for some Maxtor disks which fail to comply with the ATA
797 Specifications and don't properly indicate support for error\- or
798 self\-test logging.
799
800 [Please see the \fBsmartctl \-T\fP command-line option.]
801 .TP
802 .B \-o VALUE
803 Enables or disables SMART Automatic Offline Testing when
804 \fBsmartd\fP
805 starts up and has no further effect. The valid arguments to this
806 Directive are \fIon\fP and \fIoff\fP.
807
808 The delay between tests is vendor-specific, but is typically four
809 hours.
810
811 Note that SMART Automatic Offline Testing is \fBnot\fP part of the ATA
812 Specification. Please see the
813 .B smartctl \-o
814 command-line option documentation for further information about this
815 feature.
816 .TP
817 .B \-S VALUE
818 Enables or disables Attribute Autosave when \fBsmartd\fP
819 starts up and has no further effect. The valid arguments to this
820 Directive are \fIon\fP and \fIoff\fP. Also affects SCSI devices.
821 [Please see the \fBsmartctl \-S\fP command-line option.]
822 .TP
823 .B \-H
824 Check the SMART health status of the disk. If any Prefailure
825 Attributes are less than or equal to their threshold values, then disk
826 failure is predicted in less than 24 hours, and a message at loglevel
827 .B \'LOG_CRITICAL\'
828 will be logged to syslog. [Please see the
829 .B smartctl \-H
830 command-line option.]
831 .TP
832 .B \-l TYPE
833 Reports increases in the number of errors in one of the two SMART logs. The
834 valid arguments to this Directive are:
835
836 .I error
837 \- report if the number of ATA errors reported in the ATA Error Log
838 has increased since the last check.
839
840 .I selftest
841 \- report if the number of failed tests reported in the SMART
842 Self-Test Log has increased since the last check, or if the timestamp
843 associated with the most recent failed test has increased. Note that
844 such errors will \fBonly\fP be logged if you run self-tests on the
845 disk (and it fails a test!). Self-Tests can be run automatically by
846 \fBsmartd\fP: please see the \fB\'\-s\'\fP Directive below.
847 Self-Tests can also be run manually by using the \fB\'\-t\ short\'\fP
848 and \fB\'\-t\ long\'\fP options of \fBsmartctl\fP and the results of
849 the testing can be observed using the \fBsmartctl \'\-l\ selftest\'\fP
850 command-line option.]
851
852 [Please see the \fBsmartctl \-l\fP and \fB\-t\fP command-line
853 options.]
854 .TP
855 .B \-s REGEXP
856 Run Self-Tests or Offline Immediate Tests, at scheduled times. A
857 Self- or Offline Immediate Test will be run at the end of periodic
858 device polling, if all 12 characters of the string \fBT/MM/DD/d/HH\fP
859 match the extended regular expression \fBREGEXP\fP. Here:
860 .RS 7
861 .IP \fBT\fP 4
862 is the type of the test. The values that \fBsmartd\fP will try to
863 match (in turn) are: \'L\' for a \fBL\fPong Self-Test, \'S\' for a
864 \fBS\fPhort Self-Test, \'C\' for a \fBC\fPonveyance Self-Test (ATA
865 only), and \'O\' for an \fBO\fPffline Immediate Test (ATA only). As
866 soon as a match is found, the test will be started and no additional
867 matches will be sought for that device and that polling cycle.
868 .IP \fBMM\fP 4
869 is the month of the year, expressed with two decimal digits. The
870 range is from 01 (January) to 12 (December) inclusive. Do \fBnot\fP
871 use a single decimal digit or the match will always fail!
872 .IP \fBDD\fP 4
873 is the day of the month, expressed with two decimal digits. The
874 range is from 01 to 31 inclusive. Do \fBnot\fP
875 use a single decimal digit or the match will always fail!
876 .IP \fBd\fP 4
877 is the day of the week, expressed with one decimal digit. The
878 range is from 1 (Monday) to 7 (Sunday) inclusive.
879 .IP \fBHH\fP 4
880 is the hour of the day, written with two decimal digits, and given in
881 hours after midnight. The range is 00 (midnight to just before 1am)
882 to 23 (11pm to just before midnight) inclusive. Do \fBnot\fP use a
883 single decimal digit or the match will always fail!
884 .RE
885 .\" The following two lines are a workaround for a man2html bug. Please leave them.
886 .\" They define a non-existent option; useful because man2html can't correctly reset the margins.
887 .TP
888 .B \&
889 Some examples follow. In reading these, keep in mind that in extended
890 regular expressions a dot \fB\'.\'\fP matches any single character, and
891 a parenthetical expression such as \fB\'(A|B|C)\'\fP denotes any one of the three possibilities \fBA\fP,
892 \fBB\fP, or \fBC\fP.
893
894 To schedule a short Self-Test between 2-3am every morning, use:
895 .nf
896 \fB \-s S/../.././02\fP
897 .fi
898 To schedule a long Self-Test between 4-5am every Sunday morning, use:
899 .nf
900 \fB \-s L/../../7/04\fP
901 .fi
902 To schedule a long Self-Test between 10-11pm on the first and
903 fifteenth day of each month, use:
904 .nf
905 \fB \-s L/../(01|15)/./22\fP
906 .fi
907 To schedule an Offline Immediate test after every midnight, 6am,
908 noon,and 6pm, plus a Short Self-Test daily at 1-2am and a Long
909 Self-Test every Saturday at 3-4am, use:
910 .nf
911 \fB \-s (O/../.././(00|06|12|18)|S/../.././01|L/../../6/03)\fP
912 .fi
913
914 Scheduled tests are run immediately following the regularly-scheduled
915 device polling, if the current local date, time, and test type, match
916 \fBREGEXP\fP. By default the regularly-scheduled device polling
917 occurs every thirty minutes after starting \fBsmartd\fP. Take caution
918 if you use the \'\-i\' option to make this polling interval more than
919 sixty minutes: the poll times may fail to coincide with any of the
920 testing times that you have specified with \fBREGEXP\fP, and so the
921 self tests may not take place as you wish.
922
923 Before running an offline or self-test, \fBsmartd\fP checks to be sure
924 that a self-test is not already running. If a self-test \fBis\fP
925 already running, then this running self test will \fBnot\fP be
926 interrupted to begin another test.
927
928 \fBsmartd\fP will not attempt to run \fBany\fP type of test if another
929 test was already started or run in the same hour.
930
931 Each time a test is run, \fBsmartd\fP will log an entry to SYSLOG.
932 You can use these or the '-q showtests' command-line option to verify
933 that you constructed \fBREGEXP\fP correctly. The matching order
934 (\fBL\fP before \fBS\fP before \fBC\fP before \fBO\fP) ensures that
935 if multiple test types are all scheduled for the same hour, the
936 longer test type has precedence. This is usually the desired behavior.
937
938 Unix users: please beware that the rules for extended regular
939 expressions [regex(7)] are \fBnot\fP the same as the rules for
940 file\-name pattern matching by the shell [glob(7)]. \fBsmartd\fP will
941 issue harmless informational warning messages if it detects characters
942 in \fBREGEXP\fP that appear to indicate that you have made this
943 mistake.
944
945 .TP
946 .B \-m ADD
947 Send a warning email to the email address \fBADD\fP if the \'\-H\',
948 \'\-l\', \'\-f\', \'\-C\', or \'\-O\' Directives detect a failure or a
949 new error, or if a SMART command to the disk fails. This Directive
950 only works in conjunction with these other Directives (or with the
951 equivalent default \'\-a\' Directive).
952
953 To prevent your email in-box from getting filled up with warning
954 messages, by default only a single warning will be sent for each of
955 the enabled alert types, \'\-H\', \'\-l\', \'\-f\', \'\-C\', or
956 \'\-O\' even if more than one failure or error is detected or if the
957 failure or error persists. [This behavior can be modified; see the
958 \'\-M\' Directive below.]
959
960 To send email to more than one user, please use the following "comma
961 separated" form for the address: \fBuser1@add1,user2@add2,...,userN@addN\fP
962 (with no spaces).
963
964 To test that email is being sent correctly, use the \'\-M test\'
965 Directive described below to send one test email message on
966 \fBsmartd\fP
967 startup.
968
969 By default, email is sent using the system
970 .B mail
971 command. In order that
972 \fBsmartd\fP
973 find the mail command (normally /bin/mail) an executable named
974 .B \'mail\'
975 must be in the path of the shell or environment from which
976 \fBsmartd\fP
977 was started. If you wish to specify an explicit path to the mail
978 executable (for example /usr/local/bin/mail) or a custom script to
979 run, please use the \'\-M exec\' Directive below.
980
981 Note that by default under Solaris, in the previous paragraph,
982 \'\fBmailx\fP\' and \'\fB/bin/mailx\fP\' are used, since Solaris
983 \'/bin/mail\' does not accept a \'\-s\' (Subject) command-line
984 argument.
985
986 On Windows, the \'\fBBlat\fP\' mailer
987 (\fBhttp://blat.sourceforge.net/\fP) is used by default.
988 This mailer uses a different command line syntax, see
989 \'\-M exec\' below.
990
991 Note also that there is a special argument
992 .B <nomailer>
993 which can be given to the \'\-m\' Directive in conjunction with the \'\-M
994 exec\' Directive. Please see below for an explanation of its effect.
995
996 If the mailer or the shell running it produces any STDERR/STDOUT
997 output, then a snippet of that output will be copied to SYSLOG. The
998 remainder of the output is discarded. If problems are encountered in
999 sending mail, this should help you to understand and fix them. If
1000 you have mail problems, we recommend running \fBsmartd\fP in debug
1001 mode with the \'-d\' flag, using the \'-M test\' Directive described
1002 below.
1003
1004 The following extension is available on Windows:
1005 By specifying \'\fBmsgbox\fP\' as a mail address, a warning
1006 "email" is displayed as a message box on the screen.
1007 Using both \'\fBmsgbox\fP\' and regular mail addresses is possible,
1008 if \'\fBmsgbox\fP\' is the first word in the comma separated list.
1009 With \'\fBsysmsgbox\fP\', a system modal (always on top) message box
1010 is used. If running as a service, a service notification message box
1011 (always shown on current visible desktop) is used.
1012
1013 .TP
1014 .B \-M TYPE
1015 These Directives modify the behavior of the
1016 \fBsmartd\fP
1017 email warnings enabled with the \'\-m\' email Directive described above.
1018 These \'\-M\' Directives only work in conjunction with the \'\-m\'
1019 Directive and can not be used without it.
1020
1021 Multiple \-M Directives may be given. If more than one of the
1022 following three \-M Directives are given (example: \-M once \-M daily)
1023 then the final one (in the example, \-M daily) is used.
1024
1025 The valid arguments to the \-M Directive are (one of the following
1026 three):
1027
1028 .I once
1029 \- send only one warning email for each type of disk problem detected. This
1030 is the default.
1031
1032 .I daily
1033 \- send additional warning reminder emails, once per day, for each type
1034 of disk problem detected.
1035
1036 .I diminishing
1037 \- send additional warning reminder emails, after a one-day interval,
1038 then a two-day interval, then a four-day interval, and so on for each
1039 type of disk problem detected. Each interval is twice as long as the
1040 previous interval.
1041
1042 In addition, one may add zero or more of the following Directives:
1043
1044 .I test
1045 \- send a single test email
1046 immediately upon
1047 \fBsmartd\fP
1048 startup. This allows one to verify that email is delivered correctly.
1049
1050 .I exec PATH
1051 \- run the executable PATH instead of the default mail command, when
1052 \fBsmartd\fP
1053 needs to send email. PATH must point to an executable binary file or
1054 script.
1055
1056 By setting PATH to point to a customized script, you can make
1057 \fBsmartd\fP perform useful tricks when a disk problem is detected
1058 (beeping the console, shutting down the machine, broadcasting warnings
1059 to all logged-in users, etc.) But please be careful. \fBsmartd\fP
1060 will \fBblock\fP until the executable PATH returns, so if your
1061 executable hangs, then \fBsmartd\fP will also hang. Some sample
1062 scripts are included in
1063 /usr/local/share/doc/smartmontools-5.1/examplescripts/.
1064
1065 The return status of the executable is recorded by \fBsmartd\fP in
1066 SYSLOG. The executable is not expected to write to STDOUT or
1067 STDERR. If it does, then this is interpreted as indicating that
1068 something is going wrong with your executable, and a fragment of this
1069 output is logged to SYSLOG to help you to understand the problem.
1070 Normally, if you wish to leave some record behind, the executable
1071 should send mail or write to a file or device.
1072
1073 Before running the executable, \fBsmartd\fP sets a number of
1074 environment variables. These environment variables may be used to
1075 control the executable\'s behavior. The environment variables
1076 exported by \fBsmartd\fP are:
1077 .RS 7
1078 .IP \fBSMARTD_MAILER\fP 4
1079 is set to the argument of \-M exec, if present or else to \'mail\'
1080 (examples: /bin/mail, mail).
1081 .IP \fBSMARTD_DEVICE\fP 4
1082 is set to the device path (examples: /dev/hda, /dev/sdb).
1083 .IP \fBSMARTD_DEVICETYPE\fP 4
1084 is set to the device type (possible values: ata, scsi, 3ware,N, hpt,L/M/N).
1085 Here N=0,...,15 denotes the ATA disk behind a 3ware RAID controller and
1086 L/M/N denotes the SATA disk behind a HighPoint RocketRAID controller.
1087 .IP \fBSMARTD_DEVICESTRING\fP 4
1088 is set to the device description. For SMARTD_DEVICETYPE of ata or
1089 scsi, this is the same as SMARTD_DEVICE. For 3ware RAID controllers,
1090 the form used is \'/dev/sdc [3ware_disk_01]\'. For HighPoint RocketRAID
1091 controller, the form is \'/dev/sdd [hpt_1/1/1]\'. In these cases the
1092 device string contains a space and is NOT quoted. So to use
1093 $SMARTD_DEVICESTRING in a bash script you should probably enclose it
1094 in double quotes.
1095 .IP \fBSMARTD_FAILTYPE\fP 4
1096 gives the reason for the warning or message email. The possible values that
1097 it takes and their meanings are:
1098 .nf
1099 .fi
1100 \fIEmailTest\fP: this is an email test message.
1101 .nf
1102 .fi
1103 \fIHealth\fP: the SMART health status indicates imminent failure.
1104 .nf
1105 .fi
1106 \fIUsage\fP: a usage Attribute has failed.
1107 .nf
1108 .fi
1109 \fISelfTest\fP: the number of self-test failures has increased.
1110 .nf
1111 .fi
1112 \fIErrorCount\fP: the number of errors in the ATA error log has increased.
1113 .nf
1114 .fi
1115 \fICurrentPendingSector\fP: one of more disk sectors could not be
1116 read and are marked to be reallocated (replaced with spare sectors).
1117 .nf
1118 .fi
1119 \fIOfflineUncorrectableSector\fP: during off\-line testing, or self\-testing,
1120 one or more disk sectors could not be read.
1121 .nf
1122 .fi
1123 \fIFailedHealthCheck\fP: the SMART health status command failed.
1124 .nf
1125 .fi
1126 \fIFailedReadSmartData\fP: the command to read SMART Attribute data failed.
1127 .nf
1128 .fi
1129 \fIFailedReadSmartErrorLog\fP: the command to read the SMART error log failed.
1130 .nf
1131 .fi
1132 \fIFailedReadSmartSelfTestLog\fP: the command to read the SMART self-test log failed.
1133 .nf
1134 .fi
1135 \fIFailedOpenDevice\fP: the open() command to the device failed.
1136 .IP \fBSMARTD_ADDRESS\fP 4
1137 is determined by the address argument ADD of the \'\-m\' Directive.
1138 If ADD is \fB<nomailer>\fP, then \fBSMARTD_ADDRESS\fP is not set.
1139 Otherwise, it is set to the comma-separated-list of email addresses
1140 given by the argument ADD, with the commas replaced by spaces
1141 (example:admin@example.com root). If more than one email address is
1142 given, then this string will contain space characters and is NOT
1143 quoted, so to use it in a bash script you may want to enclose it in
1144 double quotes.
1145 .IP \fBSMARTD_MESSAGE\fP 4
1146 is set to the one sentence summary warning email message string from
1147 \fBsmartd\fP.
1148 This message string contains space characters and is NOT quoted. So to
1149 use $SMARTD_MESSAGE in a bash script you should probably enclose it in
1150 double quotes.
1151 .IP \fBSMARTD_FULLMESSAGE\fP 4
1152 is set to the contents of the entire email warning message string from
1153 \fBsmartd\fP.
1154 This message string contains space and return characters and is NOT quoted. So to
1155 use $SMARTD_FULLMESSAGE in a bash script you should probably enclose it in
1156 double quotes.
1157 .IP \fBSMARTD_TFIRST\fP 4
1158 is a text string giving the time and date at which the first problem
1159 of this type was reported. This text string contains space characters
1160 and no newlines, and is NOT quoted. For example:
1161 .nf
1162 .fi
1163 Sun Feb 9 14:58:19 2003 CST
1164 .IP \fBSMARTD_TFIRSTEPOCH\fP 4
1165 is an integer, which is the unix epoch (number of seconds since Jan 1,
1166 1970) for \fBSMARTD_TFIRST\fP.
1167 .RE
1168 .\" The following two lines are a workaround for a man2html bug. Please leave them.
1169 .\" They define a non-existent option; useful because man2html can't correctly reset the margins.
1170 .TP
1171 .B \&
1172 The shell which is used to run PATH is system-dependent. For vanilla
1173 Linux/glibc it\'s bash. For other systems, the man page for
1174 \fBpopen\fP(3) should say what shell is used.
1175
1176 If the \'\-m ADD\' Directive is given with a normal address argument,
1177 then the executable pointed to by PATH will be run in a shell with
1178 STDIN receiving the body of the email message, and with the same
1179 command-line arguments:
1180 .nf
1181 -s "$SMARTD_SUBJECT" $SMARTD_ADDRESS
1182 .fi
1183 that would normally be provided to \'mail\'. Examples include:
1184 .nf
1185 .B -m user@home -M exec /bin/mail
1186 .B -m admin@work -M exec /usr/local/bin/mailto
1187 .B -m root -M exec /Example_1/bash/script/below
1188 .fi
1189
1190 Note that on Windows, the syntax of the \'\fBBlat\fP\' mailer is
1191 used:
1192 .nf
1193 - -q -subject "$SMARTD_SUBJECT" -to "$SMARTD_ADDRESS"
1194 .fi
1195
1196 If the \'\-m ADD\' Directive is given with the special address argument
1197 .B <nomailer>
1198 then the executable pointed to by PATH is run in a shell with
1199 .B no
1200 STDIN and
1201 .B no
1202 command-line arguments, for example:
1203 .nf
1204 .B -m <nomailer> -M exec /Example_2/bash/script/below
1205 .fi
1206 If the executable produces any STDERR/STDOUT output, then \fBsmartd\fP
1207 assumes that something is going wrong, and a snippet of that output
1208 will be copied to SYSLOG. The remainder of the output is then
1209 discarded.
1210
1211 Some EXAMPLES of scripts that can be used with the \'\-M exec\'
1212 Directive are given below. Some sample scripts are also included in
1213 /usr/local/share/doc/smartmontools-5.1/examplescripts/.
1214
1215 .TP
1216 .B \-f
1217 Check for \'failure\' of any Usage Attributes. If these Attributes are
1218 less than or equal to the threshold, it does NOT indicate imminent
1219 disk failure. It "indicates an advisory condition where the usage or
1220 age of the device has exceeded its intended design life period."
1221 [Please see the \fBsmartctl \-A\fP command-line option.]
1222 .TP
1223 .B \-p
1224 Report anytime that a Prefail Attribute has changed
1225 its value since the last check, 30 minutes ago. [Please see the
1226 .B smartctl \-A
1227 command-line option.]
1228 .TP
1229 .B \-u
1230 Report anytime that a Usage Attribute has changed its value
1231 since the last check, 30 minutes ago. [Please see the
1232 .B smartctl \-A
1233 command-line option.]
1234 .TP
1235 .B \-t
1236 Equivalent to turning on the two previous flags \'\-p\' and \'\-u\'.
1237 Tracks changes in \fIall\fP device Attributes (both Prefailure and
1238 Usage). [Please see the \fBsmartctl\fP \-A command-line option.]
1239 .TP
1240 .B \-i ID
1241 Ignore device Attribute number \fBID\fP when checking for failure of
1242 Usage Attributes. \fBID\fP must be a decimal integer in the range
1243 from 1 to 255. This Directive modifies the behavior of the \'\-f\'
1244 Directive and has no effect without it.
1245
1246 This is useful, for example, if you have a very old disk and don\'t
1247 want to keep getting messages about the hours-on-lifetime Attribute
1248 (usually Attribute 9) failing. This Directive may appear multiple
1249 times for a single device, if you want to ignore multiple Attributes.
1250 .TP
1251 .B \-I ID
1252 Ignore device Attribute \fBID\fP when tracking changes in the
1253 Attribute values. \fBID\fP must be a decimal integer in the range
1254 from 1 to 255. This Directive modifies the behavior of the \'\-p\',
1255 \'\-u\', and \'\-t\' tracking Directives and has no effect without one
1256 of them.
1257
1258 This is useful, for example, if one of the device Attributes is the disk
1259 temperature (usually Attribute 194 or 231). It\'s annoying to get reports
1260 each time the temperature changes. This Directive may appear multiple
1261 times for a single device, if you want to ignore multiple Attributes.
1262 .TP
1263 .B \-r ID
1264 When tracking, report the \fIRaw\fP value of Attribute \fBID\fP along
1265 with its (normally reported) \fINormalized\fP value. \fBID\fP must be
1266 a decimal integer in the range from 1 to 255. This Directive modifies
1267 the behavior of the \'\-p\', \'\-u\', and \'\-t\' tracking Directives
1268 and has no effect without one of them. This Directive may be given
1269 multiple times.
1270
1271 A common use of this Directive is to track the device Temperature
1272 (often ID=194 or 231).
1273
1274 .TP
1275 .B \-R ID
1276 When tracking, report whenever the \fIRaw\fP value of Attribute
1277 \fBID\fP changes. (Normally \fBsmartd\fP only tracks/reports changes
1278 of the \fINormalized\fP Attribute values.) \fBID\fP must be a decimal
1279 integer in the range from 1 to 255. This Directive modifies the
1280 behavior of the \'\-p\', \'\-u\', and \'\-t\' tracking Directives and
1281 has no effect without one of them. This Directive may be given
1282 multiple times.
1283
1284 If this Directive is given, it automatically implies the \'\-r\'
1285 Directive for the same Attribute, so that the Raw value of the
1286 Attribute is reported.
1287
1288 A common use of this Directive is to track the device Temperature
1289 (often ID=194 or 231). It is also useful for understanding how
1290 different types of system behavior affects the values of certain
1291 Attributes.
1292
1293 .TP
1294 .B \-C ID
1295 [ATA only] Report if the current number of pending sectors is
1296 non-zero. Here \fBID\fP is the id number of the Attribute whose raw
1297 value is the Current Pending Sector count. The allowed range of
1298 \fBID\fP is 0 to 255 inclusive. To turn off this reporting, use
1299 ID\ =\ 0. If the \fB\-C ID\fP option is not given, then it defaults to
1300 \fB\-C 197\fP (since Attribute 197 is generally used to monitor
1301 pending sectors).
1302
1303 A pending sector is a disk sector (containing 512 bytes of your data)
1304 which the device would like to mark as ``bad" and reallocate.
1305 Typically this is because your computer tried to read that sector, and
1306 the read failed because the data on it has been corrupted and has
1307 inconsistent Error Checking and Correction (ECC) codes. This is
1308 important to know, because it means that there is some unreadable data
1309 on the disk. The problem of figuring out what file this data belongs
1310 to is operating system and file system specific. You can typically
1311 force the sector to reallocate by writing to it (translation: make the
1312 device substitute a spare good sector for the bad one) but at the
1313 price of losing the 512 bytes of data stored there.
1314
1315 .TP
1316 .B \-U ID
1317 [ATA only] Report if the number of offline uncorrectable sectors is
1318 non-zero. Here \fBID\fP is the id number of the Attribute whose raw
1319 value is the Offline Uncorrectable Sector count. The allowed range of
1320 \fBID\fP is 0 to 255 inclusive. To turn off this reporting, use
1321 ID\ =\ 0. If the \fB\-U ID\fP option is not given, then it defaults to
1322 \fB\-U 198\fP (since Attribute 198 is generally used to monitor
1323 offline uncorrectable sectors).
1324
1325
1326 An offline uncorrectable sector is a disk sector which was not
1327 readable during an off\-line scan or a self\-test. This is important
1328 to know, because if you have data stored in this disk sector, and you
1329 need to read it, the read will fail. Please see the previous \'\-C\'
1330 option for more details.
1331
1332 .TP
1333 .B \-W DIFF[,INFO[,CRIT]]
1334 Report if the current temperature had changed by at least \fBDIFF\fP
1335 degrees since last report. Report or Warn if the temperature is greater
1336 or equal than one of \fBINFO\fP or \fBCRIT\fP degrees Celsius. If the
1337 limit \fBCRIT\fP is reached, a message with loglevel
1338 \fB\'LOG_CRITICAL\'\fP will be logged to syslog and a warning email
1339 will be send if '-m' is specified. If only the limit \fBINFO\fP is
1340 reached, a message with loglevel \fB\'LOG_INFO\'\fP will be logged.
1341
1342 To disable any of the 3 reports, set the corresponding limit to 0.
1343 Trailing zero arguments may be omitted. By default, all temperature
1344 reports are disabled (\'-W 0\').
1345
1346 To track temperature changes of at least 2 degrees, use:
1347 .nf
1348 \fB \-W 2
1349 .fi
1350 To log informal messages on temperatures of at least 40 degrees, use:
1351 .nf
1352 \fB \-W 0,40
1353 .fi
1354 For warning messages/mails on temperatures of at least 45 degrees, use:
1355 .nf
1356 \fB \-W 0,0,45
1357 .fi
1358 To combine all of the above reports, use:
1359 .nf
1360 \fB \-W 2,40,45
1361 .fi
1362
1363 For ATA devices, smartd interprets Attribute 194 as Temperature Celsius
1364 by default. This can be changed to Attribute 9 or 220 by the drive
1365 database or by the \'-v\' directive, see below.
1366
1367 .TP
1368 .B \-F TYPE
1369 [ATA only] Modifies the behavior of \fBsmartd\fP to compensate for
1370 some known and understood device firmware bug. The arguments to this
1371 Directive are exclusive, so that only the final Directive given is
1372 used. The valid values are:
1373
1374 .I none
1375 \- Assume that the device firmware obeys the ATA specifications. This is
1376 the default, unless the device has presets for \'\-F\' in the device
1377 database.
1378
1379 .I samsung
1380 \- In some Samsung disks (example: model SV4012H Firmware Version:
1381 RM100-08) some of the two- and four-byte quantities in the SMART data
1382 structures are byte-swapped (relative to the ATA specification).
1383 Enabling this option tells \fBsmartd\fP to evaluate these quantities
1384 in byte-reversed order. Some signs that your disk needs this option
1385 are (1) no self-test log printed, even though you have run self-tests;
1386 (2) very large numbers of ATA errors reported in the ATA error log;
1387 (3) strange and impossible values for the ATA error log timestamps.
1388
1389 .I samsung2
1390 \- In more recent Samsung disks (firmware revisions ending in "\-23") the
1391 number of ATA errors reported is byte swapped. Enabling this option
1392 tells \fBsmartd\fP to evaluate this quantity in byte-reversed order.
1393
1394 Note that an explicit \'\-F\' Directive will over-ride any preset
1395 values for \'\-F\' (see the \'\-P\' option below).
1396
1397
1398 [Please see the \fBsmartctl \-F\fP command-line option.]
1399
1400 .TP
1401 .B \-v N,OPTION
1402 Modifies the labeling for Attribute N, for disks which use
1403 non-standard Attribute definitions. This is useful in connection with
1404 the Attribute tracking/reporting Directives.
1405
1406 This Directive may appear multiple times. Valid arguments to this
1407 Directive are:
1408
1409 .I 9,minutes
1410 \- Raw Attribute number 9 is power-on time in minutes. Its raw value
1411 will be displayed in the form \'Xh+Ym\'. Here X is hours, and Y is
1412 minutes in the range 0-59 inclusive. Y is always printed with two
1413 digits, for example \'06\' or \'31\' or \'00\'.
1414
1415 .I 9,seconds
1416 \- Raw Attribute number 9 is power-on time in seconds. Its raw value
1417 will be displayed in the form \'Xh+Ym+Zs\'. Here X is hours, Y is
1418 minutes in the range 0-59 inclusive, and Z is seconds in the range
1419 0-59 inclusive. Y and Z are always printed with two digits, for
1420 example \'06\' or \'31\' or \'00\'.
1421
1422 .I 9,halfminutes
1423 \- Raw Attribute number 9 is power-on time, measured in units of 30
1424 seconds. This format is used by some Samsung disks. Its raw value
1425 will be displayed in the form \'Xh+Ym\'. Here X is hours, and Y is
1426 minutes in the range 0-59 inclusive. Y is always printed with two
1427 digits, for example \'06\' or \'31\' or \'00\'.
1428
1429 .I 9,temp
1430 \- Raw Attribute number 9 is the disk temperature in Celsius.
1431
1432 .I 192,emergencyretractcyclect
1433 \- Raw Attribute number 192 is the Emergency Retract Cycle Count.
1434
1435 .I 193,loadunload
1436 \- Raw Attribute number 193 contains two values. The first is the
1437 number of load cycles. The second is the number of unload cycles.
1438 The difference between these two values is the number of times that
1439 the drive was unexpectedly powered off (also called an emergency
1440 unload). As a rule of thumb, the mechanical stress created by one
1441 emergency unload is equivalent to that created by one hundred normal
1442 unloads.
1443
1444 .I 194,10xCelsius
1445 \- Raw Attribute number 194 is ten times the disk temperature in
1446 Celsius. This is used by some Samsung disks (example: model SV1204H
1447 with RK100-13 firmware).
1448
1449 .I 194,unknown
1450 \- Raw Attribute number 194 is NOT the disk temperature, and its
1451 interpretation is unknown. This is primarily useful for the -P
1452 (presets) Directive.
1453
1454 .I 198,offlinescanuncsectorct
1455 \- Raw Attribute number 198 is the Offline Scan UNC Sector Count.
1456
1457 .I 200,writeerrorcount
1458 \- Raw Attribute number 200 is the Write Error Count.
1459
1460 .I 201,detectedtacount
1461 \- Raw Attribute number 201 is the Detected TA Count.
1462
1463 .I 220,temp
1464 \- Raw Attribute number 220 is the disk temperature in Celsius.
1465
1466 Note: a table of hard drive models, listing which Attribute
1467 corresponds to temperature, can be found at:
1468 \fBhttp://www.guzu.net/linux/hddtemp.db\fP
1469
1470 .I N,raw8
1471 \- Print the Raw value of Attribute N as six 8-bit unsigned base-10
1472 integers. This may be useful for decoding the meaning of the Raw
1473 value. The form \'N,raw8\' prints Raw values for ALL Attributes in this
1474 form. The form (for example) \'123,raw8\' only prints the Raw value for
1475 Attribute 123 in this form.
1476
1477 .I N,raw16
1478 \- Print the Raw value of Attribute N as three 16-bit unsigned base-10
1479 integers. This may be useful for decoding the meaning of the Raw
1480 value. The form \'N,raw16\' prints Raw values for ALL Attributes in this
1481 form. The form (for example) \'123,raw16\' only prints the Raw value for
1482 Attribute 123 in this form.
1483
1484 .I N,raw48
1485 \- Print the Raw value of Attribute N as a 48-bit unsigned base-10
1486 integer. This may be useful for decoding the meaning of the Raw
1487 value. The form \'N,raw48\' prints Raw values for ALL Attributes in
1488 this form. The form (for example) \'123,raw48\' only prints the Raw
1489 value for Attribute 123 in this form.
1490
1491 .TP
1492 .B \-P TYPE
1493 Specifies whether
1494 \fBsmartd\fP
1495 should use any preset options that are available for this drive. The
1496 valid arguments to this Directive are:
1497
1498 .I use
1499 \- use any presets that are available for this drive. This is the default.
1500
1501 .I ignore
1502 \- do not use any presets for this drive.
1503
1504 .I show
1505 \- show the presets listed for this drive in the database.
1506
1507 .I showall
1508 \- show the presets that are available for all drives and then exit.
1509
1510 [Please see the
1511 .B smartctl \-P
1512 command-line option.]
1513
1514 .TP
1515 .B \-a
1516 Equivalent to turning on all of the following Directives:
1517 .B \'\-H\'
1518 to check the SMART health status,
1519 .B \'\-f\'
1520 to report failures of Usage (rather than Prefail) Attributes,
1521 .B \'\-t\'
1522 to track changes in both Prefailure and Usage Attributes,
1523 .B \'\-l\ selftest\'
1524 to report increases in the number of Self-Test Log errors,
1525 .B \'\-l\ error\'
1526 to report increases in the number of ATA errors,
1527 .B \'\-C 197\'
1528 to report nonzero values of the current pending sector count, and
1529 .B \'\-U 198\'
1530 to report nonzero values of the offline pending sector count.
1531
1532 Note that \-a is the default for ATA devices. If none of these other
1533 Directives is given, then \-a is assumed.
1534
1535 .TP
1536 .B #
1537 Comment: ignore the remainder of the line.
1538 .TP
1539 .B \e
1540 Continuation character: if this is the last non-white or non-comment
1541 character on a line, then the following line is a continuation of the current
1542 one.
1543 .PP
1544 If you are not sure which Directives to use, I suggest experimenting
1545 for a few minutes with
1546 .B smartctl
1547 to see what SMART functionality your disk(s) support(s). If you do
1548 not like voluminous syslog messages, a good choice of
1549 \fBsmartd\fP
1550 configuration file Directives might be:
1551 .nf
1552 .B \-H \-l\ selftest \-l\ error \-f.
1553 .fi
1554 If you want more frequent information, use:
1555 .B -a.
1556
1557 .TP
1558 .B ADDITIONAL DETAILS ABOUT DEVICESCAN
1559 If the first non-comment entry in the configuration file is the text
1560 string \fBDEVICESCAN\fP in capital letters, then \fBsmartd\fP will
1561 ignore any remaining lines in the configuration file, and will scan
1562 for devices.
1563
1564 If \fBDEVICESCAN\fP is not followed by any Directives, then smartd
1565 will scan for both ATA and SCSI devices, and will monitor all possible
1566 SMART properties of any devices that are found.
1567
1568 \fBDEVICESCAN\fP may optionally be followed by any valid Directives,
1569 which will be applied to all devices that are found in the scan. For
1570 example
1571 .nf
1572 .B DEVICESCAN -m root@example.com
1573 .fi
1574 will scan for all devices, and then monitor them. It will send one
1575 email warning per device for any problems that are found.
1576 .nf
1577 .B DEVICESCAN -d ata -m root@example.com
1578 .fi
1579 will do the same, but restricts the scan to ATA devices only.
1580 .nf
1581 .B DEVICESCAN -H -d ata -m root@example.com
1582 .fi
1583 will do the same, but only monitors the SMART health status of the
1584 devices, (rather than the default \-a, which monitors all SMART
1585 properties).
1586
1587 .TP
1588 .B EXAMPLES OF SHELL SCRIPTS FOR \'\-M exec\'
1589 These are two examples of shell scripts that can be used with the \'\-M
1590 exec PATH\' Directive described previously. The paths to these scripts
1591 and similar executables is the PATH argument to the \'\-M exec PATH\'
1592 Directive.
1593
1594 Example 1: This script is for use with \'\-m ADDRESS -M exec PATH\'. It appends
1595 the output of
1596 .B smartctl -a
1597 to the output of the smartd email warning message and sends it to ADDRESS.
1598
1599 .nf
1600 \fB
1601 #! /bin/bash
1602
1603 # Save the email message (STDIN) to a file:
1604 cat > /root/msg
1605
1606 # Append the output of smartctl -a to the message:
1607 /usr/local/sbin/smartctl -a -d $SMART_DEVICETYPE $SMARTD_DEVICE >> /root/msg
1608
1609 # Now email the message to the user at address ADD:
1610 /bin/mail -s "$SMARTD_SUBJECT" $SMARTD_ADDRESS < /root/msg
1611 \fP
1612 .fi
1613
1614 Example 2: This script is for use with \'\-m <nomailer> \-M exec
1615 PATH\'. It warns all users about a disk problem, waits 30 seconds, and
1616 then powers down the machine.
1617
1618 .nf
1619 \fB
1620 #! /bin/bash
1621
1622 # Warn all users of a problem
1623 wall \'Problem detected with disk: \' "$SMARTD_DEVICESTRING"
1624 wall \'Warning message from smartd is: \' "$SMARTD_MESSAGE"
1625 wall \'Shutting down machine in 30 seconds... \'
1626
1627 # Wait half a minute
1628 sleep 30
1629
1630 # Power down the machine
1631 /sbin/shutdown -hf now
1632 \fP
1633 .fi
1634
1635 Some example scripts are distributed with the smartmontools package,
1636 in /usr/local/share/doc/smartmontools-5.1/examplescripts/.
1637
1638 Please note that these scripts typically run as root, so any files
1639 that they read/write should not be writable by ordinary users or
1640 reside in directories like /tmp that are writable by ordinary users
1641 and may expose your system to symlink attacks.
1642
1643 As previously described, if the scripts write to STDOUT or STDERR,
1644 this is interpreted as indicating that there was an internal error
1645 within the script, and a snippet of STDOUT/STDERR is logged to SYSLOG.
1646 The remainder is flushed.
1647
1648 .\" ENDINCLUDE
1649 .\" DO NOT MODIFY THIS OR PREVIOUS/NEXT LINES. THIS DEFINES THE
1650 .\" END OF THE INCLUDE SECTION FOR smartd.conf.5
1651
1652 .SH NOTES
1653 \fBsmartd\fP
1654 will make log entries at loglevel
1655 .B LOG_INFO
1656 if the Normalized SMART Attribute values have changed, as reported using the
1657 .B \'\-t\', \'\-p\',
1658 or
1659 .B \'\-u\'
1660 Directives. For example:
1661 .nf
1662 .B \'Device: /dev/hda, SMART Attribute: 194 Temperature_Celsius changed from 94 to 93\'
1663 .fi
1664 Note that in this message, the value given is the \'Normalized\' not the \'Raw\'
1665 Attribute value (the disk temperature in this case is about 22
1666 Celsius). The
1667 .B \'-R\'
1668 and
1669 .B \'-r\'
1670 Directives modify this behavior, so that the information is printed
1671 with the Raw values as well, for example:
1672 .nf
1673 .B \'Device: /dev/hda, SMART Attribute: 194 Temperature_Celsius changed from 94 [Raw 22] to 93 [Raw 23]\'
1674 .fi
1675 Here the Raw values are the actual disk temperatures in Celsius. The
1676 way in which the Raw values are printed, and the names under which the
1677 Attributes are reported, is governed by the various
1678 .B \'-v Num,Description\'
1679 Directives described previously.
1680
1681 Please see the
1682 .B smartctl
1683 manual page for further explanation of the differences between
1684 Normalized and Raw Attribute values.
1685
1686 \fBsmartd\fP
1687 will make log entries at loglevel
1688 .B LOG_CRIT
1689 if a SMART Attribute has failed, for example:
1690 .nf
1691 .B \'Device: /dev/hdc, Failed SMART Attribute: 5 Reallocated_Sector_Ct\'
1692 .fi
1693 This loglevel is used for reporting enabled by the
1694 .B \'\-H\', \-f\', \'\-l\ selftest\',
1695 and
1696 .B \'\-l\ error\'
1697 Directives. Entries reporting failure of SMART Prefailure Attributes
1698 should not be ignored: they mean that the disk is failing. Use the
1699 .B smartctl
1700 utility to investigate.
1701
1702 Under Solaris with the default \fB/etc/syslog.conf\fP configuration,
1703 messages below loglevel \fBLOG_NOTICE\fP will \fBnot\fP be recorded.
1704 Hence all \fBsmartd\fP messages with loglevel \fBLOG_INFO\fP will be
1705 lost. If you want to use the existing daemon facility to log all
1706 messages from \fBsmartd\fP, you should change \fB/etc/syslog.conf\fP
1707 from:
1708 .nf
1709 ...;daemon.notice;... /var/adm/messages
1710 .fi
1711 to read:
1712 .nf
1713 ...;daemon.info;... /var/adm/messages
1714 .fi
1715 Alternatively, you can use a local facility to log messages: please
1716 see the \fBsmartd\fP '-l' command-line option described above.
1717
1718 On Cygwin and Windows, the log messages are written to the event log
1719 or to a file. See documentation of the '-l FACILITY' option above for
1720 details.
1721
1722 On Windows, the following built-in commands can be used to control
1723 \fBsmartd\fP, if running as a daemon:
1724
1725 \'\fBsmartd status\fP\' \- check status
1726
1727 \'\fBsmartd stop\fP\' \- stop smartd
1728
1729 \'\fBsmartd reload\fP\' \- reread config file
1730
1731 \'\fBsmartd restart\fP\' \- restart smartd
1732
1733 \'\fBsmartd sigusr1\fP\' \- check disks now
1734
1735 \'\fBsmartd sigusr2\fP\' \- toggle debug mode
1736
1737 On WinNT4/2000/XP, \fBsmartd\fP can also be run as a Windows service:
1738
1739
1740 The Cygwin Version of \fBsmartd\fP can be run as a service via the
1741 cygrunsrv tool. The start-up script provides Cygwin-specific commands
1742 to install and remove the service:
1743 .nf
1744 .B /usr/local/etc/rc.d/init.d/smartd install [options]
1745 .B /usr/local/etc/rc.d/init.d/smartd remove
1746 .fi
1747 The service can be started and stopped by the start-up script as usual
1748 (see \fBEXAMPLES\fP above).
1749
1750
1751 The Windows Version of \fBsmartd\fP has buildin support for services:
1752
1753 \'\fBsmartd install [options]\fP\' installs a service
1754 named "smartd" (display name "SmartD Service") using the command line
1755 \'/installpath/smartd.exe --service [options]\'.
1756
1757 \'\fBsmartd remove\fP\' can later be used to remove the service entry
1758 from registry.
1759
1760 Upon startup, the smartd service changes the working directory
1761 to its own installation path. If smartd.conf and blat.exe are stored
1762 in this directory, no \'-c\' option and \'-M exec\' directive is needed.
1763
1764 The debug mode (\'-d\', \'-q onecheck\') does not work if smartd is
1765 running as service.
1766
1767 The service can be controlled as usual with Windows commands \'net\'
1768 or \'sc\' (\'\fBnet start smartd\fP\', \'\fBnet stop smartd\fP\').
1769
1770 Pausing the service (\'\fBnet pause smartd\fP\') sets the interval between
1771 disk checks (\'-i N\') to infinite.
1772
1773 Continuing the paused service (\'\fBnet continue smartd\fP\') resets the
1774 interval and rereads the configuration file immediately (like \fBSIGHUP\fP):
1775
1776 Continuing a still running service (\'\fBnet continue smartd\fP\' without
1777 preceding \'\fBnet pause smartd\fP\') does not reread configuration but
1778 checks disks immediately (like \fBSIGUSR1\fP).
1779
1780 .SH LOG TIMESTAMP TIMEZONE
1781
1782 When \fBsmartd\fP makes log entries, these are time-stamped. The time
1783 stamps are in the computer's local time zone, which is generally set
1784 using either the environment variable \'\fBTZ\fP\' or using a
1785 time-zone file such as \fB/etc/localtime\fP. You may wish to change
1786 the timezone while \fBsmartd\fP is running (for example, if you carry
1787 a laptop to a new time-zone and don't reboot it). Due to a bug in the
1788 \fBtzset(3)\fP function of many unix standard C libraries, the
1789 time-zone stamps of \fBsmartd\fP might not change. For some systems,
1790 \fBsmartd\fP will work around this problem \fIif\fP the time-zone is
1791 set using \fB/etc/localtime\fP. The work-around \fIfails\fP if the
1792 time-zone is set using the \'\fBTZ\fP\' variable (or a file that it
1793 points to).
1794
1795
1796 .SH RETURN VALUES
1797 The return value (exit status) of
1798 \fBsmartd\fP
1799 can have the following values:
1800 .TP
1801 .B 0:
1802 Daemon startup successful, or \fBsmartd\fP was killed by a SIGTERM (or in debug mode, a SIGQUIT).
1803 .TP
1804 .B 1:
1805 Commandline did not parse.
1806 .TP
1807 .B 2:
1808 There was a syntax error in the config file.
1809 .TP
1810 .B 3:
1811 Forking the daemon failed.
1812 .TP
1813 .B 4:
1814 Couldn\'t create PID file.
1815 .TP
1816 .B 5:
1817 Config file does not exist (only returned in conjunction with the \'-c\' option).
1818 .TP
1819 .B 6:
1820 Config file exists, but cannot be read.
1821 .TP
1822 .B 8:
1823 \fBsmartd\fP
1824 ran out of memory during startup.
1825 .TP
1826 .B 9:
1827 A compile time constant of\fB smartd\fP was too small. This can be caused by an
1828 excessive number of disks, or by lines in \fB /usr/local/etc/smartd.conf\fP that are too long.
1829 Please report this problem to \fB smartmontools-support@lists.sourceforge.net\fP.
1830 .TP
1831 .B 10
1832 An inconsistency was found in \fBsmartd\fP\'s internal data
1833 structures. This should never happen. It must be due to either a
1834 coding or compiler bug. \fIPlease\fP report such failures to
1835 smartmontools-support@lists.sourceforge.net.
1836 .TP
1837 .B 16:
1838 A device explicitly listed in
1839 .B /usr/local/etc/smartd.conf
1840 can\'t be monitored.
1841 .TP
1842 .B 17:
1843 \fBsmartd\fP
1844 didn\'t find any devices to monitor.
1845 .TP
1846 .B 254:
1847 When in daemon mode,
1848 \fBsmartd\fP
1849 received a SIGINT or SIGQUIT. (Note that in debug mode, SIGINT has
1850 the same effect as SIGHUP, and makes \fBsmartd\fP reload its
1851 configuration file. SIGQUIT has the same effect as SIGTERM and causes
1852 \fBsmartd\fP to exit with zero exit status.
1853 .TP
1854 .B 132 and above
1855 \fBsmartd\fP
1856 was killed by a signal that is not explicitly listed above. The exit
1857 status is then 128 plus the signal number. For example if
1858 \fBsmartd\fP
1859 is killed by SIGKILL (signal 9) then the exit status is 137.
1860
1861 .PP
1862 .SH AUTHOR
1863 \fBBruce Allen\fP smartmontools-support@lists.sourceforge.net
1864 .fi
1865 University of Wisconsin \- Milwaukee Physics Department
1866
1867 .PP
1868 .SH CONTRIBUTORS
1869 The following have made large contributions to smartmontools:
1870 .nf
1871 \fBCasper Dik\fP (Solaris SCSI interface)
1872 \fBChristian Franke\fP (Windows interface and Cygwin package)
1873 \fBDouglas Gilbert\fP (SCSI subsystem)
1874 \fBGuido Guenther\fP (Autoconf/Automake packaging)
1875 \fBGeoffrey Keating\fP (Darwin ATA interface)
1876 \fBEduard Martinescu\fP (FreeBSD interface)
1877 \fBFr\*'ed\*'eric L. W. Meunier\fP (Web site and Mailing list)
1878 \fBKeiji Sawada\fP (Solaris ATA interface)
1879 \fBSergey Svishchev\fP (NetBSD interface)
1880 \fBDavid Snyder and Sergey Svishchev\fP (OpenBSD interface)
1881 \fBPhil Williams\fP (User interface and drive database)
1882 .fi
1883 Many other individuals have made smaller contributions and corrections.
1884
1885 .PP
1886 .SH CREDITS
1887 .fi
1888 This code was derived from the smartsuite package, written by Michael
1889 Cornwell, and from the previous ucsc smartsuite package. It extends
1890 these to cover ATA-5 disks. This code was originally developed as a
1891 Senior Thesis by Michael Cornwell at the Concurrent Systems Laboratory
1892 (now part of the Storage Systems Research Center), Jack Baskin School
1893 of Engineering, University of California, Santa
1894 Cruz. \fBhttp://ssrc.soe.ucsc.edu/\fP .
1895 .SH
1896 HOME PAGE FOR SMARTMONTOOLS:
1897 .fi
1898 Please see the following web site for updates, further documentation, bug
1899 reports and patches: \fBhttp://smartmontools.sourceforge.net/\fP
1900
1901 .SH SEE ALSO:
1902 \fBsmartd.conf\fP(5), \fBsmartctl\fP(8), \fBsyslogd\fP(8),
1903 \fBsyslog.conf\fP(5), \fBbadblocks\fP(8), \fBide\-smart\fP(8), \fBregex\fP(7).
1904
1905 .SH
1906 REFERENCES FOR SMART
1907 .fi
1908 An introductory article about smartmontools is \fIMonitoring Hard
1909 Disks with SMART\fP, by Bruce Allen, Linux Journal, January 2004,
1910 pages 74-77. This is \fBhttp://www.linuxjournal.com/article.php?sid=6983\fP
1911 online.
1912
1913 If you would like to understand better how SMART works, and what it
1914 does, a good place to start is with Sections 4.8 and 6.54 of the first
1915 volume of the \'AT Attachment with Packet Interface-7\' (ATA/ATAPI-7)
1916 specification. This documents the SMART functionality which the
1917 \fBsmartmontools\fP utilities provide access to. You can find
1918 Revision 4b of this document at
1919 \fBhttp://www.t13.org/docs2004/d1532v1r4b-ATA-ATAPI-7.pdf\fP .
1920 Earlier and later versions of this Specification are available from
1921 the T13 web site \fBhttp://www.t13.org/\fP .
1922
1923 .fi
1924 The functioning of SMART was originally defined by the SFF-8035i
1925 revision 2 and the SFF-8055i revision 1.4 specifications. These are
1926 publications of the Small Form Factors (SFF) Committee. Links to
1927 these documents may be found in the References section of the
1928 smartmontools home page at \fBhttp://smartmontools.sourceforge.net/#references\fP .
1929
1930 .SH
1931 CVS ID OF THIS PAGE:
1932 $Id: smartd.8.in,v 1.106 2006/09/27 21:42:03 chrfranke Exp $