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