]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - smartd.8.in
Imported Upstream version 5.42+svn3561
[mirror_smartmontools-debian.git] / smartd.8.in
CommitLineData
832b75ed 1.ig
e9583e0c 2Copyright (C) 2002-10 Bruce Allen <smartmontools-support@lists.sourceforge.net>
832b75ed 3
f4e463df 4$Id: smartd.8.in 3561 2012-06-05 19:49:31Z chrfranke $
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..
e9583e0c 20.TH SMARTD 8 CURRENT_SVN_DATE CURRENT_SVN_VERSION CURRENT_SVN_DATE
832b75ed
GG
21.SH NAME
22\fBsmartd\fP \- SMART Disk Monitoring Daemon
23
24.SH SYNOPSIS
25.B smartd [options]
26
d008864d 27.\" %IF NOT OS Windows
832b75ed
GG
28.SH FULL PATH
29.B /usr/local/sbin/smartd
30
d008864d 31.\" %ENDIF NOT OS Windows
832b75ed 32.SH PACKAGE VERSION
e9583e0c 33CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
832b75ed
GG
34
35.SH DESCRIPTION
d008864d
GI
36.\" %IF NOT OS ALL
37.\"! [This man page is generated for the OS_MAN_FILTER version of smartmontools.
38.\"! It does not contain info specific to other platforms.]
39.\"! .PP
40.\" %ENDIF NOT OS ALL
832b75ed
GG
41\fBsmartd\fP is a daemon that monitors the Self-Monitoring, Analysis
42and Reporting Technology (SMART) system built into many ATA-3 and
43later ATA, IDE and SCSI-3 hard drives. The purpose of SMART is to
44monitor the reliability of the hard drive and predict drive failures,
45and to carry out different types of drive self-tests. This version of
46\fBsmartd\fP is compatible with ATA/ATAPI-7 and earlier standards (see
47\fBREFERENCES\fP below).
48
49\fBsmartd\fP will attempt to enable SMART monitoring on ATA devices
50(equivalent to \fBsmartctl -s on\fP) and polls these and SCSI devices
51every 30 minutes (configurable), logging SMART errors and changes of
52SMART Attributes via the SYSLOG interface. The default location for
e9583e0c
GI
53these SYSLOG notifications and warnings is system-dependent
54(typically \fB/var/log/messages\fP or \fB/var/log/syslog\fP).
832b75ed
GG
55To change this default location, please see the \fB\'-l\'\fP
56command-line option described below.
57
58In addition to logging to a file, \fBsmartd\fP can also be configured
59to send email warnings if problems are detected. Depending upon the
60type of problem, you may want to run self\-tests on the disk, back up
61the disk, replace the disk, or use a manufacturer\'s utility to force
62reallocation of bad or unreadable disk sectors. If disk problems are
63detected, please see the \fBsmartctl\fP manual page and the
64\fBsmartmontools\fP web page/FAQ for further guidance.
65
66If you send a \fBUSR1\fP signal to \fBsmartd\fP it will immediately
67check the status of the disks, and then return to polling the disks
68every 30 minutes. See the \fB\'\-i\'\fP option below for additional
69details.
70
71\fBsmartd\fP can be configured at start-up using the configuration
e9583e0c 72file \fB/usr/local/etc/smartd.conf\fP (Windows: \fBEXEDIR/smartd.conf\fP).
832b75ed
GG
73If the configuration file is subsequently modified, \fBsmartd\fP
74can be told to re-read the configuration file by sending it a
75\fBHUP\fP signal, for example with the command:
76.fi
77\fBkillall -HUP smartd\fP.
78.fi
d008864d 79.\" %IF OS Windows
832b75ed 80(Windows: See NOTES below.)
d008864d 81.\" %ENDIF OS Windows
832b75ed
GG
82
83On startup, if \fBsmartd\fP finds a syntax error in the configuration
84file, it will print an error message and then exit. However if
85\fBsmartd\fP is already running, then is told with a \fBHUP\fP signal
86to re-read the configuration file, and then find a syntax error in
87this file, it will print an error message and then continue, ignoring
88the contents of the (faulty) configuration file, as if the \fBHUP\fP
89signal had never been received.
90
91When \fBsmartd\fP is running in debug mode, the \fBINT\fP signal
92(normally generated from a shell with CONTROL\-C) is treated in the
93same way as a \fBHUP\fP signal: it makes \fBsmartd\fP reload its
94configuration file. To exit \fBsmartd\fP use CONTROL-\e
d008864d
GI
95.\" %IF OS Windows
96(Windows: CONTROL\-Break).
97.\" %ENDIF OS Windows
832b75ed
GG
98
99On startup, in the absence of the configuration file
100\fB/usr/local/etc/smartd.conf\fP, the \fBsmartd\fP daemon first scans for all
101devices that support SMART. The scanning is done as follows:
d008864d 102.\" %IF OS Linux
832b75ed
GG
103.IP \fBLINUX:\fP 9
104Examine all entries \fB"/dev/hd[a-t]"\fP for IDE/ATA
7f0798ef
GI
105devices, and \fB"/dev/sd[a-z]"\fP, \fB"/dev/sd[a-c][a-z]"\fP
106for SCSI or SATA devices.
d008864d
GI
107.\" %ENDIF OS Linux
108.\" %IF OS FreeBSD
832b75ed 109.IP \fBFREEBSD:\fP 9
eb07ddf2 110Authoritative list of disk devices is obtained from SCSI (CAM) and ATA subsystems.
d008864d
GI
111.\" %ENDIF OS FreeBSD
112.\" %IF OS NetBSD OpenBSD
832b75ed
GG
113.IP \fBNETBSD/OPENBSD:\fP 9
114Authoritative list of disk devices is obtained from sysctl
115\'hw.disknames\'.
d008864d
GI
116.\" %ENDIF OS NetBSD OpenBSD
117.\" %IF OS Solaris
832b75ed 118.IP \fBSOLARIS:\fP 9
f4e463df 119Examine all entries \fB"/dev/rdsk/*s0"\fP for IDE/ATA and SCSI disk
832b75ed 120devices, and entries \fB"/dev/rmt/*"\fP for SCSI tape devices.
d008864d
GI
121.\" %ENDIF OS Solaris
122.\" %IF OS Darwin
832b75ed
GG
123.IP \fBDARWIN:\fP 9
124The IOService plane is scanned for ATA block storage devices.
d008864d
GI
125.\" %ENDIF OS Darwin
126.\" %IF OS Windows
a37e7145
GG
127.IP \fBWINDOWS\ 9x/ME\fP: 9
128Examine all entries \fB"/dev/hd[a-d]"\fP (bitmask
129from "\\\\.\\SMARTVSD") for IDE/ATA devices.
130Examine all entries \fB"/dev/scsi[0\-9][0\-f]"\fP for SCSI devices
ba59cff1 131on ASPI adapter 0\-9, ID 0\-15.
d008864d
GI
132.\" %ENDIF OS Windows
133.\" %IF OS Windows Cygwin
cfbba5b9 134.IP \fBWINDOWS\ NT4/2000/XP/2003/Vista/Win7/2008\fP: 9
a37e7145
GG
135Examine all entries \fB"/dev/sd[a-j]"\fP ("\\\\.\\PhysicalDrive[0-9]")
136for IDE/(S)ATA and SCSI disk devices
137
4d59bff9 138If a 3ware 9000 controller is installed, examine all entries
a37e7145
GG
139\fB"/dev/sdX,N"\fP for the first logical drive (\'unit\'
140\fB"/dev/sdX"\fP) and all physical disks (\'ports\' \fB",N"\fP)
4d59bff9 141detected behind this controller. Same for a second controller if present.
cfbba5b9 142
f4e463df
GI
143If directive \'\-d csmi\' or no \'\-d\' directive is specified,
144examine all entries \fB"/dev/csmi[0\-9],N"\fP for drives behind an Intel
145ICHxR controller with RST driver.
d008864d
GI
146.\" %ENDIF OS Windows Cygwin
147.\" %IF OS Cygwin
832b75ed 148.IP \fBCYGWIN\fP: 9
cfbba5b9 149See "WINDOWS NT4/2000/XP/2003/Vista/Win7/2008" above.
d008864d
GI
150.\" %ENDIF OS Cygwin
151.\" %IF OS OS2
832b75ed
GG
152.IP \fBOS/2,eComStation\fP: 9
153Use the form \fB"/dev/hd[a\-z]"\fP for IDE/ATA devices.
d008864d 154.\" %ENDIF OS OS2
832b75ed
GG
155.PP
156\fBsmartd\fP then monitors
157for \fIall\fP possible SMART errors (corresponding to the \fB\'\-a\'\fP
158Directive in the configuration file; see \fBCONFIGURATION FILE\fP
159below).
160
161.SH
162OPTIONS
2127e193 163
832b75ed 164.TP
2127e193 165.B \-A PREFIX, \-\-attributelog=PREFIX
cfbba5b9
GI
166[ATA only] Writes \fBsmartd\fP attribute information (normalized and raw
167attribute values) to files \'PREFIX\'\'MODEL\-SERIAL.ata.csv\'. At each
168check cycle attributes are logged as a line of semicolon separated triplets
169of the form "attribute-ID;attribute-norm-value;attribute-raw-value;".
170Each line is led by a date string of the form "yyyy-mm-dd HH:MM:SS" (in UTC).
2127e193 171
d008864d 172.\" %IF ENABLE_ATTRIBUTELOG
2127e193
GI
173If this option is not specified, attribute information is written to files
174\'/usr/local/var/lib/smartmontools/attrlog.MODEL\-SERIAL.ata.csv\'.
175To disable attribute log files, specify this option with an empty string
176argument: \'-A ""\'.
d008864d 177.\" %ENDIF ENABLE_ATTRIBUTELOG
2127e193
GI
178MODEL and SERIAL are build from drive identify information, invalid
179characters are replaced by underline.
180
181If the PREFIX has the form \'/path/dir/\' (e.g. \'/var/lib/smartd/\'), then
182files \'MODEL\-SERIAL.ata.csv\' are created in directory \'/path/dir\'.
183If the PREFIX has the form \'/path/name\' (e.g. \'/var/lib/misc/attrlog\-\'),
184then files 'nameMODEL\-SERIAL.ata.csv' are created in directory '/path/'.
185The path must be absolute, except if debug mode is enabled.
2127e193
GI
186.TP
187.B \-B [+]FILE, \-\-drivedb=[+]FILE
cfbba5b9
GI
188[ATA only] Read the drive database from FILE. The new database replaces
189the built in database by default. If \'+\' is specified, then the new entries
190prepend the built in entries.
bed94269 191Please see the \fBsmartctl\fP(8) man page for further details.
2127e193
GI
192.TP
193.B \-c FILE, \-\-configfile=FILE
832b75ed 194Read \fBsmartd\fP configuration Directives from FILE, instead of from
e9583e0c 195the default location \fB/usr/local/etc/smartd.conf\fP (Windows: \fBEXEDIR/smartd.conf\fP).
832b75ed
GG
196If FILE does \fBnot\fP exist, then \fBsmartd\fP will print an error
197message and exit with nonzero status. Thus, \'\-c /usr/local/etc/smartd.conf\'
198can be used to verify the existence of the default configuration file.
199
200By using \'\-\' for FILE, the configuration is read from standard
201input. This is useful for commands like:
202.nf
203.B echo /dev/hdb \-m user@home \-M test | smartd \-c \- \-q onecheck
204.fi
205to perform quick and simple checks without a configuration file.
d008864d 206.\" %IF ENABLE_CAPABILITIES
a23d5117
GI
207.TP
208.B \-C, \-\-capabilities
d008864d 209Use \fBcapabilities(7)\fP.
a23d5117
GI
210
211Warning: Mail notification does not work when used.
d008864d 212.\" %ENDIF ENABLE_CAPABILITIES
832b75ed
GG
213.TP
214.B \-d, \-\-debug
215Runs \fBsmartd\fP in "debug" mode. In this mode, it displays status
216information to STDOUT rather than logging it to SYSLOG and does not
217\fBfork(2)\fP into the background and detach from the controlling
218terminal. In this mode, \fBsmartd\fP also prints more verbose
219information about what it is doing than when operating in "daemon"
e165493d 220mode. In this mode, the \fBINT\fP signal (normally generated from a
832b75ed
GG
221terminal with CONTROL\-C) makes \fBsmartd\fP reload its configuration
222file. Please use CONTROL-\e to exit
d008864d
GI
223.\" %IF OS Windows
224(Windows: CONTROL\-Break).
832b75ed 225
f4e463df 226[Windows only] The "debug" mode can be toggled by the command
832b75ed
GG
227\fBsmartd sigusr2\fP. A new console for debug output is opened when
228debug mode is enabled.
d008864d 229.\" %ENDIF OS Windows
832b75ed
GG
230.TP
231.B \-D, \-\-showdirectives
232Prints a list (to STDOUT) of all the possible Directives which may
233appear in the configuration file /usr/local/etc/smartd.conf, and then exits.
234These Directives are also described later in this man page. They may
235appear in the configuration file following the device name.
236.TP
237.B \-h, \-\-help, \-\-usage
238Prints usage message to STDOUT and exits.
239.TP
240.B \-i N, \-\-interval=N
241Sets the interval between disk checks to \fIN\fP seconds, where
242\fIN\fP is a decimal integer. The minimum allowed value is ten and
243the maximum is the largest positive integer that can be represented on
244your system (often 2^31-1). The default is 1800 seconds.
245
246Note that the superuser can make \fBsmartd\fP check the status of the
247disks at any time by sending it the \fBSIGUSR1\fP signal, for example
248with the command:
249.nf
250.B kill -SIGUSR1 <pid>
251.fi
252where \fB<pid>\fP is the process id number of \fBsmartd\fP. One may
253also use:
254.nf
255.B killall -USR1 smartd
256.fi
257for the same purpose.
258.fi
d008864d 259.\" %IF OS Windows
832b75ed 260(Windows: See NOTES below.)
d008864d 261.\" %ENDIF OS Windows
832b75ed
GG
262.TP
263.B \-l FACILITY, \-\-logfacility=FACILITY
264Uses syslog facility FACILITY to log the messages from \fBsmartd\fP.
265Here FACILITY is one of \fIlocal0\fP, \fIlocal1\fP, ..., \fIlocal7\fP,
266or \fIdaemon\fP [default]. If this command-line option is not used,
267then by default messages from \fBsmartd\fP are logged to the facility
268\fIdaemon\fP.
269
270If you would like to have \fBsmartd\fP messages logged somewhere other
e9583e0c
GI
271than the default location, this can typically be accomplished with
272(for example) the following steps:
832b75ed
GG
273.RS 7
274.IP \fB[1]\fP 4
275Modify the script that starts \fBsmartd\fP to include the \fBsmartd\fP
276command-line argument \'\-l local3\'. This tells \fBsmartd\fP to log its
277messages to facility \fBlocal3\fP.
278.IP \fB[2]\fP 4
279Modify the \fBsyslogd\fP configuration file (typically
280\fB/etc/syslog.conf\fP) by adding a line of the form:
281.nf
282\fBlocal3.* /var/log/smartd.log\fP
283.fi
284This tells \fBsyslogd\fP to log all the messages from facility \fBlocal3\fP to
285the designated file: /var/log/smartd.log.
286.IP \fB[3]\fP 4
287Tell \fBsyslogd\fP to re-read its configuration file, typically by
288sending the \fBsyslogd\fP process a \fBSIGHUP\fP hang-up signal.
289.IP \fB[4]\fP 4
290Start (or restart) the \fBsmartd\fP daemon.
291.RE
292.\" The following two lines are a workaround for a man2html bug. Please leave them.
293.\" They define a non-existent option; useful because man2html can't correctly reset the margins.
294.TP
295.B \&
296For more detailed information, please refer to the man pages for
297\fBsyslog.conf\fP, \fBsyslogd\fP, and \fBsyslog\fP. You may also want
298to modify the log rotation configuration files; see the man pages for
299\fBlogrotate\fP and examine your system\'s /etc/logrotate.conf file.
d008864d 300.\" %IF OS Cygwin
832b75ed 301
d008864d
GI
302Cygwin: If no \fBsyslogd\fP is running, the \'\-l\' option has no effect.
303In this case, all \fBsyslog\fP messages are written to Windows event log.
304.\" %ENDIF OS Cygwin
305.\" %IF OS Windows
832b75ed
GG
306
307Windows: Some \fBsyslog\fP functionality is implemented
308internally in \fBsmartd\fP as follows: If no \'\-l\' option
309(or \'\-l daemon\') is specified, messages are written to Windows
310event log or to file \fB./smartd.log\fP if event log is not available
311(Win9x/ME or access denied). By specifying other values of FACILITY,
312log output is redirected as follows:
313\'\-l local0\' to file \fB./smartd.log\fP,
314\'\-l local1\' to standard output (redirect with \'>\' to any file),
315\'\-l local2\' to standard error,
316\'\-l local[3-7]\': to file \fB./smartd[1-5].log\fP.
317
318When using the event log, the enclosed utility \fBsyslogevt.exe\fP
319should be registered as an event message file to avoid error
320messages from the event viewer. Use \'\fBsyslogevt -r smartd\fP\'
321to register, \'\fBsyslogevt -u smartd\fP\' to unregister and
322\'\fBsyslogevt\fP\' for more help.
d008864d 323.\" %ENDIF OS Windows
a37e7145
GG
324.TP
325.B \-n, \-\-no\-fork
326Do not fork into background; this is useful when executed from modern
327init methods like initng, minit or supervise.
d008864d 328.\" %IF OS Cygwin
a37e7145
GG
329
330On Cygwin, this allows running \fBsmartd\fP as service via cygrunsrv,
331see NOTES below.
d008864d
GI
332.\" %ENDIF OS Cygwin
333.\" %IF OS Windows
a37e7145
GG
334
335On Windows, this option is not available, use \'\-\-service\' instead.
d008864d 336.\" %ENDIF OS Windows
832b75ed
GG
337.TP
338.B \-p NAME, \-\-pidfile=NAME
339Writes pidfile \fINAME\fP containing the \fBsmartd\fP Process ID
340number (PID). To avoid symlink attacks make sure the directory to
341which pidfile is written is only writable for root. Without this
342option, or if the \-\-debug option is given, no PID file is written on
343startup. If \fBsmartd\fP is killed with a maskable signal then the
344pidfile is removed.
345.TP
346.B \-q WHEN, \-\-quit=WHEN
347Specifies when, if ever, \fBsmartd\fP should exit. The valid
348arguments are to this option are:
349
350.I nodev
351\- Exit if there are no devices to monitor, or if any errors are found
352at startup in the configuration file. This is the default.
353
354.I errors
355\- Exit if there are no devices to monitor, or if any errors are found
356in the configuration file /usr/local/etc/smartd.conf at startup or whenever it
357is reloaded.
358
359.I nodevstartup
360\- Exit if there are no devices to monitor at startup. But continue
361to run if no devices are found whenever the configuration file is
362reloaded.
363
364.I never
365\- Only exit if a fatal error occurs (no remaining system memory,
366invalid command line arguments). In this mode, even if there are no
367devices to monitor, or if the configuration file
368\fB/usr/local/etc/smartd.conf\fP has errors, \fBsmartd\fP will continue to run,
369waiting to load a configuration file listing valid devices.
370
371.I onecheck
372\- Start \fBsmartd\fP in debug mode, then register devices, then check
373device\'s SMART status once, and then exit with zero exit status if all
374of these steps worked correctly.
375
376This last option is intended for \'distribution-writers\' who want to
377create automated scripts to determine whether or not to automatically
378start up \fBsmartd\fP after installing smartmontools. After starting
379\fBsmartd\fP with this command-line option, the distribution\'s install
380scripts should wait a reasonable length of time (say ten seconds). If
381\fBsmartd\fP has not exited with zero status by that time, the script
382should send \fBsmartd\fP a SIGTERM or SIGKILL and assume that
383\fBsmartd\fP will not operate correctly on the host. Conversely, if
384\fBsmartd\fP exits with zero status, then it is safe to run
385\fBsmartd\fP in normal daemon mode. If \fBsmartd\fP is unable to
386monitor any devices or encounters other problems then it will return
387with non-zero exit status.
388
389.I showtests
390\- Start \fBsmartd\fP in debug mode, then register devices, then write
391a list of future scheduled self tests to stdout, and then exit with zero
392exit status if all of these steps worked correctly.
393Device's SMART status is not checked.
394
395This option is intended to test whether the '-s REGEX' directives in
396smartd.conf will have the desired effect. The output lists the next test
397schedules, limited to 5 tests per type and device. This is followed by a
398summary of all tests of each device within the next 90 days.
399.TP
400.B \-r TYPE, \-\-report=TYPE
401Intended primarily to help
402.B smartmontools
403developers understand the behavior of
404.B smartmontools
405on non-conforming or poorly-conforming hardware. This option reports
406details of
407\fBsmartd\fP
408transactions with the device. The option can be used multiple times.
409When used just once, it shows a record of the ioctl() transactions
410with the device. When used more than once, the detail of these ioctl()
411transactions are reported in greater detail. The valid arguments to
412this option are:
413
414.I ioctl
415\- report all ioctl() transactions.
416
417.I ataioctl
418\- report only ioctl() transactions with ATA devices.
419
420.I scsiioctl
421\- report only ioctl() transactions with SCSI devices.
422
423Any argument may include a positive integer to specify the level of
424detail that should be reported. The argument should be followed by a
425comma then the integer with no spaces. For example, \fIataioctl,2\fP
426The default level is 1, so \'\-r ataioctl,1\' and \'\-r ataioctl\' are
427equivalent.
2127e193
GI
428.TP
429.B \-s PREFIX, \-\-savestates=PREFIX
cfbba5b9 430[ATA only] Reads/writes \fBsmartd\fP state information from/to files
2127e193
GI
431\'PREFIX\'\'MODEL\-SERIAL.ata.state\'. This preserves SMART attributes, drive
432min and max temperatures (\-W directive), info about last sent warning email
433(\-m directive), and the time of next check of the self-test REGEXP
434(\-s directive) across boot cycles.
435
d008864d 436.\" %IF ENABLE_SAVESTATES
2127e193
GI
437If this option is not specified, state information is maintained in files
438\'/usr/local/var/lib/smartmontools/smartd.MODEL\-SERIAL.ata.state\'.
439To disable state files, specify this option with an empty string
440argument: \'-s ""\'.
d008864d 441.\" %ENDIF ENABLE_SAVESTATES
2127e193
GI
442MODEL and SERIAL are build from drive identify information, invalid
443characters are replaced by underline.
444
445If the PREFIX has the form \'/path/dir/\' (e.g. \'/var/lib/smartd/\'), then
446files \'MODEL\-SERIAL.ata.state\' are created in directory \'/path/dir\'.
447If the PREFIX has the form \'/path/name\' (e.g. \'/var/lib/misc/smartd\-\'),
448then files 'nameMODEL\-SERIAL.ata.state' are created in directory '/path/'.
449The path must be absolute, except if debug mode is enabled.
450
451The state information files are read on smartd startup. The files are
452always (re)written after reading the configuration file, before rereading
453the configuration file (SIGHUP), before smartd shutdown, and after a check
454forced by SIGUSR1. After a normal check cycle, a file is only rewritten if
455an important change (which usually results in a SYSLOG output) occurred.
d008864d 456.\" %IF OS Windows
832b75ed
GG
457.TP
458.B \-\-service
f4e463df 459[Windows only] Enables \fBsmartd\fP to run as a Windows service.
832b75ed
GG
460The option must be specified in the service command line as the first
461argument. It should not be used from console.
462See NOTES below for details.
d008864d 463.\" %ENDIF OS Windows
832b75ed
GG
464.TP
465.B \-V, \-\-version, \-\-license, \-\-copyright
2127e193
GI
466Prints version, copyright, license, home page and SVN revision
467information for your copy of \fBsmartd\fP to STDOUT and then exits.
468Please include this information if you are reporting bugs or problems.
832b75ed
GG
469
470.SH EXAMPLES
471
472.B
473smartd
474.fi
475Runs the daemon in forked mode. This is the normal way to run
476\fBsmartd\fP.
e9583e0c 477Entries are logged to SYSLOG.
832b75ed
GG
478
479.B
480smartd -d -i 30
481.fi
482Run in foreground (debug) mode, checking the disk status
483every 30 seconds.
484
485.B
486smartd -q onecheck
487.fi
488Registers devices, and checks the status of the devices exactly
489once. The exit status (the bash
490.B $?
491variable) will be zero if all went well, and nonzero if no devices
492were detected or some other problem was encountered.
493
494.fi
495Note that \fBsmartmontools\fP provides a start-up script in
496\fB/usr/local/etc/rc.d/init.d/smartd\fP which is responsible for starting and
497stopping the daemon via the normal init interface. Using this script,
498you can start \fBsmartd\fP by giving the command:
499.nf
500.B /usr/local/etc/rc.d/init.d/smartd start
501.fi
502and stop it by using the command:
503.nf
504.B /usr/local/etc/rc.d/init.d/smartd stop
832b75ed 505.fi
d008864d
GI
506.SH CONFIGURATION
507The syntax of the smartd.conf(5) file is discussed separately.
832b75ed
GG
508.SH NOTES
509\fBsmartd\fP
510will make log entries at loglevel
511.B LOG_INFO
512if the Normalized SMART Attribute values have changed, as reported using the
513.B \'\-t\', \'\-p\',
514or
515.B \'\-u\'
516Directives. For example:
517.nf
518.B \'Device: /dev/hda, SMART Attribute: 194 Temperature_Celsius changed from 94 to 93\'
519.fi
520Note that in this message, the value given is the \'Normalized\' not the \'Raw\'
521Attribute value (the disk temperature in this case is about 22
522Celsius). The
523.B \'-R\'
524and
525.B \'-r\'
526Directives modify this behavior, so that the information is printed
527with the Raw values as well, for example:
528.nf
529.B \'Device: /dev/hda, SMART Attribute: 194 Temperature_Celsius changed from 94 [Raw 22] to 93 [Raw 23]\'
530.fi
531Here the Raw values are the actual disk temperatures in Celsius. The
532way in which the Raw values are printed, and the names under which the
533Attributes are reported, is governed by the various
534.B \'-v Num,Description\'
535Directives described previously.
536
537Please see the
538.B smartctl
539manual page for further explanation of the differences between
540Normalized and Raw Attribute values.
541
542\fBsmartd\fP
543will make log entries at loglevel
544.B LOG_CRIT
545if a SMART Attribute has failed, for example:
546.nf
547.B \'Device: /dev/hdc, Failed SMART Attribute: 5 Reallocated_Sector_Ct\'
548.fi
549 This loglevel is used for reporting enabled by the
550.B \'\-H\', \-f\', \'\-l\ selftest\',
551and
552.B \'\-l\ error\'
553Directives. Entries reporting failure of SMART Prefailure Attributes
554should not be ignored: they mean that the disk is failing. Use the
555.B smartctl
556utility to investigate.
557
d008864d 558.\" %IF OS Solaris
832b75ed
GG
559Under Solaris with the default \fB/etc/syslog.conf\fP configuration,
560messages below loglevel \fBLOG_NOTICE\fP will \fBnot\fP be recorded.
561Hence all \fBsmartd\fP messages with loglevel \fBLOG_INFO\fP will be
562lost. If you want to use the existing daemon facility to log all
563messages from \fBsmartd\fP, you should change \fB/etc/syslog.conf\fP
564from:
565.nf
566 ...;daemon.notice;... /var/adm/messages
567.fi
568to read:
569.nf
570 ...;daemon.info;... /var/adm/messages
571.fi
572Alternatively, you can use a local facility to log messages: please
573see the \fBsmartd\fP '-l' command-line option described above.
574
d008864d
GI
575.\" %ENDIF OS Solaris
576.\" %IF OS Cygwin
577The Cygwin Version of \fBsmartd\fP can be run as a service via the
578cygrunsrv tool. The start-up script provides Cygwin-specific commands
579to install and remove the service:
580.nf
581.B /usr/local/etc/rc.d/init.d/smartd install [options]
582.B /usr/local/etc/rc.d/init.d/smartd remove
583.fi
584The service can be started and stopped by the start-up script as usual
585(see \fBEXAMPLES\fP above).
586
587.\" %ENDIF OS Cygwin
588.\" %IF OS Windows
589On Windows, the log messages are written to the event log or to a file.
590See documentation of the '-l FACILITY' option above for details.
832b75ed
GG
591
592On Windows, the following built-in commands can be used to control
593\fBsmartd\fP, if running as a daemon:
594
595\'\fBsmartd status\fP\' \- check status
596
597\'\fBsmartd stop\fP\' \- stop smartd
598
599\'\fBsmartd reload\fP\' \- reread config file
600
601\'\fBsmartd restart\fP\' \- restart smartd
602
603\'\fBsmartd sigusr1\fP\' \- check disks now
604
605\'\fBsmartd sigusr2\fP\' \- toggle debug mode
606
832b75ed
GG
607The Windows Version of \fBsmartd\fP has buildin support for services:
608
609\'\fBsmartd install [options]\fP\' installs a service
610named "smartd" (display name "SmartD Service") using the command line
d008864d 611\'/INSTALLPATH/smartd.exe \-\-service [options]\'.
832b75ed
GG
612
613\'\fBsmartd remove\fP\' can later be used to remove the service entry
614from registry.
615
616Upon startup, the smartd service changes the working directory
617to its own installation path. If smartd.conf and blat.exe are stored
618in this directory, no \'-c\' option and \'-M exec\' directive is needed.
619
620The debug mode (\'-d\', \'-q onecheck\') does not work if smartd is
621running as service.
622
623The service can be controlled as usual with Windows commands \'net\'
624or \'sc\' (\'\fBnet start smartd\fP\', \'\fBnet stop smartd\fP\').
625
626Pausing the service (\'\fBnet pause smartd\fP\') sets the interval between
627disk checks (\'-i N\') to infinite.
628
629Continuing the paused service (\'\fBnet continue smartd\fP\') resets the
630interval and rereads the configuration file immediately (like \fBSIGHUP\fP):
631
632Continuing a still running service (\'\fBnet continue smartd\fP\' without
633preceding \'\fBnet pause smartd\fP\') does not reread configuration but
634checks disks immediately (like \fBSIGUSR1\fP).
635
d008864d 636.\" %ENDIF OS Windows
832b75ed
GG
637.SH LOG TIMESTAMP TIMEZONE
638
639When \fBsmartd\fP makes log entries, these are time-stamped. The time
640stamps are in the computer's local time zone, which is generally set
641using either the environment variable \'\fBTZ\fP\' or using a
642time-zone file such as \fB/etc/localtime\fP. You may wish to change
643the timezone while \fBsmartd\fP is running (for example, if you carry
644a laptop to a new time-zone and don't reboot it). Due to a bug in the
645\fBtzset(3)\fP function of many unix standard C libraries, the
646time-zone stamps of \fBsmartd\fP might not change. For some systems,
647\fBsmartd\fP will work around this problem \fIif\fP the time-zone is
648set using \fB/etc/localtime\fP. The work-around \fIfails\fP if the
649time-zone is set using the \'\fBTZ\fP\' variable (or a file that it
650points to).
651
652
653.SH RETURN VALUES
654The return value (exit status) of
655\fBsmartd\fP
656can have the following values:
657.TP
658.B 0:
659Daemon startup successful, or \fBsmartd\fP was killed by a SIGTERM (or in debug mode, a SIGQUIT).
660.TP
661.B 1:
662Commandline did not parse.
663.TP
664.B 2:
665There was a syntax error in the config file.
666.TP
667.B 3:
668Forking the daemon failed.
669.TP
670.B 4:
671Couldn\'t create PID file.
672.TP
673.B 5:
674Config file does not exist (only returned in conjunction with the \'-c\' option).
675.TP
676.B 6:
677Config file exists, but cannot be read.
678.TP
679.B 8:
680\fBsmartd\fP
681ran out of memory during startup.
682.TP
683.B 9:
684A compile time constant of\fB smartd\fP was too small. This can be caused by an
685excessive number of disks, or by lines in \fB /usr/local/etc/smartd.conf\fP that are too long.
686Please report this problem to \fB smartmontools-support@lists.sourceforge.net\fP.
687.TP
f4e463df 688.B 10:
832b75ed
GG
689An inconsistency was found in \fBsmartd\fP\'s internal data
690structures. This should never happen. It must be due to either a
691coding or compiler bug. \fIPlease\fP report such failures to
692smartmontools-support@lists.sourceforge.net.
693.TP
694.B 16:
695A device explicitly listed in
696.B /usr/local/etc/smartd.conf
697can\'t be monitored.
698.TP
699.B 17:
700\fBsmartd\fP
701didn\'t find any devices to monitor.
702.TP
703.B 254:
704When in daemon mode,
705\fBsmartd\fP
706received a SIGINT or SIGQUIT. (Note that in debug mode, SIGINT has
707the same effect as SIGHUP, and makes \fBsmartd\fP reload its
708configuration file. SIGQUIT has the same effect as SIGTERM and causes
709\fBsmartd\fP to exit with zero exit status.
710.TP
711.B 132 and above
712\fBsmartd\fP
713was killed by a signal that is not explicitly listed above. The exit
714status is then 128 plus the signal number. For example if
715\fBsmartd\fP
716is killed by SIGKILL (signal 9) then the exit status is 137.
717
718.PP
719.SH AUTHOR
e9583e0c 720\fBBruce Allen\fP smartmontools\-support@lists.sourceforge.net
832b75ed
GG
721.fi
722University of Wisconsin \- Milwaukee Physics Department
723
724.PP
725.SH CONTRIBUTORS
726The following have made large contributions to smartmontools:
727.nf
728\fBCasper Dik\fP (Solaris SCSI interface)
2127e193 729\fBChristian Franke\fP (Windows interface, C++ redesign, USB support, ...)
832b75ed
GG
730\fBDouglas Gilbert\fP (SCSI subsystem)
731\fBGuido Guenther\fP (Autoconf/Automake packaging)
732\fBGeoffrey Keating\fP (Darwin ATA interface)
733\fBEduard Martinescu\fP (FreeBSD interface)
d008864d 734\fBFr\['e]d\['e]ric L. W. Meunier\fP (Web site and Mailing list)
2127e193 735\fBGabriele Pohl\fP (Web site and Wiki, conversion from CVS to SVN)
832b75ed 736\fBKeiji Sawada\fP (Solaris ATA interface)
2127e193 737\fBManfred Schwarb\fP (Drive database)
832b75ed
GG
738\fBSergey Svishchev\fP (NetBSD interface)
739\fBDavid Snyder and Sergey Svishchev\fP (OpenBSD interface)
740\fBPhil Williams\fP (User interface and drive database)
2127e193 741\fBShengfeng Zhou\fP (Linux/FreeBSD HighPoint RocketRAID interface)
832b75ed
GG
742.fi
743Many other individuals have made smaller contributions and corrections.
744
745.PP
746.SH CREDITS
747.fi
748This code was derived from the smartsuite package, written by Michael
e9583e0c
GI
749Cornwell, and from the previous UCSC smartsuite package. It extends
750these to cover ATA\-5 disks. This code was originally developed as a
832b75ed
GG
751Senior Thesis by Michael Cornwell at the Concurrent Systems Laboratory
752(now part of the Storage Systems Research Center), Jack Baskin School
753of Engineering, University of California, Santa
754Cruz. \fBhttp://ssrc.soe.ucsc.edu/\fP .
755.SH
756HOME PAGE FOR SMARTMONTOOLS:
757.fi
758Please see the following web site for updates, further documentation, bug
759reports and patches: \fBhttp://smartmontools.sourceforge.net/\fP
760
e9583e0c
GI
761.SH
762SEE ALSO:
832b75ed
GG
763\fBsmartd.conf\fP(5), \fBsmartctl\fP(8), \fBsyslogd\fP(8),
764\fBsyslog.conf\fP(5), \fBbadblocks\fP(8), \fBide\-smart\fP(8), \fBregex\fP(7).
765
766.SH
767REFERENCES FOR SMART
768.fi
769An introductory article about smartmontools is \fIMonitoring Hard
770Disks with SMART\fP, by Bruce Allen, Linux Journal, January 2004,
e9583e0c 771pages 74\-77. This is \fBhttp://www.linuxjournal.com/article/6983\fP
832b75ed
GG
772online.
773
774If you would like to understand better how SMART works, and what it
775does, a good place to start is with Sections 4.8 and 6.54 of the first
e9583e0c
GI
776volume of the \'AT Attachment with Packet Interface\-7\' (ATA/ATAPI\-7)
777specification Revision 4b. This documents the SMART functionality which the
778\fBsmartmontools\fP utilities provide access to.
832b75ed
GG
779
780.fi
e9583e0c
GI
781The functioning of SMART was originally defined by the SFF\-8035i
782revision 2 and the SFF\-8055i revision 1.4 specifications. These are
783publications of the Small Form Factors (SFF) Committee.
784
785Links to these and other documents may be found on the Links page of the
786\fBsmartmontools\fP Wiki at
787\fBhttp://sourceforge.net/apps/trac/smartmontools/wiki/Links\fP .
832b75ed
GG
788
789.SH
2127e193 790SVN ID OF THIS PAGE:
f4e463df 791$Id: smartd.8.in 3561 2012-06-05 19:49:31Z chrfranke $