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