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