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