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